@symmetry-hq/sdk 1.0.13 → 1.0.14
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.
- package/dist/constants.d.ts +23 -0
- package/dist/constants.js +38 -0
- package/dist/index.d.ts +816 -0
- package/dist/index.js +2208 -0
- package/dist/instructions/automation/auction.d.ts +6 -0
- package/dist/instructions/automation/auction.js +40 -0
- package/dist/instructions/automation/claimBounty.d.ts +12 -0
- package/dist/instructions/automation/claimBounty.js +44 -0
- package/dist/instructions/automation/flashSwap.d.ts +21 -0
- package/dist/instructions/automation/flashSwap.js +74 -0
- package/dist/instructions/automation/priceUpdate.d.ts +19 -0
- package/dist/instructions/automation/priceUpdate.js +89 -0
- package/dist/instructions/automation/rebalanceIntent.d.ts +32 -0
- package/dist/instructions/automation/rebalanceIntent.js +117 -0
- package/dist/instructions/management/addBounty.d.ts +7 -0
- package/dist/instructions/management/addBounty.js +41 -0
- package/dist/instructions/management/admin.d.ts +9 -0
- package/dist/instructions/management/admin.js +53 -0
- package/dist/instructions/management/claimFees.d.ts +15 -0
- package/dist/instructions/management/claimFees.js +95 -0
- package/dist/instructions/management/createBasket.d.ts +21 -0
- package/dist/instructions/management/createBasket.js +98 -0
- package/dist/instructions/management/edit.d.ts +51 -0
- package/dist/instructions/management/edit.js +477 -0
- package/dist/instructions/management/luts.d.ts +30 -0
- package/dist/instructions/management/luts.js +99 -0
- package/dist/instructions/pda.d.ts +25 -0
- package/dist/instructions/pda.js +128 -0
- package/dist/instructions/user/deposit.d.ts +20 -0
- package/dist/instructions/user/deposit.js +100 -0
- package/dist/instructions/user/withdraw.d.ts +8 -0
- package/dist/instructions/user/withdraw.js +36 -0
- package/dist/jup.d.ts +50 -0
- package/dist/jup.js +86 -0
- package/dist/{src/keeperRebalaneHandler.d.ts → keeperMonitor.d.ts} +23 -3
- package/dist/keeperMonitor.js +624 -0
- package/dist/layouts/basket.d.ts +191 -0
- package/dist/layouts/basket.js +51 -0
- package/dist/layouts/config.d.ts +282 -0
- package/dist/layouts/config.js +238 -0
- package/dist/layouts/fraction.d.ts +20 -0
- package/dist/layouts/fraction.js +164 -0
- package/dist/layouts/intents/bounty.d.ts +18 -0
- package/dist/layouts/intents/bounty.js +19 -0
- package/dist/layouts/intents/intent.d.ts +210 -0
- package/dist/layouts/intents/intent.js +97 -0
- package/dist/layouts/intents/rebalanceIntent.d.ts +212 -0
- package/dist/layouts/intents/rebalanceIntent.js +94 -0
- package/dist/layouts/lookupTable.d.ts +7 -0
- package/dist/layouts/lookupTable.js +10 -0
- package/dist/layouts/oracle.d.ts +66 -0
- package/dist/layouts/oracle.js +102 -0
- package/dist/runtime/crypto.d.ts +1 -0
- package/dist/runtime/crypto.js +14 -0
- package/dist/src/instructions/automation/rebalanceSwap.d.ts +11 -0
- package/dist/src/instructions/automation/rebalanceSwap.js +42 -0
- package/dist/src/instructions/pda.js +2 -2
- package/dist/src/runtime/crypto.d.ts +1 -0
- package/dist/src/runtime/crypto.js +14 -0
- package/dist/src/states/basket.js +7 -3
- package/dist/src/states/oracles/pythOracle.d.ts +10 -2
- package/dist/src/states/oracles/pythOracle.js +43 -2
- package/dist/src/txUtils.js +22 -12
- package/dist/states/basket.d.ts +17 -0
- package/dist/states/basket.js +515 -0
- package/dist/states/config.d.ts +3 -0
- package/dist/states/config.js +71 -0
- package/dist/states/intents/intent.d.ts +10 -0
- package/dist/states/intents/intent.js +317 -0
- package/dist/states/intents/rebalanceIntent.d.ts +43 -0
- package/dist/states/intents/rebalanceIntent.js +764 -0
- package/dist/states/oracles/constants.d.ts +9 -0
- package/dist/states/oracles/constants.js +15 -0
- package/dist/states/oracles/oracle.d.ts +24 -0
- package/dist/states/oracles/oracle.js +173 -0
- package/dist/states/oracles/pythOracle.d.ts +156 -0
- package/dist/states/oracles/pythOracle.js +779 -0
- package/dist/states/oracles/raydiumClmmOracle.d.ts +184 -0
- package/dist/states/oracles/raydiumClmmOracle.js +831 -0
- package/dist/states/oracles/raydiumCpmmOracle.d.ts +120 -0
- package/dist/states/oracles/raydiumCpmmOracle.js +537 -0
- package/dist/states/oracles/switchboardOracle.d.ts +0 -0
- package/dist/states/oracles/switchboardOracle.js +1 -0
- package/dist/states/withdrawBasketFees.d.ts +10 -0
- package/dist/states/withdrawBasketFees.js +154 -0
- package/dist/txUtils.d.ts +72 -0
- package/dist/txUtils.js +433 -0
- package/package.json +2 -1
- package/src/instructions/pda.ts +2 -3
- package/src/runtime/crypto.ts +18 -0
- package/src/states/basket.ts +7 -3
- package/src/states/oracles/pythOracle.ts +22 -5
- package/src/txUtils.ts +23 -15
- package/tsconfig.json +9 -1
- package/dist/src/keeperRebalaneHandler.js +0 -278
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
import { Connection, PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
|
|
2
|
+
import { getJupTokenLedgerAndSwapInstructions } from './jup';
|
|
3
|
+
import { Vault, FormattedAccumulatedFees, FormattedAddTokenSettings, FormattedAsset, FormattedAutomationSettings, FormattedVault, FormattedCreatorSettings, FormattedCustomRebalanceSettings, FormattedDepositsSettings, FormattedFeeSettings, FormattedForceRebalanceSettings, FormattedLookupTables, FormattedLpSettings, FormattedMakeDirectSwapSettings, FormattedManagersSettings, FormattedMetadataSettings, FormattedOracle, FormattedOracleAggregator, FormattedOracleSettings, FormattedScheduleSettings, FormattedUpdateWeightsSettings, WithdrawVaultFees } from './layouts/basket';
|
|
4
|
+
import { FormattedGlobalConfig, GlobalConfig } from './layouts/config';
|
|
5
|
+
import { AddOrEditTokenInput, EditAddTokenSettings, EditAutomationSettings, EditCreatorSettings, EditCustomRebalanceSettings, EditDepositsSettings, EditFeeSettings, EditForceRebalanceSettings, EditLpSettings, EditMakeDirectSwapSettings, EditManagerSettings, EditMetadataSettings, EditScheduleSettings, EditUpdateWeightsSettings, FormattedBounty, FormattedBountySchedule, FormattedIntent, FormattedIntentStatus, FormattedTaskType, Intent, MakeDirectSwapInput, OracleInput, Settings, TaskContext, TaskType, UpdateWeightsInput } from './layouts/intents/intent';
|
|
6
|
+
import { AuctionData, ClaimBountyData, DepositData, FormattedOraclePrice, FormattedRebalanceAction, FormattedRebalanceIntent, FormattedRebalanceType, FormattedTaskCompletion, FormattedTokenAuction, MintData, PriceUpdatesData, RebalanceIntent, RedeemData, UIRebalanceIntent } from './layouts/intents/rebalanceIntent';
|
|
7
|
+
import { FormattedOracleType } from './layouts/oracle';
|
|
8
|
+
import { VaultFilter } from './states/basket';
|
|
9
|
+
import { IntentFilter } from './states/intents/intent';
|
|
10
|
+
import { getSwapPairs, isRebalanceRequired, RebalanceIntentFilter } from './states/intents/rebalanceIntent';
|
|
11
|
+
import { WithdrawVaultFeesFilter } from './states/withdrawBasketFees';
|
|
12
|
+
import { VaultCreationTx, TxPayloadBatchSequence, VersionedTxs, Wallet } from './txUtils';
|
|
13
|
+
export declare class SymmetryCore {
|
|
14
|
+
private sdkParams;
|
|
15
|
+
/**
|
|
16
|
+
* Initializes the SymmetryCore SDK.
|
|
17
|
+
* @param params {connection: Connection, network: "devnet" | "mainnet", priorityFee?: number} - The parameters for the SDK.
|
|
18
|
+
* @param params.connection - The connection to the Solana network.
|
|
19
|
+
* @param params.network - The network to use (devnet or mainnet).
|
|
20
|
+
* @param params.priorityFee - Optional. Compute unit price in micro-lamports. Defaults to PRIORITY_FEE (25_000).
|
|
21
|
+
*/
|
|
22
|
+
constructor(params: {
|
|
23
|
+
connection: Connection;
|
|
24
|
+
network: "devnet" | "mainnet";
|
|
25
|
+
priorityFee?: number;
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Sets the priority fee for the SDK.
|
|
29
|
+
* @param {number} priorityFee - The priority fee in micro-lamports.
|
|
30
|
+
*/
|
|
31
|
+
setPriorityFee(priorityFee: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Fetches the global config account.
|
|
34
|
+
* @returns {Promise<GlobalConfig>} The global config.
|
|
35
|
+
*/
|
|
36
|
+
fetchGlobalConfig(): Promise<GlobalConfig>;
|
|
37
|
+
/**
|
|
38
|
+
* Fetches a vault by its public key.
|
|
39
|
+
* @param {string} vaultPubkey - The public key of the vault.
|
|
40
|
+
* @returns {Promise<Vault>} The vault.
|
|
41
|
+
*/
|
|
42
|
+
fetchVault(vaultPubkey: string): Promise<Vault>;
|
|
43
|
+
/**
|
|
44
|
+
* Fetches multiple vaults by their public keys.
|
|
45
|
+
* @param {string[]} vaultPubkeys - The public keys of the vaults.
|
|
46
|
+
* @returns {Promise<Map<string, Vault>>} A map of vault public keys to vaults.
|
|
47
|
+
*/
|
|
48
|
+
fetchMultipleVaults(vaultPubkeys: string[]): Promise<Map<string, Vault>>;
|
|
49
|
+
/**
|
|
50
|
+
* Fetches all vaults.
|
|
51
|
+
* @param {VaultFilter} vaultFilter - Optional. The filter to apply to the vaults.
|
|
52
|
+
* @param {"creator" | "host" | "manager"} vaultFilter.type - The type of the vault filter ("creator", "host", "manager").
|
|
53
|
+
* @param {string} vaultFilter.pubkey - The public key of the vault filter.
|
|
54
|
+
* @returns {Promise<Vault[]>} The vaults.
|
|
55
|
+
*/
|
|
56
|
+
fetchAllVaults(vaultFilter?: VaultFilter): Promise<Vault[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Fetches all vaults created by a given public key.
|
|
59
|
+
* @param {string} creatorPubkey - The public key of the creator.
|
|
60
|
+
* @returns {Promise<Vault[]>} The vaults.
|
|
61
|
+
*/
|
|
62
|
+
fetchCreatedVaults(creatorPubkey: string): Promise<Vault[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Fetches all vaults hosted by a given public key.
|
|
65
|
+
* @param {string} hostPubkey - The public key of the host.
|
|
66
|
+
* @returns {Promise<Vault[]>} The vaults.
|
|
67
|
+
*/
|
|
68
|
+
fetchHostedVaults(hostPubkey: string): Promise<Vault[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Fetches all vaults managed by a given public key.
|
|
71
|
+
* @param {string} managerPubkey - The public key of the manager.
|
|
72
|
+
* @returns {Promise<Vault[]>} The vaults.
|
|
73
|
+
*/
|
|
74
|
+
fetchManagedVaults(managerPubkey: string): Promise<Vault[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Derives vaults by their mints.
|
|
77
|
+
* @param {string[]} mints - The mint public keys of the vaults.
|
|
78
|
+
* @returns {Promise<Map<string, string>>} A map of vault mint public keys to vault public keys.
|
|
79
|
+
*/
|
|
80
|
+
deriveVaultsByMints(mints: string[]): Promise<Map<string, string>>;
|
|
81
|
+
/**
|
|
82
|
+
* Fetches vaults by their mint public keys.
|
|
83
|
+
* @param {string[]} mints - The mint public keys of the vaults.
|
|
84
|
+
* @returns {Promise<Map<string, Vault>>} A map of vault mint public keys to vaults.
|
|
85
|
+
*/
|
|
86
|
+
fetchVaultsFromMints(mints: string[]): Promise<Map<string, Vault>>;
|
|
87
|
+
/**
|
|
88
|
+
* Loads the price of a vault.
|
|
89
|
+
* @param {Vault} vault - The vault.
|
|
90
|
+
* @returns {Promise<Vault>} The vault with the price.
|
|
91
|
+
*/
|
|
92
|
+
loadVaultPrice(vault: Vault): Promise<Vault>;
|
|
93
|
+
/**
|
|
94
|
+
* Fetches an intent by its public key.
|
|
95
|
+
* @param {string} intentPubkey - The public key of the intent.
|
|
96
|
+
* @returns {Promise<Intent>} The intent.
|
|
97
|
+
*/
|
|
98
|
+
fetchIntent(intentPubkey: string): Promise<Intent>;
|
|
99
|
+
/**
|
|
100
|
+
* Fetches multiple intents by their public keys.
|
|
101
|
+
* @param {string[]} intentPubkeys - The public keys of the intents.
|
|
102
|
+
* @returns {Promise<Map<string, Intent>>} A map of intent public keys to intents.
|
|
103
|
+
*/
|
|
104
|
+
fetchMultipleIntents(intentPubkeys: string[]): Promise<Map<string, Intent>>;
|
|
105
|
+
/**
|
|
106
|
+
* Fetches all intents.
|
|
107
|
+
* @param {IntentFilter} filter - Optional. The filter to apply to the intents.
|
|
108
|
+
* @param {"creator" | "host" | "manager" | "vault" | "owner"} filter.type - The type of the intent filter ("creator", "host", "manager", "vault", "owner").
|
|
109
|
+
* @param {string} filter.pubkey - The public key of the intent filter.
|
|
110
|
+
* @returns {Promise<Intent[]>} The intents.
|
|
111
|
+
*/
|
|
112
|
+
fetchAllIntents(filter?: IntentFilter): Promise<Intent[]>;
|
|
113
|
+
/**
|
|
114
|
+
* Fetches all intents created by a given public key.
|
|
115
|
+
* @param {string} creatorPubkey - The public key of the creator.
|
|
116
|
+
* @returns {Promise<Intent[]>} The intents.
|
|
117
|
+
*/
|
|
118
|
+
fetchCreatedIntents(creatorPubkey: string): Promise<Intent[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Fetches all intents for a given vault.
|
|
121
|
+
* @param {string} vaultPubkey - The public key of the vault.
|
|
122
|
+
* @returns {Promise<Intent[]>} The intents.
|
|
123
|
+
*/
|
|
124
|
+
fetchVaultIntents(vaultPubkey: string): Promise<Intent[]>;
|
|
125
|
+
/**
|
|
126
|
+
* Fetches a rebalance intent by its public key.
|
|
127
|
+
* @param {string} rebalanceIntentPubkey - The public key of the rebalance intent.
|
|
128
|
+
* @returns {Promise<UIRebalanceIntent>} The rebalance intent.
|
|
129
|
+
*/
|
|
130
|
+
fetchRebalanceIntent(rebalanceIntentPubkey: string): Promise<UIRebalanceIntent>;
|
|
131
|
+
/**
|
|
132
|
+
* Fetches multiple rebalance intents by their public keys.
|
|
133
|
+
* @param {string[]} rebalanceIntentPubkeys - The public keys of the rebalance intents.
|
|
134
|
+
* @returns {Promise<Map<string, UIRebalanceIntent>>} A map of rebalance intent public keys to rebalance intents.
|
|
135
|
+
*/
|
|
136
|
+
fetchMultipleRebalanceIntents(rebalanceIntentPubkeys: string[]): Promise<Map<string, UIRebalanceIntent>>;
|
|
137
|
+
/**
|
|
138
|
+
* Fetches all rebalance intents.
|
|
139
|
+
* @param {RebalanceIntentFilter} filter - Optional. The filter to apply to the rebalance intents.
|
|
140
|
+
* @param {"owner" | "vault"} filter.type - The type of the rebalance intent filter ("owner", "vault").
|
|
141
|
+
* @param {string} filter.pubkey - The public key of the rebalance intent filter.
|
|
142
|
+
* @returns {Promise<UIRebalanceIntent[]>} The rebalance intents.
|
|
143
|
+
*/
|
|
144
|
+
fetchAllRebalanceIntents(filter?: RebalanceIntentFilter): Promise<UIRebalanceIntent[]>;
|
|
145
|
+
/**
|
|
146
|
+
* Fetches all rebalance intents for a given owner.
|
|
147
|
+
* @param {string} ownerPubkey - The public key of the owner.
|
|
148
|
+
* @returns {Promise<UIRebalanceIntent[]>} The rebalance intents.
|
|
149
|
+
*/
|
|
150
|
+
fetchOwnerRebalanceIntents(ownerPubkey: string): Promise<UIRebalanceIntent[]>;
|
|
151
|
+
/**
|
|
152
|
+
* Fetches all rebalance intents for a given vault.
|
|
153
|
+
* @param {string} vaultPubkey - The public key of the vault.
|
|
154
|
+
* @returns {Promise<UIRebalanceIntent[]>} The rebalance intents.
|
|
155
|
+
*/
|
|
156
|
+
fetchVaultRebalanceIntents(vaultPubkey: string): Promise<UIRebalanceIntent[]>;
|
|
157
|
+
/**
|
|
158
|
+
* Fetches a WithdrawVaultFees account by its public key.
|
|
159
|
+
* @param {string} withdrawVaultFeesPubkey - The public key of the WithdrawVaultFees account.
|
|
160
|
+
* @returns {Promise<WithdrawVaultFees>} The WithdrawVaultFees account.
|
|
161
|
+
*/
|
|
162
|
+
fetchWithdrawVaultFees(withdrawVaultFeesPubkey: string): Promise<WithdrawVaultFees>;
|
|
163
|
+
/**
|
|
164
|
+
* Fetches multiple WithdrawVaultFees accounts by their public keys.
|
|
165
|
+
* @param {string[]} withdrawVaultFeesPubkeys - The public keys of the WithdrawVaultFees accounts.
|
|
166
|
+
* @returns {Promise<Map<string, WithdrawVaultFees>>} A map of WithdrawVaultFees public keys to WithdrawVaultFees accounts.
|
|
167
|
+
*/
|
|
168
|
+
fetchMultipleWithdrawVaultFees(withdrawVaultFeesPubkeys: string[]): Promise<Map<string, WithdrawVaultFees>>;
|
|
169
|
+
/**
|
|
170
|
+
* Fetches all WithdrawVaultFees accounts with optional filter.
|
|
171
|
+
* @param {WithdrawVaultFeesFilter} filter - Optional. The filter to apply to the WithdrawVaultFees accounts.
|
|
172
|
+
* @param {"vault" | "manager" | "creator" | "host" | "symmetry"} filter.type - The type of the filter.
|
|
173
|
+
* @param {string} filter.pubkey - The public key to filter by.
|
|
174
|
+
* @returns {Promise<WithdrawVaultFees[]>} The WithdrawVaultFees accounts.
|
|
175
|
+
*/
|
|
176
|
+
fetchAllWithdrawVaultFees(filter?: WithdrawVaultFeesFilter): Promise<WithdrawVaultFees[]>;
|
|
177
|
+
/**
|
|
178
|
+
* Fetches all WithdrawVaultFees accounts for a given vault.
|
|
179
|
+
* @param {string} vaultPubkey - The public key of the vault.
|
|
180
|
+
* @returns {Promise<WithdrawVaultFees[]>} The WithdrawVaultFees accounts.
|
|
181
|
+
*/
|
|
182
|
+
fetchVaultWithdrawVaultFees(vaultPubkey: string): Promise<WithdrawVaultFees[]>;
|
|
183
|
+
/**
|
|
184
|
+
* Fetches all WithdrawVaultFees accounts for a given manager.
|
|
185
|
+
* @param {string} managerPubkey - The public key of the manager.
|
|
186
|
+
* @returns {Promise<WithdrawVaultFees[]>} The WithdrawVaultFees accounts.
|
|
187
|
+
*/
|
|
188
|
+
fetchManagerWithdrawVaultFees(managerPubkey: string): Promise<WithdrawVaultFees[]>;
|
|
189
|
+
/**
|
|
190
|
+
* Fetches all WithdrawVaultFees accounts for a given creator.
|
|
191
|
+
* @param {string} creatorPubkey - The public key of the creator.
|
|
192
|
+
* @returns {Promise<WithdrawVaultFees[]>} The WithdrawVaultFees accounts.
|
|
193
|
+
*/
|
|
194
|
+
fetchCreatorWithdrawVaultFees(creatorPubkey: string): Promise<WithdrawVaultFees[]>;
|
|
195
|
+
/**
|
|
196
|
+
* Fetches all WithdrawVaultFees accounts for a given host.
|
|
197
|
+
* @param {string} hostPubkey - The public key of the host.
|
|
198
|
+
* @returns {Promise<WithdrawVaultFees[]>} The WithdrawVaultFees accounts.
|
|
199
|
+
*/
|
|
200
|
+
fetchHostWithdrawVaultFees(hostPubkey: string): Promise<WithdrawVaultFees[]>;
|
|
201
|
+
/**
|
|
202
|
+
* Fetches all WithdrawVaultFees accounts for a given symmetry fee collector.
|
|
203
|
+
* @param {string} symmetryPubkey - The public key of the symmetry fee collector.
|
|
204
|
+
* @returns {Promise<WithdrawVaultFees[]>} The WithdrawVaultFees accounts.
|
|
205
|
+
*/
|
|
206
|
+
fetchSymmetryWithdrawVaultFees(symmetryPubkey: string): Promise<WithdrawVaultFees[]>;
|
|
207
|
+
createGlobalConfigTx(params: {
|
|
208
|
+
signer: PublicKey;
|
|
209
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
210
|
+
editGlobalConfigTx(params: {
|
|
211
|
+
signer: PublicKey;
|
|
212
|
+
config: GlobalConfig;
|
|
213
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
214
|
+
/**
|
|
215
|
+
* Creates a vault.
|
|
216
|
+
* @param {Object} params - The parameters for the vault creation.
|
|
217
|
+
* @param {string} params.creator - The public key of the creator.
|
|
218
|
+
* @param {string} params.start_price - The start price of the vault.
|
|
219
|
+
* @param {string} params.name - The name of the vault.
|
|
220
|
+
* @param {string} params.symbol - The symbol of the vault.
|
|
221
|
+
* @param {string} params.metadata_uri - The metadata URI of the vault.
|
|
222
|
+
* @param {Object} params.host_platform_params - Optional. The host platform parameters.
|
|
223
|
+
* @param {string} params.host_platform_params.host_pubkey - The public key of the host.
|
|
224
|
+
* @param {number} params.host_platform_params.host_deposit_fee_bps - The host deposit fee in basis points.
|
|
225
|
+
* @param {number} params.host_platform_params.host_withdraw_fee_bps - The host withdrawal fee in basis points.
|
|
226
|
+
* @param {number} params.host_platform_params.host_management_fee_bps - The host management fee in basis points.
|
|
227
|
+
* @param {number} params.host_platform_params.host_performance_fee_bps - The host performance fee in basis points.
|
|
228
|
+
* @returns {Promise<VaultCreationTx>} The vault creation transaction.
|
|
229
|
+
*/
|
|
230
|
+
createVaultTx(params: {
|
|
231
|
+
creator: string;
|
|
232
|
+
start_price: string;
|
|
233
|
+
name: string;
|
|
234
|
+
symbol: string;
|
|
235
|
+
metadata_uri: string;
|
|
236
|
+
host_platform_params?: {
|
|
237
|
+
host_pubkey: string;
|
|
238
|
+
host_deposit_fee_bps: number;
|
|
239
|
+
host_withdraw_fee_bps: number;
|
|
240
|
+
host_management_fee_bps: number;
|
|
241
|
+
host_performance_fee_bps: number;
|
|
242
|
+
};
|
|
243
|
+
}): Promise<VaultCreationTx>;
|
|
244
|
+
/**
|
|
245
|
+
* Changes the creator of a vault.
|
|
246
|
+
* @param {TaskContext} context - The context of the task.
|
|
247
|
+
* @param {EditCreatorSettings} settings - The settings for the creator edit.
|
|
248
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
249
|
+
*/
|
|
250
|
+
editCreatorTx(context: TaskContext, settings: EditCreatorSettings): Promise<TxPayloadBatchSequence>;
|
|
251
|
+
/**
|
|
252
|
+
* Creates an edit manager settings intent for a vault.
|
|
253
|
+
* @param {TaskContext} context - The context of the task.
|
|
254
|
+
* @param {EditManagerSettings} settings - The settings for the manager edit.
|
|
255
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
256
|
+
*/
|
|
257
|
+
editManagersTx(context: TaskContext, settings: EditManagerSettings): Promise<TxPayloadBatchSequence>;
|
|
258
|
+
/**
|
|
259
|
+
* Creates an edit schedule settings intent for a vault.
|
|
260
|
+
* @param {TaskContext} context - The context of the task.
|
|
261
|
+
* @param {EditScheduleSettings} settings - The settings for the schedule edit.
|
|
262
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
263
|
+
*/
|
|
264
|
+
editScheduleTx(context: TaskContext, settings: EditScheduleSettings): Promise<TxPayloadBatchSequence>;
|
|
265
|
+
/**
|
|
266
|
+
* Creates an edit fees settings intent for a vault.
|
|
267
|
+
* @param {TaskContext} context - The context of the task.
|
|
268
|
+
* @param {EditFeeSettings} settings - The settings for the fee edit.
|
|
269
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
270
|
+
*/
|
|
271
|
+
editFeesTx(context: TaskContext, settings: EditFeeSettings): Promise<TxPayloadBatchSequence>;
|
|
272
|
+
/**
|
|
273
|
+
* Creates an edit automation settings intent for a vault.
|
|
274
|
+
* @param {TaskContext} context - The context of the task.
|
|
275
|
+
* @param {EditAutomationSettings} settings - The settings for the automation edit.
|
|
276
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
277
|
+
*/
|
|
278
|
+
editAutomationTx(context: TaskContext, settings: EditAutomationSettings): Promise<TxPayloadBatchSequence>;
|
|
279
|
+
/**
|
|
280
|
+
* Creates an edit LP settings intent for a vault.
|
|
281
|
+
* @param {TaskContext} context - The context of the task.
|
|
282
|
+
* @param {EditLpSettings} settings - The settings for the LP edit.
|
|
283
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
284
|
+
*/
|
|
285
|
+
editLpTx(context: TaskContext, settings: EditLpSettings): Promise<TxPayloadBatchSequence>;
|
|
286
|
+
/**
|
|
287
|
+
* Creates an edit metadata settings intent for a vault.
|
|
288
|
+
* @param {TaskContext} context - The context of the task.
|
|
289
|
+
* @param {EditMetadataSettings} settings - The settings for the metadata edit.
|
|
290
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
291
|
+
*/
|
|
292
|
+
editMetadataTx(context: TaskContext, settings: EditMetadataSettings): Promise<TxPayloadBatchSequence>;
|
|
293
|
+
/**
|
|
294
|
+
* Creates an edit deposits settings intent for a vault.
|
|
295
|
+
* @param {TaskContext} context - The context of the task.
|
|
296
|
+
* @param {EditDepositsSettings} settings - The settings for the deposits edit.
|
|
297
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
298
|
+
*/
|
|
299
|
+
editDepositsTx(context: TaskContext, settings: EditDepositsSettings): Promise<TxPayloadBatchSequence>;
|
|
300
|
+
/**
|
|
301
|
+
* Creates an edit force rebalance settings intent for a vault.
|
|
302
|
+
* @param {TaskContext} context - The context of the task.
|
|
303
|
+
* @param {EditForceRebalanceSettings} settings - The settings for the force rebalance edit.
|
|
304
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
305
|
+
*/
|
|
306
|
+
editForceRebalanceTx(context: TaskContext, settings: EditForceRebalanceSettings): Promise<TxPayloadBatchSequence>;
|
|
307
|
+
/**
|
|
308
|
+
* Creates an edit custom rebalance settings intent for a vault.
|
|
309
|
+
* @param {TaskContext} context - The context of the task.
|
|
310
|
+
* @param {EditCustomRebalanceSettings} settings - The settings for the custom rebalance edit.
|
|
311
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
312
|
+
*/
|
|
313
|
+
editCustomRebalanceTx(context: TaskContext, settings: EditCustomRebalanceSettings): Promise<TxPayloadBatchSequence>;
|
|
314
|
+
/**
|
|
315
|
+
* Creates an edit add token delay intent for a vault.
|
|
316
|
+
* @param {TaskContext} context - The context of the task.
|
|
317
|
+
* @param {EditAddTokenSettings} settings - The settings for the add token delay edit.
|
|
318
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
319
|
+
*/
|
|
320
|
+
editAddTokenDelayTx(context: TaskContext, settings: EditAddTokenSettings): Promise<TxPayloadBatchSequence>;
|
|
321
|
+
/**
|
|
322
|
+
* Creates an edit update weights delay intent for a vault.
|
|
323
|
+
* @param {TaskContext} context - The context of the task.
|
|
324
|
+
* @param {EditUpdateWeightsSettings} settings - The settings for the update weights delay edit.
|
|
325
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
326
|
+
*/
|
|
327
|
+
editUpdateWeightsDelayTx(context: TaskContext, settings: EditUpdateWeightsSettings): Promise<TxPayloadBatchSequence>;
|
|
328
|
+
/**
|
|
329
|
+
* Creates an edit swap delay intent for a vault.
|
|
330
|
+
* @param {TaskContext} context - The context of the task.
|
|
331
|
+
* @param {EditMakeDirectSwapSettings} settings - The settings for the make direct swap delay edit.
|
|
332
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
333
|
+
*/
|
|
334
|
+
editSwapDelayTx(context: TaskContext, settings: EditMakeDirectSwapSettings): Promise<TxPayloadBatchSequence>;
|
|
335
|
+
/**
|
|
336
|
+
* Creates an add or edit token intent for a vault.
|
|
337
|
+
* @param {TaskContext} context - The context of the task.
|
|
338
|
+
* @param {AddOrEditTokenInput} settings - The settings for the add or edit token.
|
|
339
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
340
|
+
*/
|
|
341
|
+
addOrEditTokenTx(context: TaskContext, settings: AddOrEditTokenInput): Promise<TxPayloadBatchSequence>;
|
|
342
|
+
/**
|
|
343
|
+
* Creates a update weights intent for a vault.
|
|
344
|
+
* @param {TaskContext} context - The context of the task.
|
|
345
|
+
* @param {UpdateWeightsInput} settings - The settings for the update weights.
|
|
346
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
347
|
+
*/
|
|
348
|
+
updateWeightsTx(context: TaskContext, settings: UpdateWeightsInput): Promise<TxPayloadBatchSequence>;
|
|
349
|
+
/**
|
|
350
|
+
* Creates a direct swap intent for a vault.
|
|
351
|
+
* @param {TaskContext} context - The context of the task.
|
|
352
|
+
* @param {MakeDirectSwapInput} settings - The settings for the make direct swap.
|
|
353
|
+
* @param {TransactionInstruction} jup_swap_ix - Optional. The JUP swap instruction.
|
|
354
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
355
|
+
*/
|
|
356
|
+
makeDirectSwapTx(context: TaskContext, settings: MakeDirectSwapInput, jup_swap_ix?: TransactionInstruction): Promise<TxPayloadBatchSequence>;
|
|
357
|
+
/**
|
|
358
|
+
* Creates vault intent account.
|
|
359
|
+
* @param {Object} params - The parameters for the vault intent.
|
|
360
|
+
* @param {TaskContext} params.context - The context of the task.
|
|
361
|
+
* @param {TaskType} params.type - The type of the task.
|
|
362
|
+
* @param {Settings} params.settings - The settings for the task.
|
|
363
|
+
* @param {number} params.min_bounty_per_task - Optional. The minimum bounty per task.
|
|
364
|
+
* @param {number} params.max_bounty_per_task - Optional. The maximum bounty per task.
|
|
365
|
+
* @param {TransactionInstruction} params.jup_swap_ix - Optional. The JUP swap instruction (for MakeDirectSwap task).
|
|
366
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
367
|
+
*/
|
|
368
|
+
openVaultIntentTx(params: {
|
|
369
|
+
context: TaskContext;
|
|
370
|
+
type: TaskType;
|
|
371
|
+
settings: Settings;
|
|
372
|
+
jup_swap_ix?: TransactionInstruction;
|
|
373
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
374
|
+
/**
|
|
375
|
+
* Executes a vault intent. Vault intent will be executed immediately.
|
|
376
|
+
* @param {Object} params - The parameters for the vault intent.
|
|
377
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
378
|
+
* @param {string} params.intent - The public key of the intent.
|
|
379
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
380
|
+
*/
|
|
381
|
+
executeVaultIntentTx(params: {
|
|
382
|
+
keeper: string;
|
|
383
|
+
intent: string;
|
|
384
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
385
|
+
/**
|
|
386
|
+
* Executes an existing make-direct-swap vault intent.
|
|
387
|
+
* Builds the flash swap batch first and then executes the intent once the
|
|
388
|
+
* vault balances have been updated by the swap.
|
|
389
|
+
*/
|
|
390
|
+
executeDirectSwapVaultIntentTx(params: {
|
|
391
|
+
keeper: string;
|
|
392
|
+
intent: string;
|
|
393
|
+
jup_token_ledger_ix?: TransactionInstruction;
|
|
394
|
+
jup_swap_ix: TransactionInstruction;
|
|
395
|
+
jup_address_lookup_table_addresses?: PublicKey[];
|
|
396
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
397
|
+
/**
|
|
398
|
+
* Cancels a vault intent. Vault intent account will get closed.
|
|
399
|
+
* @param {Object} params - The parameters for the vault intent.
|
|
400
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
401
|
+
* @param {string} params.intent - The public key of the intent.
|
|
402
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
403
|
+
*/
|
|
404
|
+
cancelVaultIntentTx(params: {
|
|
405
|
+
keeper: string;
|
|
406
|
+
intent: string;
|
|
407
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
408
|
+
/**
|
|
409
|
+
* Cancels a rebalance intent. Rebalance intent status will be set to AuctionFinished.
|
|
410
|
+
* @param {Object} params - The parameters for the rebalance intent.
|
|
411
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
412
|
+
* @param {string} params.rebalance_intent - The public key of the rebalance intent.
|
|
413
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
414
|
+
*/
|
|
415
|
+
cancelRebalanceIntentTx(params: {
|
|
416
|
+
keeper: string;
|
|
417
|
+
rebalance_intent: string;
|
|
418
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
419
|
+
/**
|
|
420
|
+
* Creates a rebalance intent for a user to deposit tokens into a vault.
|
|
421
|
+
*
|
|
422
|
+
* Batch layout:
|
|
423
|
+
*
|
|
424
|
+
* batch 0:
|
|
425
|
+
* * tx0: [create, resize, init rebalance intent],
|
|
426
|
+
*
|
|
427
|
+
* batch 1:
|
|
428
|
+
* * tx0: [deposit tokens ix],
|
|
429
|
+
* * tx1: [deposit tokens ix],
|
|
430
|
+
* * ...
|
|
431
|
+
*
|
|
432
|
+
* batch 2:
|
|
433
|
+
* * tx0: [lock deposits ix, start price updates ix],
|
|
434
|
+
*
|
|
435
|
+
* @param {Object} params - The parameters for the vault purchase.
|
|
436
|
+
* @param {string} params.buyer - The public key of the buyer.
|
|
437
|
+
* @param {string} params.vault_mint - The mint public key of the vault.
|
|
438
|
+
* @param {{mint: string, amount: number}[]} params.contributions - The contributions to the vault.
|
|
439
|
+
* @param {string} params.contributions[].mint - The mint public key of the contribution.
|
|
440
|
+
* @param {number} params.contributions[].amount - The amount of the contribution.
|
|
441
|
+
* @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
|
|
442
|
+
* @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
|
|
443
|
+
* @param {number} params.execution_start_time - Optional. The execution start time.
|
|
444
|
+
* @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
|
|
445
|
+
* @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
|
|
446
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
447
|
+
*/
|
|
448
|
+
buyVaultTx(params: {
|
|
449
|
+
buyer: string;
|
|
450
|
+
vault_mint: string;
|
|
451
|
+
contributions: {
|
|
452
|
+
mint: string;
|
|
453
|
+
amount: number;
|
|
454
|
+
}[];
|
|
455
|
+
rebalance_slippage_bps?: number;
|
|
456
|
+
per_trade_rebalance_slippage_bps?: number;
|
|
457
|
+
execution_start_time?: number;
|
|
458
|
+
min_bounty_amount?: number;
|
|
459
|
+
max_bounty_amount?: number;
|
|
460
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
461
|
+
/**
|
|
462
|
+
* Deposits additional tokens into an existing user deposit rebalance intent.
|
|
463
|
+
*
|
|
464
|
+
* This is useful when the user already created a deposit intent (for example via buyVaultTx),
|
|
465
|
+
* but has not called lockDepositsTx yet and wants to add more contributions.
|
|
466
|
+
*
|
|
467
|
+
* @param {Object} params - The parameters for depositing more tokens.
|
|
468
|
+
* @param {string} params.buyer - The public key of the buyer / deposit owner.
|
|
469
|
+
* @param {{mint: string, amount: number}[]} params.contributions - Extra token contributions.
|
|
470
|
+
* @param {string} params.rebalance_intent - Optional. Existing rebalance intent pubkey.
|
|
471
|
+
* @param {RebalanceIntent} params.rebalance_intent_chain_data - Optional. Existing rebalance intent chain data.
|
|
472
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
473
|
+
*/
|
|
474
|
+
depositTokensTx(params: {
|
|
475
|
+
buyer: string;
|
|
476
|
+
contributions: {
|
|
477
|
+
mint: string;
|
|
478
|
+
amount: number;
|
|
479
|
+
}[];
|
|
480
|
+
rebalance_intent?: string;
|
|
481
|
+
rebalance_intent_chain_data?: RebalanceIntent;
|
|
482
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
483
|
+
/**
|
|
484
|
+
* Locks deposits for a user and starts auction flow.
|
|
485
|
+
* @param {Object} params - The parameters for the lock deposits.
|
|
486
|
+
* @param {string} params.buyer - The public key of the buyer.
|
|
487
|
+
* @param {string} params.vault_mint - The mint public key of the vault.
|
|
488
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
489
|
+
*/
|
|
490
|
+
lockDepositsTx(params: {
|
|
491
|
+
buyer: string;
|
|
492
|
+
vault_mint: string;
|
|
493
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
494
|
+
/**
|
|
495
|
+
* Creates a rebalance intent for a user to withdraw tokens from a vault.
|
|
496
|
+
* @param {{Object}} params - The parameters for the vault sale.
|
|
497
|
+
* @param {string} params.seller - The public key of the seller.
|
|
498
|
+
* @param {string} params.vault_mint - The mint public key of the vault.
|
|
499
|
+
* @param {number} params.withdraw_amount - The amount of the withdrawal.
|
|
500
|
+
* @param {string[]} params.keep_tokens - The token mints to skip rebalancing (will directly be sent to the user without being rebalanced).
|
|
501
|
+
* @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
|
|
502
|
+
* @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
|
|
503
|
+
* @param {number} params.execution_start_time - Optional. The execution start time.
|
|
504
|
+
* @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
|
|
505
|
+
* @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
|
|
506
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
507
|
+
*/
|
|
508
|
+
sellVaultTx(params: {
|
|
509
|
+
seller: string;
|
|
510
|
+
vault_mint: string;
|
|
511
|
+
withdraw_amount: number;
|
|
512
|
+
keep_tokens: string[];
|
|
513
|
+
rebalance_slippage_bps?: number;
|
|
514
|
+
per_trade_rebalance_slippage_bps?: number;
|
|
515
|
+
execution_start_time?: number;
|
|
516
|
+
min_bounty_amount?: number;
|
|
517
|
+
max_bounty_amount?: number;
|
|
518
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
519
|
+
/**
|
|
520
|
+
* Creates a rebalance intent for a vault rebalance.
|
|
521
|
+
* @param {Object} params - The parameters for the vault rebalance.
|
|
522
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
523
|
+
* @param {string} params.vault_mint - The vault token mint public key.
|
|
524
|
+
* @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points.
|
|
525
|
+
* @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points.
|
|
526
|
+
* @param {number} params.execution_start_time - Optional. The execution start time.
|
|
527
|
+
* @param {number} params.min_bounty_amount - Optional. The minimum bounty amount.
|
|
528
|
+
* @param {number} params.max_bounty_amount - Optional. The maximum bounty amount.
|
|
529
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
530
|
+
*/
|
|
531
|
+
rebalanceVaultTx(params: {
|
|
532
|
+
keeper: string;
|
|
533
|
+
vault_mint: string;
|
|
534
|
+
rebalance_slippage_bps?: number;
|
|
535
|
+
per_trade_rebalance_slippage_bps?: number;
|
|
536
|
+
execution_start_time?: number;
|
|
537
|
+
min_bounty_amount?: number;
|
|
538
|
+
max_bounty_amount?: number;
|
|
539
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
540
|
+
/**
|
|
541
|
+
* Build update token prices transactions.
|
|
542
|
+
*
|
|
543
|
+
* For pyth oracle accounts, fetches feed IDs, builds vaa [create init encode], [write verify],
|
|
544
|
+
*
|
|
545
|
+
* [update feed], [close vaa] instructions. For all tokens, builds [update token prices] instructions.
|
|
546
|
+
*
|
|
547
|
+
* returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
548
|
+
*
|
|
549
|
+
* Batch layout:
|
|
550
|
+
*
|
|
551
|
+
* batch 0:
|
|
552
|
+
* * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx],
|
|
553
|
+
* * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx],
|
|
554
|
+
* * ...
|
|
555
|
+
*
|
|
556
|
+
* batch 1:
|
|
557
|
+
* * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx],
|
|
558
|
+
* * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx],
|
|
559
|
+
* * ...
|
|
560
|
+
*
|
|
561
|
+
* batch 2:
|
|
562
|
+
* * tx0: [updateFeed0Ix],
|
|
563
|
+
* * tx1: [updateFeed1Ix],
|
|
564
|
+
* * ...
|
|
565
|
+
*
|
|
566
|
+
* batch 3:
|
|
567
|
+
* * tx0: [updateTokenPricesIx(max 10 tokens)],
|
|
568
|
+
* * tx1: [updateTokenPricesIx(max 10 tokens)],
|
|
569
|
+
* * ...
|
|
570
|
+
* * txLast: [closeVaa0Ix, closeVaa1Ix, ...]
|
|
571
|
+
*
|
|
572
|
+
* @param {Object} params - The parameters for the update token prices.
|
|
573
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
574
|
+
* @param {string} params.vault - The public key of the vault.
|
|
575
|
+
* @param {string} params.rebalance_intent - The public key of the rebalance intent.
|
|
576
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
577
|
+
*/
|
|
578
|
+
updateTokenPricesTx(params: {
|
|
579
|
+
keeper: string;
|
|
580
|
+
vault: string;
|
|
581
|
+
rebalance_intent: string;
|
|
582
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
583
|
+
/**
|
|
584
|
+
* Build Pyth price feed update transactions from on-chain price account pubkeys.
|
|
585
|
+
* Fetches feed IDs from accounts, builds update instructions, and returns
|
|
586
|
+
* TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
587
|
+
*
|
|
588
|
+
* Batch layout:
|
|
589
|
+
*
|
|
590
|
+
* batch 0:
|
|
591
|
+
* * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx],
|
|
592
|
+
* * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx],
|
|
593
|
+
* * ...
|
|
594
|
+
*
|
|
595
|
+
* batch 1:
|
|
596
|
+
* * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx],
|
|
597
|
+
* * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx],
|
|
598
|
+
* * ...
|
|
599
|
+
*
|
|
600
|
+
* batch 2:
|
|
601
|
+
* * tx0: [updateFeed0Ix],
|
|
602
|
+
* * tx1: [updateFeed1Ix],
|
|
603
|
+
* * ...
|
|
604
|
+
*
|
|
605
|
+
* batch 3:
|
|
606
|
+
* * txLast: [closeVaa0Ix, closeVaa1Ix, ...]
|
|
607
|
+
*
|
|
608
|
+
*/
|
|
609
|
+
updatePythPriceFeedsTx(params: {
|
|
610
|
+
keeper: string;
|
|
611
|
+
accounts: string[];
|
|
612
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
613
|
+
/**
|
|
614
|
+
* Build flash swap transactions (Rebalance or MakeDirectSwap).
|
|
615
|
+
*
|
|
616
|
+
* Withdraws amount_out tokens(mint_out) from vault, deposits amount_in tokens(mint_in) to vault.
|
|
617
|
+
*
|
|
618
|
+
* If jup_swap_ix is provided, uses it to swap amount_out tokens(mint_out) for amount_in tokens(mint_in).
|
|
619
|
+
*
|
|
620
|
+
* returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
621
|
+
*
|
|
622
|
+
* Batch layout: batch 0: tx: 0:
|
|
623
|
+
* * create associated token account_mint_out
|
|
624
|
+
* * create associated token account_mint_in
|
|
625
|
+
* * jup_token_ledger_ix
|
|
626
|
+
* * flash withdraw
|
|
627
|
+
* * jup_swap_ix
|
|
628
|
+
* * flash deposit
|
|
629
|
+
* * set compute unit limit
|
|
630
|
+
* * set compute unit price
|
|
631
|
+
*
|
|
632
|
+
* @param {Object} params - The parameters for the flash swap.
|
|
633
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
634
|
+
* @param {string} params.vault - The public key of the vault.
|
|
635
|
+
* @param {string} params.rebalance_intent - The public key of the rebalance intent (for Rebalance).
|
|
636
|
+
* @param {string} params.intent - The public key of the intent (for MakeDirectSwap).
|
|
637
|
+
* @param {string} params.mint_in - The mint of the input token (deposited to vault).
|
|
638
|
+
* @param {string} params.mint_out - The mint of the output token (withdrawn from vault).
|
|
639
|
+
* @param {number} params.amount_in - The amount of the input token (deposited to vault).
|
|
640
|
+
* @param {number} params.amount_out - The amount of the output token (withdrawn from vault).
|
|
641
|
+
* @param {"exact_in" | "exact_out" | "ioc"} params.mode - The mode of the flash swap.
|
|
642
|
+
* @param {TransactionInstruction} params.jup_token_ledger_ix - The jup token ledger ix.
|
|
643
|
+
* @param {TransactionInstruction} params.jup_swap_ix - The jup swap ix.
|
|
644
|
+
* @param {PublicKey[]} params.jup_address_lookup_table_addresses - The jup address lookup table addresses.
|
|
645
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
646
|
+
*/
|
|
647
|
+
flashSwapTx(params: {
|
|
648
|
+
keeper: string;
|
|
649
|
+
vault: string;
|
|
650
|
+
rebalance_intent?: string;
|
|
651
|
+
intent?: string;
|
|
652
|
+
mint_in: string;
|
|
653
|
+
mint_out: string;
|
|
654
|
+
amount_in: number;
|
|
655
|
+
amount_out: number;
|
|
656
|
+
mode?: number;
|
|
657
|
+
jup_token_ledger_ix?: TransactionInstruction;
|
|
658
|
+
jup_swap_ix?: TransactionInstruction;
|
|
659
|
+
jup_address_lookup_table_addresses?: PublicKey[];
|
|
660
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
661
|
+
/**
|
|
662
|
+
* Mints vault tokens for a user. Executable when the rebalance intent has finished its auctions.
|
|
663
|
+
*
|
|
664
|
+
* Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
665
|
+
*
|
|
666
|
+
* @param {Object} params - The parameters for the mint.
|
|
667
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
668
|
+
* @param {string} params.rebalance_intent - The public key of the rebalance intent.
|
|
669
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
670
|
+
*/
|
|
671
|
+
mintTx(params: {
|
|
672
|
+
keeper: string;
|
|
673
|
+
rebalance_intent: string;
|
|
674
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
675
|
+
/**
|
|
676
|
+
* Redeems tokens from the rebalance intent with Withdraw status.
|
|
677
|
+
*
|
|
678
|
+
* Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
679
|
+
*
|
|
680
|
+
* @param {Object} params - The parameters for the redeem tokens.
|
|
681
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
682
|
+
* @param {string} params.rebalance_intent - The public key of the rebalance intent.
|
|
683
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
684
|
+
*/
|
|
685
|
+
redeemTokensTx(params: {
|
|
686
|
+
keeper: string;
|
|
687
|
+
rebalance_intent: string;
|
|
688
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
689
|
+
/**
|
|
690
|
+
* Claims the bounty to keepers who have completed tasks for rebalance intent.
|
|
691
|
+
*
|
|
692
|
+
* Executebale when the rebalance intent has finished its auctions.
|
|
693
|
+
*
|
|
694
|
+
* For Withdraw status rebalance intent, tokens have to be redeemed first.
|
|
695
|
+
*
|
|
696
|
+
* Closes the rebalance intent if all keepers have claimed the bounty.
|
|
697
|
+
*
|
|
698
|
+
* @param {Object} params - The parameters for the claim bounty.
|
|
699
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
700
|
+
* @param {string} params.rebalance_intent - The public key of the rebalance intent.
|
|
701
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
702
|
+
*/
|
|
703
|
+
claimBountyTx(params: {
|
|
704
|
+
keeper: string;
|
|
705
|
+
rebalance_intent: string;
|
|
706
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
707
|
+
/**
|
|
708
|
+
* Adds bounty for automation to vault.
|
|
709
|
+
* Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
710
|
+
*
|
|
711
|
+
* @param {Object} params - The parameters for the add bounty.
|
|
712
|
+
* @param {string} params.keeper - The public key of the keeper.
|
|
713
|
+
* @param {string} params.vault - The public key of the vault.
|
|
714
|
+
* @param {number} params.amount - The amount of the bounty.
|
|
715
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
716
|
+
*/
|
|
717
|
+
addBountyTx(params: {
|
|
718
|
+
keeper: string;
|
|
719
|
+
vault: string;
|
|
720
|
+
amount: number;
|
|
721
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
722
|
+
/**
|
|
723
|
+
* Withdraws fees from the vault, initializes WithdrawVaultFees accounts, and claims the fee tokens
|
|
724
|
+
* for all fee types that the claimer is authorized to claim (symmetry, creator, host, or manager fees).
|
|
725
|
+
*
|
|
726
|
+
* This function automatically determines which fee types the claimer can claim based on:
|
|
727
|
+
* - Symmetry fees: if claimer equals globalConfig.symmetryFeeCollector
|
|
728
|
+
* - Creator fees: if claimer equals vault.settings.creator
|
|
729
|
+
* - Host fees: if claimer equals vault.settings.host
|
|
730
|
+
* - Manager fees: if claimer is in vault.settings.managers.managers
|
|
731
|
+
*
|
|
732
|
+
* Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
733
|
+
*
|
|
734
|
+
* Batch layout:
|
|
735
|
+
* - batch 0: One transaction per claimable fee type, each containing a withdrawFeesIx instruction.
|
|
736
|
+
* All transactions in this batch can run in parallel. These create and populate the WithdrawVaultFees accounts.
|
|
737
|
+
* - batch 1: Multiple transactions for claiming fee tokens, automatically batched based on account limits.
|
|
738
|
+
* All transactions in this batch can run in parallel. These transfer tokens from WithdrawVaultFees accounts to claimers.
|
|
739
|
+
*
|
|
740
|
+
* Note: If not all tokens are claimed in batch 1 (e.g., due to account limits or errors),
|
|
741
|
+
* use claimTokenFeesFromVaultTx to claim the remaining tokens.
|
|
742
|
+
*
|
|
743
|
+
* @param {Object} params - The parameters for withdrawing and claiming vault fees.
|
|
744
|
+
* @param {string} params.claimer - The public key of the claimer.
|
|
745
|
+
* @param {string} params.vault - The public key of the vault.
|
|
746
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
747
|
+
*/
|
|
748
|
+
withdrawVaultFeesTx(params: {
|
|
749
|
+
claimer: string;
|
|
750
|
+
vault: string;
|
|
751
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
752
|
+
/**
|
|
753
|
+
* Claims fee tokens from a WithdrawVaultFees account.
|
|
754
|
+
*
|
|
755
|
+
* This function transfers accumulated fee tokens from the WithdrawVaultFees account
|
|
756
|
+
* to the claimers (owners) based on their weights. The tokens are automatically batched
|
|
757
|
+
* into multiple transactions if needed to respect Solana's account limit (30 accounts per transaction).
|
|
758
|
+
*
|
|
759
|
+
* Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
760
|
+
*
|
|
761
|
+
* @param {Object} params - The parameters for claiming vault fees.
|
|
762
|
+
* @param {string} params.claimer - The public key of the claimer.
|
|
763
|
+
* @param {string} params.vault - The public key of the vault.
|
|
764
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
765
|
+
*/
|
|
766
|
+
claimTokenFeesFromVaultTx(params: {
|
|
767
|
+
claimer: string;
|
|
768
|
+
withdrawVaultFees: string;
|
|
769
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
770
|
+
/**
|
|
771
|
+
* Rewrites lookup tables for the vault. (Used when the vault lookup tables are full)
|
|
772
|
+
*
|
|
773
|
+
* Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence.
|
|
774
|
+
*
|
|
775
|
+
* Batch layout:
|
|
776
|
+
*
|
|
777
|
+
* batch 0:
|
|
778
|
+
* * tx0: [create temp lookup tables],
|
|
779
|
+
*
|
|
780
|
+
* batch 1:
|
|
781
|
+
* * tx0: [extend temp lookup tables (with oracles of active tokens)],
|
|
782
|
+
* * tx1: [extend temp lookup tables (with oracles of active tokens)],
|
|
783
|
+
* * ...
|
|
784
|
+
*
|
|
785
|
+
* batch 2:
|
|
786
|
+
* * tx0: [overwrite lookup tables with temp, deactivate old lookup tables],
|
|
787
|
+
*
|
|
788
|
+
* @param {Object} params - The parameters for the rewrite lookup tables.
|
|
789
|
+
* @param {string} params.signer - The public key of the signer.
|
|
790
|
+
* @param {string} params.vault_mint - The mint of the vault.
|
|
791
|
+
* @param {string[]} params.additional_accounts - The additional accounts.
|
|
792
|
+
* @returns {Promise<TxPayloadBatchSequence>} The transaction payload batch sequence.
|
|
793
|
+
*/
|
|
794
|
+
rewriteLookupTablesTx(params: {
|
|
795
|
+
signer: string;
|
|
796
|
+
vault_mint: string;
|
|
797
|
+
additional_accounts: string[];
|
|
798
|
+
}): Promise<TxPayloadBatchSequence>;
|
|
799
|
+
signAndSendVersionedTxs(params: {
|
|
800
|
+
versionedTxs: VersionedTxs;
|
|
801
|
+
wallet: Wallet;
|
|
802
|
+
}): Promise<TransactionSignature[][]>;
|
|
803
|
+
signAndSendTxPayloadBatchSequence(params: {
|
|
804
|
+
txPayloadBatchSequence: TxPayloadBatchSequence;
|
|
805
|
+
wallet: Wallet;
|
|
806
|
+
simulateTransactions?: boolean;
|
|
807
|
+
}): Promise<TransactionSignature[][]>;
|
|
808
|
+
}
|
|
809
|
+
export { VaultCreationTx, TxPayloadBatchSequence, VersionedTxs, };
|
|
810
|
+
export { GlobalConfig, Vault, VaultFilter, Intent, IntentFilter, RebalanceIntent, RebalanceIntentFilter };
|
|
811
|
+
export { FormattedGlobalConfig, FormattedIntentStatus, FormattedTaskType, FormattedBounty, FormattedBountySchedule, FormattedIntent, };
|
|
812
|
+
export { FormattedRebalanceType, FormattedRebalanceAction, FormattedOraclePrice, FormattedTokenAuction, FormattedTaskCompletion, FormattedRebalanceIntent, UIRebalanceIntent, DepositData, PriceUpdatesData, AuctionData, MintData, RedeemData, ClaimBountyData, };
|
|
813
|
+
export { FormattedCreatorSettings, FormattedManagersSettings, FormattedFeeSettings, FormattedScheduleSettings, FormattedAutomationSettings, FormattedLpSettings, FormattedMetadataSettings, FormattedDepositsSettings, FormattedForceRebalanceSettings, FormattedCustomRebalanceSettings, FormattedAddTokenSettings, FormattedUpdateWeightsSettings, FormattedMakeDirectSwapSettings, FormattedAccumulatedFees, FormattedLookupTables, FormattedAsset, FormattedOracleSettings, FormattedOracleAggregator, FormattedOracle, FormattedOracleType, FormattedVault, };
|
|
814
|
+
export { EditCreatorSettings, EditManagerSettings, EditFeeSettings, EditScheduleSettings, EditAutomationSettings, EditLpSettings, EditMetadataSettings, EditDepositsSettings, EditForceRebalanceSettings, EditCustomRebalanceSettings, EditAddTokenSettings, EditUpdateWeightsSettings, EditMakeDirectSwapSettings, AddOrEditTokenInput, OracleInput, UpdateWeightsInput, MakeDirectSwapInput, Settings, TaskContext, TaskType, };
|
|
815
|
+
export { getJupTokenLedgerAndSwapInstructions, getSwapPairs, isRebalanceRequired, };
|
|
816
|
+
export { KeeperMonitor, RebalanceHandler, } from './keeperMonitor';
|