@reflectmoney/stable.ts 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/classes/ReflectTokenisedBond.js +7 -0
  2. package/dist/stablecoins/LstStablecoin.js +14 -1
  3. package/dist/stablecoins/UsdcPlusStablecoin.js +6 -1
  4. package/package.json +1 -1
  5. package/dist/classes/PdaClient.d.ts +0 -131
  6. package/dist/classes/Reflect.d.ts +0 -7
  7. package/dist/classes/ReflectAdmin.d.ts +0 -104
  8. package/dist/classes/ReflectAdmin.js +0 -219
  9. package/dist/classes/ReflectKeeper.d.ts +0 -107
  10. package/dist/classes/ReflectTokenisedBond.d.ts +0 -75
  11. package/dist/classes/Stablecoin.d.ts +0 -187
  12. package/dist/classes/index.d.ts +0 -4
  13. package/dist/constants/drift.d.ts +0 -6
  14. package/dist/constants/index.d.ts +0 -7
  15. package/dist/constants/jupiter.d.ts +0 -4
  16. package/dist/constants/lookupTables.d.ts +0 -4
  17. package/dist/constants/lst.d.ts +0 -3
  18. package/dist/constants/pyth.d.ts +0 -1
  19. package/dist/constants/usdc.d.ts +0 -6
  20. package/dist/constants/wsol.d.ts +0 -6
  21. package/dist/errors/ReflectError.d.ts +0 -4
  22. package/dist/generated/reflect_main/accounts/DriftJlpController.d.ts +0 -116
  23. package/dist/generated/reflect_main/accounts/DriftLstController.d.ts +0 -110
  24. package/dist/generated/reflect_main/accounts/DriftUsdcController.d.ts +0 -136
  25. package/dist/generated/reflect_main/accounts/Main.d.ts +0 -112
  26. package/dist/generated/reflect_main/accounts/PerpMarket.d.ts +0 -228
  27. package/dist/generated/reflect_main/accounts/PrelaunchOracle.d.ts +0 -132
  28. package/dist/generated/reflect_main/accounts/PythLazerOracle.d.ts +0 -126
  29. package/dist/generated/reflect_main/accounts/RebalanceLst.d.ts +0 -113
  30. package/dist/generated/reflect_main/accounts/SpotMarket.d.ts +0 -379
  31. package/dist/generated/reflect_main/accounts/User.d.ts +0 -223
  32. package/dist/generated/reflect_main/accounts/UserPermissions.d.ts +0 -108
  33. package/dist/generated/reflect_main/accounts/UserStats.d.ts +0 -213
  34. package/dist/generated/reflect_main/accounts/index.d.ts +0 -38
  35. package/dist/generated/reflect_main/errors/index.d.ts +0 -969
  36. package/dist/generated/reflect_main/index.d.ts +0 -19
  37. package/dist/generated/reflect_main/instructions/addLstDrift.d.ts +0 -49
  38. package/dist/generated/reflect_main/instructions/addSubAccount.d.ts +0 -54
  39. package/dist/generated/reflect_main/instructions/captureSpreadDrift.d.ts +0 -66
  40. package/dist/generated/reflect_main/instructions/captureSpreadDriftS1.d.ts +0 -58
  41. package/dist/generated/reflect_main/instructions/createAdminAccount.d.ts +0 -51
  42. package/dist/generated/reflect_main/instructions/createUserStatsAccount.d.ts +0 -52
  43. package/dist/generated/reflect_main/instructions/depositDrift.d.ts +0 -73
  44. package/dist/generated/reflect_main/instructions/freezeProgram.d.ts +0 -54
  45. package/dist/generated/reflect_main/instructions/freezeProtocolAction.d.ts +0 -55
  46. package/dist/generated/reflect_main/instructions/freezeStrategyAction.d.ts +0 -58
  47. package/dist/generated/reflect_main/instructions/index.d.ts +0 -34
  48. package/dist/generated/reflect_main/instructions/initDriftAccountsS1.d.ts +0 -54
  49. package/dist/generated/reflect_main/instructions/initDriftControllerS1.d.ts +0 -60
  50. package/dist/generated/reflect_main/instructions/initDriftControllerS3.d.ts +0 -58
  51. package/dist/generated/reflect_main/instructions/initMain.d.ts +0 -43
  52. package/dist/generated/reflect_main/instructions/mintDriftS1.d.ts +0 -86
  53. package/dist/generated/reflect_main/instructions/mintDriftS3.d.ts +0 -86
  54. package/dist/generated/reflect_main/instructions/processSwapDeposit.d.ts +0 -69
  55. package/dist/generated/reflect_main/instructions/processSwapWithdraw.d.ts +0 -69
  56. package/dist/generated/reflect_main/instructions/redeemDriftS1.d.ts +0 -87
  57. package/dist/generated/reflect_main/instructions/redeemDriftS3.d.ts +0 -87
  58. package/dist/generated/reflect_main/instructions/settlePnl.d.ts +0 -55
  59. package/dist/generated/reflect_main/instructions/settlePnlMulti.d.ts +0 -65
  60. package/dist/generated/reflect_main/instructions/suspendSplProtocol.d.ts +0 -54
  61. package/dist/generated/reflect_main/instructions/suspendSplStrategy.d.ts +0 -56
  62. package/dist/generated/reflect_main/instructions/swapOrca.d.ts +0 -81
  63. package/dist/generated/reflect_main/instructions/swapOrcaTwoHop.d.ts +0 -101
  64. package/dist/generated/reflect_main/instructions/updateActionRoleProtocol.d.ts +0 -58
  65. package/dist/generated/reflect_main/instructions/updateActionRoleStrategy.d.ts +0 -60
  66. package/dist/generated/reflect_main/instructions/updateAttenuation.d.ts +0 -57
  67. package/dist/generated/reflect_main/instructions/updateCap.d.ts +0 -55
  68. package/dist/generated/reflect_main/instructions/updateRebalanceSlippage.d.ts +0 -55
  69. package/dist/generated/reflect_main/instructions/updateRecipients.d.ts +0 -56
  70. package/dist/generated/reflect_main/instructions/updateRoleHolderProtocol.d.ts +0 -60
  71. package/dist/generated/reflect_main/instructions/updateRoleHolderStrategy.d.ts +0 -60
  72. package/dist/generated/reflect_main/types/AMM.d.ts +0 -102
  73. package/dist/generated/reflect_main/types/AccKey.d.ts +0 -15
  74. package/dist/generated/reflect_main/types/AccessControl.d.ts +0 -18
  75. package/dist/generated/reflect_main/types/AccessMap.d.ts +0 -17
  76. package/dist/generated/reflect_main/types/Action.d.ts +0 -35
  77. package/dist/generated/reflect_main/types/ActionMapping.d.ts +0 -19
  78. package/dist/generated/reflect_main/types/AssetTier.d.ts +0 -23
  79. package/dist/generated/reflect_main/types/Attenuation.d.ts +0 -16
  80. package/dist/generated/reflect_main/types/BalanceType.d.ts +0 -20
  81. package/dist/generated/reflect_main/types/Capture.d.ts +0 -17
  82. package/dist/generated/reflect_main/types/ContractTier.d.ts +0 -24
  83. package/dist/generated/reflect_main/types/ContractType.d.ts +0 -20
  84. package/dist/generated/reflect_main/types/CorpAction.d.ts +0 -19
  85. package/dist/generated/reflect_main/types/CustodyInfo.d.ts +0 -20
  86. package/dist/generated/reflect_main/types/DirectionCollateral.d.ts +0 -20
  87. package/dist/generated/reflect_main/types/DirectionPosition.d.ts +0 -20
  88. package/dist/generated/reflect_main/types/DriftControllerBase.d.ts +0 -15
  89. package/dist/generated/reflect_main/types/DriftJlpControllerFixedAccounts.d.ts +0 -18
  90. package/dist/generated/reflect_main/types/DriftLstData.d.ts +0 -17
  91. package/dist/generated/reflect_main/types/Ema.d.ts +0 -17
  92. package/dist/generated/reflect_main/types/Externals.d.ts +0 -16
  93. package/dist/generated/reflect_main/types/FlowControl.d.ts +0 -17
  94. package/dist/generated/reflect_main/types/HistoricalIndexData.d.ts +0 -19
  95. package/dist/generated/reflect_main/types/HistoricalOracleData.d.ts +0 -20
  96. package/dist/generated/reflect_main/types/Holding.d.ts +0 -21
  97. package/dist/generated/reflect_main/types/Holdings.d.ts +0 -17
  98. package/dist/generated/reflect_main/types/InsuranceClaim.d.ts +0 -19
  99. package/dist/generated/reflect_main/types/InsuranceFund.d.ts +0 -24
  100. package/dist/generated/reflect_main/types/JlpRebalanceSettings.d.ts +0 -15
  101. package/dist/generated/reflect_main/types/KillSwitch.d.ts +0 -15
  102. package/dist/generated/reflect_main/types/LevelRoles.d.ts +0 -16
  103. package/dist/generated/reflect_main/types/MarketStatus.d.ts +0 -27
  104. package/dist/generated/reflect_main/types/MarketType.d.ts +0 -20
  105. package/dist/generated/reflect_main/types/ModifyOrderParams.d.ts +0 -32
  106. package/dist/generated/reflect_main/types/ModifyOrderPolicy.d.ts +0 -20
  107. package/dist/generated/reflect_main/types/Movements.d.ts +0 -19
  108. package/dist/generated/reflect_main/types/OracleGuardRails.d.ts +0 -18
  109. package/dist/generated/reflect_main/types/OracleSource.d.ts +0 -34
  110. package/dist/generated/reflect_main/types/OracleValidity.d.ts +0 -25
  111. package/dist/generated/reflect_main/types/Order.d.ts +0 -43
  112. package/dist/generated/reflect_main/types/OrderDirection.d.ts +0 -20
  113. package/dist/generated/reflect_main/types/OrderParams.d.ts +0 -36
  114. package/dist/generated/reflect_main/types/OrderStatus.d.ts +0 -22
  115. package/dist/generated/reflect_main/types/OrderTriggerCondition.d.ts +0 -22
  116. package/dist/generated/reflect_main/types/OrderType.d.ts +0 -23
  117. package/dist/generated/reflect_main/types/PermissionLevel.d.ts +0 -51
  118. package/dist/generated/reflect_main/types/PerpHedge.d.ts +0 -17
  119. package/dist/generated/reflect_main/types/PerpPosition.d.ts +0 -29
  120. package/dist/generated/reflect_main/types/PoolBalance.d.ts +0 -17
  121. package/dist/generated/reflect_main/types/Position.d.ts +0 -20
  122. package/dist/generated/reflect_main/types/PositionDirection.d.ts +0 -20
  123. package/dist/generated/reflect_main/types/PositionDrift.d.ts +0 -18
  124. package/dist/generated/reflect_main/types/PostOnlyParam.d.ts +0 -22
  125. package/dist/generated/reflect_main/types/Price.d.ts +0 -41
  126. package/dist/generated/reflect_main/types/PriceComp.d.ts +0 -19
  127. package/dist/generated/reflect_main/types/PriceDivergenceGuardRails.d.ts +0 -16
  128. package/dist/generated/reflect_main/types/PriceInfo.d.ts +0 -21
  129. package/dist/generated/reflect_main/types/PriceStatus.d.ts +0 -22
  130. package/dist/generated/reflect_main/types/PriceType.d.ts +0 -20
  131. package/dist/generated/reflect_main/types/Program.d.ts +0 -19
  132. package/dist/generated/reflect_main/types/ProgramStatus.d.ts +0 -20
  133. package/dist/generated/reflect_main/types/Recipient.d.ts +0 -17
  134. package/dist/generated/reflect_main/types/Recipients.d.ts +0 -17
  135. package/dist/generated/reflect_main/types/Role.d.ts +0 -25
  136. package/dist/generated/reflect_main/types/ShiftCollateral.d.ts +0 -19
  137. package/dist/generated/reflect_main/types/ShiftPosition.d.ts +0 -17
  138. package/dist/generated/reflect_main/types/ShortHolding.d.ts +0 -17
  139. package/dist/generated/reflect_main/types/SplBase.d.ts +0 -17
  140. package/dist/generated/reflect_main/types/SplMain.d.ts +0 -22
  141. package/dist/generated/reflect_main/types/Spls.d.ts +0 -17
  142. package/dist/generated/reflect_main/types/SpotBalanceType.d.ts +0 -20
  143. package/dist/generated/reflect_main/types/SpotPosition.d.ts +0 -23
  144. package/dist/generated/reflect_main/types/Status.d.ts +0 -21
  145. package/dist/generated/reflect_main/types/Strategy.d.ts +0 -32
  146. package/dist/generated/reflect_main/types/StrategyPadding.d.ts +0 -15
  147. package/dist/generated/reflect_main/types/StrategyRoleEntry.d.ts +0 -17
  148. package/dist/generated/reflect_main/types/SubAccount.d.ts +0 -17
  149. package/dist/generated/reflect_main/types/Update.d.ts +0 -20
  150. package/dist/generated/reflect_main/types/UserFees.d.ts +0 -20
  151. package/dist/generated/reflect_main/types/ValidityGuardRails.d.ts +0 -18
  152. package/dist/generated/reflect_main/types/index.d.ts +0 -80
  153. package/dist/generated/reflect_tokenised_bonds/accounts/Admin.d.ts +0 -101
  154. package/dist/generated/reflect_tokenised_bonds/accounts/Config.d.ts +0 -108
  155. package/dist/generated/reflect_tokenised_bonds/accounts/Vault.d.ts +0 -116
  156. package/dist/generated/reflect_tokenised_bonds/accounts/index.d.ts +0 -11
  157. package/dist/generated/reflect_tokenised_bonds/errors/index.d.ts +0 -144
  158. package/dist/generated/reflect_tokenised_bonds/index.d.ts +0 -19
  159. package/dist/generated/reflect_tokenised_bonds/instructions/createVault.d.ts +0 -50
  160. package/dist/generated/reflect_tokenised_bonds/instructions/deposit.d.ts +0 -62
  161. package/dist/generated/reflect_tokenised_bonds/instructions/index.d.ts +0 -4
  162. package/dist/generated/reflect_tokenised_bonds/instructions/initialize.d.ts +0 -43
  163. package/dist/generated/reflect_tokenised_bonds/instructions/withdraw.d.ts +0 -62
  164. package/dist/generated/reflect_tokenised_bonds/types/DepositArgs.d.ts +0 -17
  165. package/dist/generated/reflect_tokenised_bonds/types/Permissions.d.ts +0 -21
  166. package/dist/generated/reflect_tokenised_bonds/types/WithdrawArgs.d.ts +0 -16
  167. package/dist/generated/reflect_tokenised_bonds/types/index.d.ts +0 -3
  168. package/dist/helpers/getOrcaQuote.d.ts +0 -3
  169. package/dist/idl/perpetuals.d.ts +0 -5771
  170. package/dist/index.d.ts +0 -8
  171. package/dist/stablecoins/JlpStablecoin.d.ts +0 -1
  172. package/dist/stablecoins/JlpStablecoin.js +0 -44
  173. package/dist/stablecoins/LstStablecoin.d.ts +0 -65
  174. package/dist/stablecoins/UsdcPlusStablecoin.d.ts +0 -68
  175. package/dist/stablecoins/UsdcStablecoin.d.ts +0 -64
  176. package/dist/stablecoins/UsdcStablecoin.js +0 -145
  177. package/dist/stablecoins/UsdjStablecoin.d.ts +0 -1
  178. package/dist/stablecoins/index.d.ts +0 -3
@@ -1,75 +0,0 @@
1
- /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
2
- /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
- import { Connection } from "@solana/web3.js";
4
- import { PublicKey } from "@solana/web3.js";
5
- import BN from "bn.js";
6
- import { Keypair } from "@solana/web3.js";
7
- /**
8
- * Client class for interacting with the Reflect Tokenised Bonds program.
9
- * Provides functionality for creating and managing tokenized bond vaults,
10
- * including receipt token creation, vault initialization, deposits, and withdrawals.
11
- *
12
- * This class handles the tokenized bonds aspect of the Reflect protocol,
13
- * allowing users to deposit assets and receive receipt tokens representing
14
- * their share of the vault.
15
- */
16
- export declare class ReflectTokenisedBond {
17
- /** Solana connection instance for RPC communication */
18
- connection: Connection;
19
- /**
20
- * Creates a new ReflectTokenisedBond instance.
21
- *
22
- * @param connection - Solana connection instance
23
- */
24
- constructor(connection: Connection);
25
- /**
26
- * Creates a receipt token for a vault.
27
- * Generates a new keypair for the receipt token mint and creates the necessary instructions.
28
- *
29
- * @param connection - Solana connection instance
30
- * @param signer - Public key of the transaction signer
31
- * @param vault - Public key of the vault account
32
- * @returns Promise resolving to an object containing instructions and signers
33
- */
34
- createReceiptToken(connection: Connection, signer: PublicKey, vault: PublicKey): Promise<{
35
- instructions: import("@solana/web3.js").TransactionInstruction[];
36
- signers: Keypair[];
37
- }>;
38
- /**
39
- * Initializes the tokenized bonds program.
40
- * Creates the config and admin accounts for the program.
41
- *
42
- * @param signer - Public key of the admin signer
43
- * @returns Promise resolving to a TransactionInstruction
44
- */
45
- initialize(signer: PublicKey): Promise<import("@solana/web3.js").TransactionInstruction>;
46
- /**
47
- * Initializes a new vault with specified deposit and receipt mints.
48
- *
49
- * @param signer - Public key of the admin signer
50
- * @param depositMint - Public key of the deposit token mint
51
- * @param receiptMint - Public key of the receipt token mint
52
- * @returns Promise resolving to a TransactionInstruction
53
- */
54
- initializeVault(signer: PublicKey, depositMint: PublicKey, receiptMint: PublicKey): Promise<import("@solana/web3.js").TransactionInstruction>;
55
- /**
56
- * Creates a deposit instruction for a vault.
57
- * Allows users to deposit assets and receive receipt tokens.
58
- *
59
- * @param signer - Public key of the user making the deposit
60
- * @param vaultId - Numeric identifier for the vault
61
- * @param amount - Amount of deposit tokens to deposit
62
- * @returns Promise resolving to a TransactionInstruction
63
- */
64
- deposit(signer: PublicKey, vaultId: number, amount: BN): Promise<import("@solana/web3.js").TransactionInstruction>;
65
- /**
66
- * Creates a withdrawal instruction for a vault.
67
- * Allows users to burn receipt tokens and receive back their deposit tokens.
68
- *
69
- * @param signer - Public key of the user making the withdrawal
70
- * @param vaultId - Numeric identifier for the vault
71
- * @param amount - Amount of receipt tokens to burn for withdrawal
72
- * @returns Promise resolving to a TransactionInstruction
73
- */
74
- withdraw(signer: PublicKey, vaultId: number, amount: BN): Promise<import("@solana/web3.js").TransactionInstruction>;
75
- }
@@ -1,187 +0,0 @@
1
- import { AccountMeta, Connection, Keypair, PublicKey, TransactionInstruction } from "@solana/web3.js";
2
- import BN from "bn.js";
3
- import { DriftClient } from "@drift-labs/sdk";
4
- import { Action, Strategy } from "../generated/reflect_main";
5
- import { StablecoinMetadata, Collateral, Controller } from "../types";
6
- /**
7
- * Abstract base class for all stablecoin implementations in the Reflect protocol.
8
- * Provides common functionality for managing stablecoins including initialization,
9
- * minting, redemption, rebalancing, and administrative operations.
10
- *
11
- * This class serves as the foundation for different stablecoins:
12
- * - USDC+ (Index 0): Stablecoin backed by USDC deployed in money markets
13
- * - JLP Hedged (Index 1): JLP token hedged with perpetual positions
14
- * - LST Delta-Neutral (Index 2): Stablecoin backed by LSTs and delta-neutral strategies
15
- */
16
- export declare abstract class Stablecoin<T extends Controller> {
17
- /** Unique index identifier for the stablecoin */
18
- index: number;
19
- /** Human-readable name of the stablecoin */
20
- name: string;
21
- /** Solana connection instance for communication */
22
- connection: Connection;
23
- /** Public key of the controller account for this stablecoin */
24
- controllerKey: PublicKey;
25
- /** Public key of the controller account for this stablecoin */
26
- controller: T;
27
- /** Public key of the controller account for this stablecoin */
28
- strategy: Strategy;
29
- /** Array of collateral assets backing this stablecoin */
30
- collaterals: Collateral[];
31
- /** Public key of the stablecoin mint */
32
- stablecoinMint: PublicKey;
33
- /** Optional Drift client instance for DeFi operations */
34
- driftClient?: DriftClient;
35
- /** Lookup table with stablecoin-specific accounts. */
36
- lookupTable: PublicKey;
37
- /**
38
- * Loads the controller account for this stablecoin.
39
- *
40
- * @returns Promise resolving to void, sets the controller and strategy fields
41
- */
42
- load(schema: {
43
- fromAccountAddress: (connection: Connection, key: PublicKey) => Promise<T>;
44
- }): Promise<void>;
45
- buildLookupTables<T>(signer: PublicKey): Promise<{
46
- instructions: TransactionInstruction[];
47
- lookupTable: PublicKey;
48
- }>;
49
- setLookupTable(address: PublicKey): Promise<void>;
50
- /**
51
- * Creates a new Stablecoin instance.
52
- *
53
- * @param index - Unique strategy index (0: USDC+, 1: JLP, 2: LST)
54
- * @param name - Human-readable name for the stablecoin
55
- * @param connection - Solana connection instance
56
- */
57
- constructor(index: number, name: string, connection: Connection, lookupTable: PublicKey);
58
- /**
59
- * Initializes token accounts for the specified owner and mints.
60
- * Creates associated token accounts if they don't exist.
61
- *
62
- * @param owner - Public key of the token account owner
63
- * @param mints - Array of mint public keys to create accounts for
64
- * @param signer - Public key of the transaction signer
65
- * @returns Promise resolving to an array of TransactionInstruction objects
66
- */
67
- initializeTokenAccounts(owner: PublicKey, mints: PublicKey[], signer: PublicKey): Promise<TransactionInstruction[]>;
68
- /**
69
- * Updates the supply cap for this stablecoin strategy.
70
- *
71
- * @param signer - Public key of the admin signer
72
- * @param newCap - New maximum supply cap as BN or number
73
- * @returns Promise resolving to a TransactionInstruction
74
- */
75
- updateCap(signer: PublicKey, newCap: BN | number): Promise<TransactionInstruction>;
76
- /**
77
- * Updates the recipient addresses and their fee cuts for this stablecoin.
78
- *
79
- * @param signer - Public key of the admin signer
80
- * @param recipients - Map of recipient public keys to their fee (in basepoints)
81
- * @returns Promise resolving to a TransactionInstruction
82
- */
83
- updateRecipients(signer: PublicKey, recipients: Map<PublicKey, number>): Promise<TransactionInstruction>;
84
- /**
85
- * Initializes a Drift sub-account for this stablecoin controller.
86
- *
87
- * @param signer - Public key of the admin signer
88
- * @param subAccountId - Sub-account identifier (default: 0)
89
- * @returns Promise resolving to a TransactionInstruction
90
- */
91
- initializeStablecoinDriftAccount(signer: PublicKey, subAccountId?: number): Promise<TransactionInstruction>;
92
- /**
93
- * Initializes the Drift user stats account for this stablecoin controller.
94
- *
95
- * @param signer - Public key of the admin signer
96
- * @returns Promise resolving to a TransactionInstruction
97
- */
98
- initializeStablecoinDriftStatsAccount(signer: PublicKey): Promise<TransactionInstruction>;
99
- /**
100
- * Freezes or unfreezes a specific action for this stablecoin strategy.
101
- *
102
- * @param signer - Public key of the admin signer
103
- * @param freeze - Whether to freeze (true) or unfreeze (false) the action
104
- * @param action - The action to freeze/unfreeze
105
- * @returns Promise resolving to a TransactionInstruction
106
- */
107
- freeze(signer: PublicKey, freeze: boolean, action: Action): Promise<TransactionInstruction>;
108
- /**
109
- * Initializes the stablecoin mint with optional metadata.
110
- *
111
- * @param signer - Public key of the admin signer
112
- * @param tokenKeypair - Keypair for the new mint account
113
- * @param metadata - Optional metadata for the stablecoin
114
- * @returns Promise resolving to an array of TransactionInstruction objects
115
- */
116
- initializeStablecoin(signer: PublicKey, tokenKeypair: Keypair, metadata?: StablecoinMetadata): Promise<TransactionInstruction[]>;
117
- /**
118
- * Updates the rebalance slippage tolerance for this stablecoin strategy.
119
- *
120
- * @param signer - Public key of the admin signer
121
- * @param slippage - New slippage tolerance value
122
- * @returns Promise resolving to a TransactionInstruction
123
- */
124
- updateRebalanceSlippage(signer: PublicKey, slippage: number): Promise<TransactionInstruction>;
125
- /**
126
- * Fetches the current price of a collateral asset from Pyth oracle.
127
- *
128
- * @param mint - Public key of the collateral mint
129
- * @returns Promise resolving to the collateral price data
130
- */
131
- getCollateralPrice(mint: PublicKey): Promise<import("axios").AxiosResponse<any, any>>;
132
- /**
133
- * Abstract method to construct required accounts for transactions.
134
- * Must be implemented by concrete stablecoin classes.
135
- *
136
- * @param signer - Public key of the transaction signer
137
- * @param args - Additional arguments specific to the stablecoin implementation
138
- * @returns Promise resolving to the constructed accounts object of type T
139
- */
140
- abstract constructAccounts<T>(signer: PublicKey, ...args: any[]): Promise<T>;
141
- /**
142
- * Abstract method to construct remaining accounts for transactions.
143
- * Must be implemented by concrete stablecoin classes.
144
- *
145
- * @returns Promise resolving to an array of AccountMeta objects
146
- */
147
- abstract constructRemainingAccounts(): Promise<AccountMeta[]>;
148
- /**
149
- * Abstract method to initialize the stablecoin strategy.
150
- * Must be implemented by concrete stablecoin classes.
151
- *
152
- * @param signer - Public key of the admin signer
153
- * @param args - Additional arguments specific to the stablecoin implementation
154
- * @returns Promise resolving to an array of TransactionInstruction objects
155
- */
156
- abstract initialize(signer: PublicKey, ...args: any[]): Promise<TransactionInstruction[]>;
157
- /**
158
- * Abstract method to create mint instructions for the stablecoin.
159
- * Must be implemented by concrete stablecoin classes.
160
- *
161
- * @param signer - Public key of the user minting stablecoins
162
- * @param amount - Amount of stablecoins to mint
163
- * @param minimumReceived - Minimum amount of stablecoins to receive (slippage protection)
164
- * @param args - Additional arguments specific to the stablecoin implementation
165
- * @returns Promise resolving to an array of TransactionInstruction objects
166
- */
167
- abstract mint(signer: PublicKey, amount: BN | number, minimumReceived: BN | number, ...args: any[]): Promise<TransactionInstruction[]>;
168
- /**
169
- * Abstract method to create redeem instructions for the stablecoin.
170
- * Must be implemented by concrete stablecoin classes.
171
- *
172
- * @param signer - Public key of the user redeeming stablecoins
173
- * @param amount - Amount of stablecoins to redeem
174
- * @param minimumReceived - Minimum amount of collateral to receive (slippage protection)
175
- * @param args - Additional arguments specific to the stablecoin implementation
176
- * @returns Promise resolving to an array of TransactionInstruction objects
177
- */
178
- abstract redeem(signer: PublicKey, amount: BN | number, minimumReceived: BN | number, ...args: any[]): Promise<TransactionInstruction[]>;
179
- /**
180
- * Abstract method to create rebalance instructions for the stablecoin.
181
- * Must be implemented by concrete stablecoin classes.
182
- *
183
- * @param signer - Public key of the admin signer
184
- * @returns Promise resolving to an array of TransactionInstruction objects
185
- */
186
- abstract rebalance(signer: PublicKey): Promise<TransactionInstruction[]>;
187
- }
@@ -1,4 +0,0 @@
1
- export * from "./ReflectKeeper";
2
- export * from "./PdaClient";
3
- export * from "./Stablecoin";
4
- export * from "./Reflect";
@@ -1,6 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- declare const DRIFT_VAULT: PublicKey;
3
- declare const DRIFT_PROGRAM_ID: PublicKey;
4
- declare const REFERRAL_USER: PublicKey;
5
- declare const REFERRAL_USER_STATS: PublicKey;
6
- export { DRIFT_VAULT, REFERRAL_USER, REFERRAL_USER_STATS, DRIFT_PROGRAM_ID };
@@ -1,7 +0,0 @@
1
- export * from "./usdc";
2
- export * from "./drift";
3
- export * from "./wsol";
4
- export * from "./jupiter";
5
- export * from "./pyth";
6
- export * from "./lst";
7
- export * from "./lookupTables";
@@ -1,4 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- declare const JUPITER_PROGRAM_ID: PublicKey;
3
- declare const JLP_MINT: PublicKey;
4
- export { JUPITER_PROGRAM_ID, JLP_MINT };
@@ -1,4 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- export declare const USDC_PLUS_LOOKUP_TABLE: PublicKey;
3
- export declare const JLP_LOOKUP_TABLE: PublicKey;
4
- export declare const LST_LOOKUP_TABLE: PublicKey;
@@ -1,3 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- declare const JITO_SOL_MINT: PublicKey;
3
- export { JITO_SOL_MINT };
@@ -1 +0,0 @@
1
- export declare const PYTH_API_URL = "https://hermes.pyth.network/api/latest_price_feeds?ids[]=";
@@ -1,6 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- export declare const USDC_MINT: PublicKey;
3
- export declare const USDC_PUSH_ORACLE: PublicKey;
4
- export declare const USDC_PULL_ORACLE: PublicKey;
5
- export declare const USDC_SPOT_MARKET: PublicKey;
6
- export declare const USDC_DRIFT_VAULT: PublicKey;
@@ -1,6 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- export declare const WSOL_PUSH_ORACLE: PublicKey;
3
- export declare const WSOL_PULL_ORACLE: PublicKey;
4
- export declare const WSOL_SPOT_MARKET: PublicKey;
5
- export declare const WSOL_PERP_MARKET: PublicKey;
6
- export declare const WSOL_MINT: PublicKey;
@@ -1,4 +0,0 @@
1
- declare class ReflectError extends Error {
2
- constructor(msg: string);
3
- }
4
- export default ReflectError;
@@ -1,116 +0,0 @@
1
- /**
2
- * This code was GENERATED using the solita package.
3
- * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
4
- *
5
- * See: https://github.com/metaplex-foundation/solita
6
- */
7
- /// <reference types="node" />
8
- /// <reference types="node" />
9
- import * as web3 from '@solana/web3.js';
10
- import * as beet from '@metaplex-foundation/beet';
11
- import * as beetSolana from '@metaplex-foundation/beet-solana';
12
- import { Strategy } from '../types/Strategy';
13
- import { DriftControllerBase } from '../types/DriftControllerBase';
14
- import { PerpHedge } from '../types/PerpHedge';
15
- import { JlpRebalanceSettings } from '../types/JlpRebalanceSettings';
16
- /**
17
- * Arguments used to create {@link DriftJlpController}
18
- * @category Accounts
19
- * @category generated
20
- */
21
- export type DriftJlpControllerArgs = {
22
- baseStrategy: Strategy;
23
- baseDrift: DriftControllerBase;
24
- jlpMarketIndex: number;
25
- driftPerpMarketsHedge: PerpHedge[];
26
- jlpMint: web3.PublicKey;
27
- rebalanceSettings: JlpRebalanceSettings;
28
- };
29
- export declare const driftJlpControllerDiscriminator: number[];
30
- /**
31
- * Holds the data for the {@link DriftJlpController} Account and provides de/serialization
32
- * functionality for that data
33
- *
34
- * @category Accounts
35
- * @category generated
36
- */
37
- export declare class DriftJlpController implements DriftJlpControllerArgs {
38
- readonly baseStrategy: Strategy;
39
- readonly baseDrift: DriftControllerBase;
40
- readonly jlpMarketIndex: number;
41
- readonly driftPerpMarketsHedge: PerpHedge[];
42
- readonly jlpMint: web3.PublicKey;
43
- readonly rebalanceSettings: JlpRebalanceSettings;
44
- private constructor();
45
- /**
46
- * Creates a {@link DriftJlpController} instance from the provided args.
47
- */
48
- static fromArgs(args: DriftJlpControllerArgs): DriftJlpController;
49
- /**
50
- * Deserializes the {@link DriftJlpController} from the data of the provided {@link web3.AccountInfo}.
51
- * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
52
- */
53
- static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [DriftJlpController, number];
54
- /**
55
- * Retrieves the account info from the provided address and deserializes
56
- * the {@link DriftJlpController} from its data.
57
- *
58
- * @throws Error if no account info is found at the address or if deserialization fails
59
- */
60
- static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<DriftJlpController>;
61
- /**
62
- * Provides a {@link web3.Connection.getProgramAccounts} config builder,
63
- * to fetch accounts matching filters that can be specified via that builder.
64
- *
65
- * @param programId - the program that owns the accounts we are filtering
66
- */
67
- static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<DriftJlpControllerArgs & {
68
- accountDiscriminator: number[];
69
- }>;
70
- /**
71
- * Deserializes the {@link DriftJlpController} from the provided data Buffer.
72
- * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
73
- */
74
- static deserialize(buf: Buffer, offset?: number): [DriftJlpController, number];
75
- /**
76
- * Serializes the {@link DriftJlpController} into a Buffer.
77
- * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
78
- */
79
- serialize(): [Buffer, number];
80
- /**
81
- * Returns the byteSize of a {@link Buffer} holding the serialized data of
82
- * {@link DriftJlpController} for the provided args.
83
- *
84
- * @param args need to be provided since the byte size for this account
85
- * depends on them
86
- */
87
- static byteSize(args: DriftJlpControllerArgs): number;
88
- /**
89
- * Fetches the minimum balance needed to exempt an account holding
90
- * {@link DriftJlpController} data from rent
91
- *
92
- * @param args need to be provided since the byte size for this account
93
- * depends on them
94
- * @param connection used to retrieve the rent exemption information
95
- */
96
- static getMinimumBalanceForRentExemption(args: DriftJlpControllerArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
97
- /**
98
- * Returns a readable version of {@link DriftJlpController} properties
99
- * and can be used to convert to JSON and/or logging
100
- */
101
- pretty(): {
102
- baseStrategy: Strategy;
103
- baseDrift: DriftControllerBase;
104
- jlpMarketIndex: number;
105
- driftPerpMarketsHedge: PerpHedge[];
106
- jlpMint: string;
107
- rebalanceSettings: JlpRebalanceSettings;
108
- };
109
- }
110
- /**
111
- * @category Accounts
112
- * @category generated
113
- */
114
- export declare const driftJlpControllerBeet: beet.FixableBeetStruct<DriftJlpController, DriftJlpControllerArgs & {
115
- accountDiscriminator: number[];
116
- }>;
@@ -1,110 +0,0 @@
1
- /**
2
- * This code was GENERATED using the solita package.
3
- * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
4
- *
5
- * See: https://github.com/metaplex-foundation/solita
6
- */
7
- /// <reference types="node" />
8
- /// <reference types="node" />
9
- import * as beet from '@metaplex-foundation/beet';
10
- import * as web3 from '@solana/web3.js';
11
- import * as beetSolana from '@metaplex-foundation/beet-solana';
12
- import { Strategy } from '../types/Strategy';
13
- import { DriftControllerBase } from '../types/DriftControllerBase';
14
- import { DriftLstData } from '../types/DriftLstData';
15
- import { SubAccount } from '../types/SubAccount';
16
- /**
17
- * Arguments used to create {@link DriftLstController}
18
- * @category Accounts
19
- * @category generated
20
- */
21
- export type DriftLstControllerArgs = {
22
- baseStrategy: Strategy;
23
- baseDrift: DriftControllerBase;
24
- lsts: DriftLstData[];
25
- subAccounts: SubAccount[];
26
- };
27
- export declare const driftLstControllerDiscriminator: number[];
28
- /**
29
- * Holds the data for the {@link DriftLstController} Account and provides de/serialization
30
- * functionality for that data
31
- *
32
- * @category Accounts
33
- * @category generated
34
- */
35
- export declare class DriftLstController implements DriftLstControllerArgs {
36
- readonly baseStrategy: Strategy;
37
- readonly baseDrift: DriftControllerBase;
38
- readonly lsts: DriftLstData[];
39
- readonly subAccounts: SubAccount[];
40
- private constructor();
41
- /**
42
- * Creates a {@link DriftLstController} instance from the provided args.
43
- */
44
- static fromArgs(args: DriftLstControllerArgs): DriftLstController;
45
- /**
46
- * Deserializes the {@link DriftLstController} from the data of the provided {@link web3.AccountInfo}.
47
- * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
48
- */
49
- static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [DriftLstController, number];
50
- /**
51
- * Retrieves the account info from the provided address and deserializes
52
- * the {@link DriftLstController} from its data.
53
- *
54
- * @throws Error if no account info is found at the address or if deserialization fails
55
- */
56
- static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<DriftLstController>;
57
- /**
58
- * Provides a {@link web3.Connection.getProgramAccounts} config builder,
59
- * to fetch accounts matching filters that can be specified via that builder.
60
- *
61
- * @param programId - the program that owns the accounts we are filtering
62
- */
63
- static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<DriftLstControllerArgs & {
64
- accountDiscriminator: number[];
65
- }>;
66
- /**
67
- * Deserializes the {@link DriftLstController} from the provided data Buffer.
68
- * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
69
- */
70
- static deserialize(buf: Buffer, offset?: number): [DriftLstController, number];
71
- /**
72
- * Serializes the {@link DriftLstController} into a Buffer.
73
- * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
74
- */
75
- serialize(): [Buffer, number];
76
- /**
77
- * Returns the byteSize of a {@link Buffer} holding the serialized data of
78
- * {@link DriftLstController} for the provided args.
79
- *
80
- * @param args need to be provided since the byte size for this account
81
- * depends on them
82
- */
83
- static byteSize(args: DriftLstControllerArgs): number;
84
- /**
85
- * Fetches the minimum balance needed to exempt an account holding
86
- * {@link DriftLstController} data from rent
87
- *
88
- * @param args need to be provided since the byte size for this account
89
- * depends on them
90
- * @param connection used to retrieve the rent exemption information
91
- */
92
- static getMinimumBalanceForRentExemption(args: DriftLstControllerArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
93
- /**
94
- * Returns a readable version of {@link DriftLstController} properties
95
- * and can be used to convert to JSON and/or logging
96
- */
97
- pretty(): {
98
- baseStrategy: Strategy;
99
- baseDrift: DriftControllerBase;
100
- lsts: DriftLstData[];
101
- subAccounts: SubAccount[];
102
- };
103
- }
104
- /**
105
- * @category Accounts
106
- * @category generated
107
- */
108
- export declare const driftLstControllerBeet: beet.FixableBeetStruct<DriftLstController, DriftLstControllerArgs & {
109
- accountDiscriminator: number[];
110
- }>;