@kamino-finance/metavault-sdk 1.3.1 → 2.1.0
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/README.md +147 -74
- package/dist/@codegen/metavault/accounts/MetavaultState.d.ts +51 -36
- package/dist/@codegen/metavault/accounts/MetavaultState.d.ts.map +1 -1
- package/dist/@codegen/metavault/accounts/MetavaultState.js +33 -22
- package/dist/@codegen/metavault/accounts/MetavaultState.js.map +1 -1
- package/dist/@codegen/metavault/errors/custom.d.ts +242 -242
- package/dist/@codegen/metavault/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/metavault/errors/custom.js +477 -477
- package/dist/@codegen/metavault/errors/custom.js.map +1 -1
- package/dist/@codegen/metavault/instructions/buy.d.ts +4 -1
- package/dist/@codegen/metavault/instructions/buy.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/buy.js +4 -1
- package/dist/@codegen/metavault/instructions/buy.js.map +1 -1
- package/dist/@codegen/metavault/instructions/exchangeRate.d.ts +3 -2
- package/dist/@codegen/metavault/instructions/exchangeRate.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/exchangeRate.js +3 -2
- package/dist/@codegen/metavault/instructions/exchangeRate.js.map +1 -1
- package/dist/@codegen/metavault/instructions/initVault.d.ts +6 -0
- package/dist/@codegen/metavault/instructions/initVault.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/initVault.js +6 -0
- package/dist/@codegen/metavault/instructions/initVault.js.map +1 -1
- package/dist/@codegen/metavault/instructions/openWithdrawOrder.d.ts +3 -1
- package/dist/@codegen/metavault/instructions/openWithdrawOrder.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/openWithdrawOrder.js +3 -1
- package/dist/@codegen/metavault/instructions/openWithdrawOrder.js.map +1 -1
- package/dist/@codegen/metavault/instructions/rebalanceSwap.d.ts +2 -1
- package/dist/@codegen/metavault/instructions/rebalanceSwap.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/rebalanceSwap.js +2 -1
- package/dist/@codegen/metavault/instructions/rebalanceSwap.js.map +1 -1
- package/dist/@codegen/metavault/instructions/refreshVault.d.ts +3 -3
- package/dist/@codegen/metavault/instructions/refreshVault.js +3 -3
- package/dist/@codegen/metavault/instructions/sell.d.ts +4 -1
- package/dist/@codegen/metavault/instructions/sell.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/sell.js +4 -1
- package/dist/@codegen/metavault/instructions/sell.js.map +1 -1
- package/dist/@codegen/metavault/instructions/settleDepositOrder.d.ts +2 -1
- package/dist/@codegen/metavault/instructions/settleDepositOrder.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/settleDepositOrder.js +2 -1
- package/dist/@codegen/metavault/instructions/settleDepositOrder.js.map +1 -1
- package/dist/@codegen/metavault/instructions/settleWithdrawOrder.d.ts +4 -2
- package/dist/@codegen/metavault/instructions/settleWithdrawOrder.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/settleWithdrawOrder.js +4 -2
- package/dist/@codegen/metavault/instructions/settleWithdrawOrder.js.map +1 -1
- package/dist/@codegen/metavault/instructions/startRebalance.d.ts +4 -0
- package/dist/@codegen/metavault/instructions/startRebalance.d.ts.map +1 -1
- package/dist/@codegen/metavault/instructions/startRebalance.js +4 -0
- package/dist/@codegen/metavault/instructions/startRebalance.js.map +1 -1
- package/dist/@codegen/metavault/types/ExchangeRateWithDecimals.d.ts +5 -3
- package/dist/@codegen/metavault/types/ExchangeRateWithDecimals.d.ts.map +1 -1
- package/dist/@codegen/metavault/types/ExchangeRateWithDecimals.js +5 -3
- package/dist/@codegen/metavault/types/ExchangeRateWithDecimals.js.map +1 -1
- package/dist/@codegen/metavault/types/VaultConfigField.d.ts +119 -28
- package/dist/@codegen/metavault/types/VaultConfigField.d.ts.map +1 -1
- package/dist/@codegen/metavault/types/VaultConfigField.js +213 -45
- package/dist/@codegen/metavault/types/VaultConfigField.js.map +1 -1
- package/dist/@codegen/metavault/types/VaultToken.d.ts +74 -32
- package/dist/@codegen/metavault/types/VaultToken.d.ts.map +1 -1
- package/dist/@codegen/metavault/types/VaultToken.js +80 -34
- package/dist/@codegen/metavault/types/VaultToken.js.map +1 -1
- package/dist/@codegen/metavault/types/index.d.ts +4 -3
- package/dist/@codegen/metavault/types/index.d.ts.map +1 -1
- package/dist/@codegen/metavault/types/index.js.map +1 -1
- package/dist/classes/metaVault.d.ts +25 -18
- package/dist/classes/metaVault.d.ts.map +1 -1
- package/dist/classes/metaVault.js +25 -27
- package/dist/classes/metaVault.js.map +1 -1
- package/dist/classes/metaVaultClient.d.ts +113 -44
- package/dist/classes/metaVaultClient.d.ts.map +1 -1
- package/dist/classes/metaVaultClient.js +187 -167
- package/dist/classes/metaVaultClient.js.map +1 -1
- package/dist/classes/metaVaultTypes.d.ts +0 -53
- package/dist/classes/metaVaultTypes.d.ts.map +1 -1
- package/dist/leverage/snapshot.d.ts +4 -1
- package/dist/leverage/snapshot.d.ts.map +1 -1
- package/dist/leverage/snapshot.js +40 -11
- package/dist/leverage/snapshot.js.map +1 -1
- package/dist/leverage/snapshotTypes.d.ts +16 -1
- package/dist/leverage/snapshotTypes.d.ts.map +1 -1
- package/dist/leverage/snapshotTypes.js +11 -3
- package/dist/leverage/snapshotTypes.js.map +1 -1
- package/dist/leverage/step.d.ts +2 -1
- package/dist/leverage/step.d.ts.map +1 -1
- package/dist/leverage/step.js +4 -1
- package/dist/leverage/step.js.map +1 -1
- package/dist/server/build.d.ts +43 -0
- package/dist/server/build.d.ts.map +1 -0
- package/dist/server/build.js +133 -0
- package/dist/server/build.js.map +1 -0
- package/dist/server/feeWrapped.d.ts +29 -63
- package/dist/server/feeWrapped.d.ts.map +1 -1
- package/dist/server/feeWrapped.js +64 -108
- package/dist/server/feeWrapped.js.map +1 -1
- package/dist/server/feeWrappedTrade.d.ts +60 -0
- package/dist/server/feeWrappedTrade.d.ts.map +1 -0
- package/dist/server/feeWrappedTrade.js +225 -0
- package/dist/server/feeWrappedTrade.js.map +1 -0
- package/dist/server/index.d.ts +25 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +76 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/inputs.d.ts +25 -0
- package/dist/server/inputs.d.ts.map +1 -0
- package/dist/server/inputs.js +113 -0
- package/dist/server/inputs.js.map +1 -0
- package/dist/server/leverage.d.ts +173 -0
- package/dist/server/leverage.d.ts.map +1 -0
- package/dist/server/leverage.js +306 -0
- package/dist/server/leverage.js.map +1 -0
- package/dist/server/obligations.d.ts +34 -0
- package/dist/server/obligations.d.ts.map +1 -0
- package/dist/server/obligations.js +71 -0
- package/dist/server/obligations.js.map +1 -0
- package/dist/server/orders.d.ts +97 -0
- package/dist/server/orders.d.ts.map +1 -0
- package/dist/server/orders.js +227 -0
- package/dist/server/orders.js.map +1 -0
- package/dist/server/reads.d.ts +37 -0
- package/dist/server/reads.d.ts.map +1 -0
- package/dist/server/reads.js +101 -0
- package/dist/server/reads.js.map +1 -0
- package/dist/server/trade.d.ts +53 -0
- package/dist/server/trade.d.ts.map +1 -0
- package/dist/server/trade.js +131 -0
- package/dist/server/trade.js.map +1 -0
- package/dist/server/types.d.ts +88 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/types.js +3 -0
- package/dist/server/types.js.map +1 -0
- package/dist/server/vaultAdmin.d.ts +54 -0
- package/dist/server/vaultAdmin.d.ts.map +1 -0
- package/dist/server/vaultAdmin.js +107 -0
- package/dist/server/vaultAdmin.js.map +1 -0
- package/dist/server/vaultConfig.d.ts +103 -0
- package/dist/server/vaultConfig.d.ts.map +1 -0
- package/dist/server/vaultConfig.js +232 -0
- package/dist/server/vaultConfig.js.map +1 -0
- package/dist/server/vaultCreation.d.ts +61 -0
- package/dist/server/vaultCreation.d.ts.map +1 -0
- package/dist/server/vaultCreation.js +134 -0
- package/dist/server/vaultCreation.js.map +1 -0
- package/dist/server/wsol.d.ts +25 -0
- package/dist/server/wsol.d.ts.map +1 -0
- package/dist/server/wsol.js +72 -0
- package/dist/server/wsol.js.map +1 -0
- package/dist/utils/configParsing.d.ts +1 -1
- package/dist/utils/configParsing.d.ts.map +1 -1
- package/dist/utils/configParsing.js +48 -16
- package/dist/utils/configParsing.js.map +1 -1
- package/dist/utils/constants.d.ts +2 -5
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +3 -6
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/events.d.ts +2 -2
- package/dist/utils/events.d.ts.map +1 -1
- package/dist/utils/events.js +29 -5
- package/dist/utils/events.js.map +1 -1
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/integers.d.ts +8 -0
- package/dist/utils/integers.d.ts.map +1 -0
- package/dist/utils/integers.js +14 -0
- package/dist/utils/integers.js.map +1 -0
- package/dist/utils/limits.d.ts +44 -41
- package/dist/utils/limits.d.ts.map +1 -1
- package/dist/utils/limits.js +51 -138
- package/dist/utils/limits.js.map +1 -1
- package/dist/utils/metavaultAccount.d.ts +22 -0
- package/dist/utils/metavaultAccount.d.ts.map +1 -0
- package/dist/utils/metavaultAccount.js +34 -0
- package/dist/utils/metavaultAccount.js.map +1 -0
- package/dist/utils/obligationHealth.d.ts +31 -0
- package/dist/utils/obligationHealth.d.ts.map +1 -0
- package/dist/utils/obligationHealth.js +38 -0
- package/dist/utils/obligationHealth.js.map +1 -0
- package/dist/utils/orders.d.ts +46 -11
- package/dist/utils/orders.d.ts.map +1 -1
- package/dist/utils/orders.js +82 -59
- package/dist/utils/orders.js.map +1 -1
- package/dist/utils/rebalance.d.ts +75 -0
- package/dist/utils/rebalance.d.ts.map +1 -0
- package/dist/utils/rebalance.js +164 -0
- package/dist/utils/rebalance.js.map +1 -0
- package/dist/utils/remainingAccounts.d.ts +1 -1
- package/dist/utils/remainingAccounts.d.ts.map +1 -1
- package/dist/utils/remainingAccounts.js.map +1 -1
- package/dist/utils/scopeLayout.d.ts +18 -0
- package/dist/utils/scopeLayout.d.ts.map +1 -0
- package/dist/utils/scopeLayout.js +23 -0
- package/dist/utils/scopeLayout.js.map +1 -0
- package/dist/utils/sdkErrorCodes.d.ts +7 -0
- package/dist/utils/sdkErrorCodes.d.ts.map +1 -0
- package/dist/utils/sdkErrorCodes.js +37 -0
- package/dist/utils/sdkErrorCodes.js.map +1 -0
- package/dist/utils/sdkErrors.d.ts +206 -0
- package/dist/utils/sdkErrors.d.ts.map +1 -0
- package/dist/utils/sdkErrors.js +365 -0
- package/dist/utils/sdkErrors.js.map +1 -0
- package/dist/utils/seed.d.ts +65 -0
- package/dist/utils/seed.d.ts.map +1 -0
- package/dist/utils/seed.js +194 -0
- package/dist/utils/seed.js.map +1 -0
- package/dist/utils/send.d.ts +7 -1
- package/dist/utils/send.d.ts.map +1 -1
- package/dist/utils/send.js +17 -11
- package/dist/utils/send.js.map +1 -1
- package/dist/utils/simulation.d.ts +38 -5
- package/dist/utils/simulation.d.ts.map +1 -1
- package/dist/utils/simulation.js +35 -8
- package/dist/utils/simulation.js.map +1 -1
- package/dist/utils/summaries.d.ts +29 -5
- package/dist/utils/summaries.d.ts.map +1 -1
- package/dist/utils/summaries.js +29 -27
- package/dist/utils/summaries.js.map +1 -1
- package/dist/utils/tokenAccount.d.ts +7 -0
- package/dist/utils/tokenAccount.d.ts.map +1 -1
- package/dist/utils/tokenAccount.js +19 -0
- package/dist/utils/tokenAccount.js.map +1 -1
- package/dist/utils/viewResults.d.ts +3 -1
- package/dist/utils/viewResults.d.ts.map +1 -1
- package/dist/utils/viewResults.js.map +1 -1
- package/package.json +2 -1
- package/src/@codegen/metavault/accounts/MetavaultState.ts +67 -46
- package/src/@codegen/metavault/errors/custom.ts +480 -477
- package/src/@codegen/metavault/instructions/buy.ts +4 -1
- package/src/@codegen/metavault/instructions/exchangeRate.ts +3 -2
- package/src/@codegen/metavault/instructions/initVault.ts +6 -0
- package/src/@codegen/metavault/instructions/openWithdrawOrder.ts +3 -1
- package/src/@codegen/metavault/instructions/rebalanceSwap.ts +2 -1
- package/src/@codegen/metavault/instructions/refreshVault.ts +3 -3
- package/src/@codegen/metavault/instructions/sell.ts +4 -1
- package/src/@codegen/metavault/instructions/settleDepositOrder.ts +2 -1
- package/src/@codegen/metavault/instructions/settleWithdrawOrder.ts +4 -2
- package/src/@codegen/metavault/instructions/startRebalance.ts +4 -0
- package/src/@codegen/metavault/types/ExchangeRateWithDecimals.ts +5 -3
- package/src/@codegen/metavault/types/VaultConfigField.ts +262 -52
- package/src/@codegen/metavault/types/VaultToken.ts +120 -50
- package/src/@codegen/metavault/types/index.ts +24 -9
- package/src/classes/metaVault.ts +27 -57
- package/src/classes/metaVaultClient.ts +230 -246
- package/src/classes/metaVaultTypes.ts +0 -57
- package/src/idl/metavault.json +253 -173
- package/src/leverage/snapshot.ts +68 -17
- package/src/leverage/snapshotTypes.ts +25 -3
- package/src/leverage/step.ts +6 -2
- package/src/server/build.ts +196 -0
- package/src/server/feeWrapped.ts +100 -134
- package/src/server/feeWrappedTrade.ts +350 -0
- package/src/server/index.ts +97 -0
- package/src/server/inputs.ts +144 -0
- package/src/server/leverage.ts +498 -0
- package/src/server/obligations.ts +109 -0
- package/src/server/orders.ts +402 -0
- package/src/server/reads.ts +153 -0
- package/src/server/trade.ts +208 -0
- package/src/server/types.ts +108 -0
- package/src/server/vaultAdmin.ts +153 -0
- package/src/server/vaultConfig.ts +305 -0
- package/src/server/vaultCreation.ts +184 -0
- package/src/server/wsol.ts +106 -0
- package/src/utils/configParsing.ts +49 -16
- package/src/utils/constants.ts +2 -6
- package/src/utils/events.ts +36 -6
- package/src/utils/index.ts +6 -0
- package/src/utils/integers.ts +11 -0
- package/src/utils/limits.ts +90 -182
- package/src/utils/metavaultAccount.ts +45 -0
- package/src/utils/obligationHealth.ts +59 -0
- package/src/utils/orders.ts +164 -83
- package/src/utils/rebalance.ts +215 -0
- package/src/utils/remainingAccounts.ts +1 -1
- package/src/utils/scopeLayout.ts +26 -0
- package/src/utils/sdkErrorCodes.ts +35 -0
- package/src/utils/sdkErrors.ts +332 -0
- package/src/utils/seed.ts +245 -0
- package/src/utils/send.ts +19 -11
- package/src/utils/simulation.ts +64 -9
- package/src/utils/summaries.ts +58 -30
- package/src/utils/tokenAccount.ts +28 -1
- package/src/utils/viewResults.ts +3 -1
- package/dist/utils/computeBudget.d.ts +0 -7
- package/dist/utils/computeBudget.d.ts.map +0 -1
- package/dist/utils/computeBudget.js +0 -16
- package/dist/utils/computeBudget.js.map +0 -1
- package/src/utils/computeBudget.ts +0 -14
package/README.md
CHANGED
|
@@ -49,6 +49,10 @@ const createAccountIx = getCreateAccountInstruction({
|
|
|
49
49
|
newAccount: vaultKeypair,
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
// init_vault seeds the vault with one whole share's worth of `tokenMint` at $1, priced off its
|
|
53
|
+
// Scope feed in the same instruction; fund the admin's ATA with at least this much.
|
|
54
|
+
const seed = await client.fetchSeedDeposit({ mint: tokenMint, scope: scopeConfiguration });
|
|
55
|
+
|
|
52
56
|
const initIx = await client.initVaultIx(
|
|
53
57
|
admin,
|
|
54
58
|
vaultKeypair.address,
|
|
@@ -60,6 +64,10 @@ const initIx = await client.initVaultIx(
|
|
|
60
64
|
// Send [createAccountIx, initIx] in a single transaction
|
|
61
65
|
```
|
|
62
66
|
|
|
67
|
+
The program checks the seed price as it checks any vault token's by default: `scopeConfiguration`
|
|
68
|
+
needs a TWAP chain, and the price and its TWAP must each be at most a minute old and within 1% of
|
|
69
|
+
each other. Shares have 6 decimals; the seed's shares are counted in the supply but never minted.
|
|
70
|
+
|
|
63
71
|
### Buy vault shares (single token)
|
|
64
72
|
|
|
65
73
|
```typescript
|
|
@@ -89,7 +97,13 @@ const result = await client.sellIx(
|
|
|
89
97
|
```
|
|
90
98
|
|
|
91
99
|
Both examples pass `0n` for slippage, which is no protection. Use the previews below to derive a bound.
|
|
92
|
-
|
|
100
|
+
|
|
101
|
+
`buy` and `sell` are single-sided flows. Every token starts closed to them until the admin opens it
|
|
102
|
+
(`VaultTokenSingleSidedDepositEnabled`, `VaultTokenSingleSidedWithdrawEnabled`), and each pays the
|
|
103
|
+
token's single-sided fee (`VaultTokenSingleSided{Deposit,Withdraw}Fee{Bps,Lamports}`), floored by
|
|
104
|
+
the global fee. Neither the token's weight nor its weight deviation bounds them. They are refused
|
|
105
|
+
while the vault's own rebalance is in progress or a vault obligation is liquidatable; the preflight
|
|
106
|
+
below reports why.
|
|
93
107
|
|
|
94
108
|
### Proportional deposits and withdrawals
|
|
95
109
|
|
|
@@ -111,22 +125,26 @@ const deposit = await client.depositProportionalIxs(
|
|
|
111
125
|
```
|
|
112
126
|
|
|
113
127
|
For a proportional withdrawal, the owner opens an order and immediately pays out its liquid
|
|
114
|
-
basket, without auction fills
|
|
128
|
+
basket, without auction fills. Its server builder (see [Server builders](#server-builders))
|
|
129
|
+
takes whole tokens:
|
|
115
130
|
|
|
116
131
|
```typescript
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
|
|
132
|
+
import { getWithdrawProportionalIxs } from "@kamino-finance/metavault-sdk/dist/server";
|
|
133
|
+
|
|
134
|
+
const withdrawal = await getWithdrawProportionalIxs({
|
|
135
|
+
...context, // { client, signer, lookupTableContents }
|
|
136
|
+
vault: { address: vaultAddress, state: vaultState },
|
|
137
|
+
sharesAmount: new Decimal("12.5"),
|
|
138
|
+
minTokensOut: [{ mint: tokenAMint, amount: new Decimal("1") }],
|
|
139
|
+
});
|
|
140
|
+
// Send withdrawal.instructions, compiled against withdrawal.lookupTables.
|
|
125
141
|
```
|
|
126
142
|
|
|
127
143
|
The withdrawal builder simulates open to determine the exact payout slots after fees and
|
|
128
144
|
rounding. Rebuild if vault state changes before sending. Shares burned can be clamped to the
|
|
129
|
-
liquid holdings; tokens invested in obligations are not withdrawn by this flow.
|
|
145
|
+
liquid holdings; tokens invested in obligations are not withdrawn by this flow. The open is refused
|
|
146
|
+
while a vault obligation is liquidatable. A withdraw order's settle does not wait for the vault's
|
|
147
|
+
own rebalance; a deposit order's settle waits for it and for every vault obligation to be healthy.
|
|
130
148
|
|
|
131
149
|
Each enabled token adds four accounts to both order instructions, so past about five tokens the
|
|
132
150
|
transaction only fits the 1232-byte limit when compiled against an address lookup table. Both
|
|
@@ -182,8 +200,8 @@ const cancelled = await client.cancelDepositOrderIx(user, vaultAddress, opened.o
|
|
|
182
200
|
```
|
|
183
201
|
|
|
184
202
|
`openWithdrawOrderIx` takes `sharesAmount`, `weights`, and `minTokensOut`, plus the same auction
|
|
185
|
-
settings. Opening burns shares and locks a pro-rata slice of the liquid basket.
|
|
186
|
-
`
|
|
203
|
+
settings. Opening burns shares and locks a pro-rata slice of the liquid basket. The server
|
|
204
|
+
builder `getOpenWithdrawOrderPreview` simulates the exact released amounts. Fill with
|
|
187
205
|
`{ kind: "withdraw", address: opened.order }` and finish with `settleWithdrawOrderIx`.
|
|
188
206
|
The owner may settle at any time; a keeper may settle after the auction ends. Payouts and rent
|
|
189
207
|
always go to the order owner. Orders close on settlement or deposit cancellation.
|
|
@@ -202,18 +220,22 @@ creates and thaws permissioned shares accounts through the vault's gate.
|
|
|
202
220
|
|
|
203
221
|
### Quote before signing
|
|
204
222
|
|
|
205
|
-
`
|
|
206
|
-
the program emits, so they account for fee accrual, price, and the clamping
|
|
207
|
-
internally.
|
|
208
|
-
an account that could really make the deposit, since the simulation
|
|
223
|
+
The server builders `getBuyPreview` and `getSellPreview` simulate the real instruction and read the
|
|
224
|
+
result out of the event the program emits, so they account for fee accrual, price, and the clamping
|
|
225
|
+
the program applies internally. The signer may be a no-op signer — simulation does not verify
|
|
226
|
+
signatures — but it must be an account that could really make the deposit, since the simulation
|
|
227
|
+
runs the token transfer.
|
|
209
228
|
|
|
210
229
|
```typescript
|
|
211
|
-
|
|
212
|
-
console.log(`${quote.tokensInUi} in -> ${quote.sharesOutUi} shares`);
|
|
230
|
+
import { getBuyPreview } from "@kamino-finance/metavault-sdk/dist/server";
|
|
213
231
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
232
|
+
const quote = await getBuyPreview({
|
|
233
|
+
...context,
|
|
234
|
+
vault: { address: vaultAddress, state: vaultState },
|
|
235
|
+
mint: tokenMint,
|
|
236
|
+
maxAmount: new Decimal("1"),
|
|
237
|
+
});
|
|
238
|
+
console.log(`${quote.tokensIn} in -> ${quote.sharesOut} shares`);
|
|
217
239
|
```
|
|
218
240
|
|
|
219
241
|
A failing quote throws `SimulationFailedError` carrying the decoded program error, which is the
|
|
@@ -231,8 +253,10 @@ const position = await client.getUserPosition(vaultAddress, owner, aumUsd);
|
|
|
231
253
|
|
|
232
254
|
### Preflight a deposit or withdrawal
|
|
233
255
|
|
|
234
|
-
Checks the
|
|
235
|
-
anything. Prices come from the scope feeds the vault is
|
|
256
|
+
Checks the vault-level and per-token conditions that make an operation fail, in the order the
|
|
257
|
+
program checks them, without sending anything. Prices come from the scope feeds the vault is
|
|
258
|
+
configured against. A vault that registers klend obligations also needs their health:
|
|
259
|
+
`fetchObligationHealth` simulates the klend refresh the vault's transactions run first.
|
|
236
260
|
|
|
237
261
|
```typescript
|
|
238
262
|
import {
|
|
@@ -241,16 +265,25 @@ import {
|
|
|
241
265
|
resolveScopeChainPrice,
|
|
242
266
|
} from "@kamino-finance/metavault-sdk";
|
|
243
267
|
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
268
|
+
const vault = await MetaVault.load(client, vaultAddress);
|
|
269
|
+
const obligations = await vault.fetchObligationHealth(owner); // [] without obligations
|
|
270
|
+
const limits = await vault.getDepositLimits(tokenMint, {
|
|
271
|
+
nowSeconds,
|
|
272
|
+
prices,
|
|
273
|
+
netAumUsd: aumUsd,
|
|
274
|
+
obligations,
|
|
275
|
+
});
|
|
247
276
|
|
|
248
277
|
if (limits.blockedBy !== null) {
|
|
249
|
-
// "emergencyMode" | "depositsBlocked" | "
|
|
278
|
+
// "emergencyMode" | "depositsBlocked" | "obligationLiquidatable" | "rebalanceInProgress" |
|
|
279
|
+
// "singleSidedFlowDisabled" | "depositCapReached" | "rollingCapExhausted" | ...
|
|
250
280
|
}
|
|
251
281
|
// `maxDepositLamports` is null when nothing binds; `limitedBy` names the constraint that did.
|
|
252
282
|
```
|
|
253
283
|
|
|
284
|
+
`getOrderStatus(order, vaultState, { tokens, nowSeconds, obligations })` does the same for an
|
|
285
|
+
order: whether its auction is over and who may settle it now.
|
|
286
|
+
|
|
254
287
|
### Fee-wrapped vaults
|
|
255
288
|
|
|
256
289
|
A fee-wrapped vault's only token with a non-zero target weight is a Kamino Vault (kvault) share
|
|
@@ -277,43 +310,81 @@ A server holding kvault states already builds the lookup with `ktokenVaultFromSt
|
|
|
277
310
|
`getWithdrawLimits` in the underlying token.
|
|
278
311
|
|
|
279
312
|
Users can also deposit and withdraw the kvault's underlying token. The kvault program's own
|
|
280
|
-
deposit and withdraw then run in the same transaction as `buy` and `sell`.
|
|
281
|
-
|
|
313
|
+
deposit and withdraw then run in the same transaction as `buy` and `sell`. `getBuyIxs` and
|
|
314
|
+
`getSellIxs` do this when given the kvaults the caller caches and the underlying's mint, and refuse
|
|
315
|
+
a composed transaction that would not fit:
|
|
282
316
|
|
|
283
317
|
```typescript
|
|
284
|
-
import {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
client,
|
|
293
|
-
user,
|
|
294
|
-
vaultState: vaultAddress,
|
|
295
|
-
wrapping,
|
|
296
|
-
kvault,
|
|
297
|
-
underlyingAmount,
|
|
298
|
-
minSharesOut,
|
|
318
|
+
import { getSellIxs } from "@kamino-finance/metavault-sdk/dist/server";
|
|
319
|
+
|
|
320
|
+
const sell = await getSellIxs({
|
|
321
|
+
...context,
|
|
322
|
+
vault: { address: vaultAddress, state: vaultState },
|
|
323
|
+
mint: underlyingMint,
|
|
324
|
+
sharesAmount: new Decimal("10"),
|
|
325
|
+
minTokensOut: new Decimal("9.9"),
|
|
326
|
+
kvaults: { client: kvaultClient, vaultsBySharesMint, reserves, lookupTables },
|
|
299
327
|
});
|
|
300
|
-
//
|
|
328
|
+
// Throws InsufficientKvaultLiquidityError, with `maxUnderlyingOut`, when the kvault is short,
|
|
329
|
+
// KvaultWithdrawBelowMinimumError when a kvault withdraw instruction would pay out too little,
|
|
330
|
+
// and UnderlyingWithdrawTooLargeError, with the most a sell that fits pays, when it does not fit.
|
|
331
|
+
```
|
|
301
332
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
333
|
+
The lower-level `getFeeWrappedDepositIxs` and `getFeeWrappedWithdrawIxs` take base units and a
|
|
334
|
+
`KvaultContext`. `getSeedKtokenIxs` returns the kvault deposit to send before `init_vault` when a
|
|
335
|
+
new vault's first token is a Ktoken and the admin holds less than the $1 seed: one whole Ktoken at
|
|
336
|
+
the fixed 1.0 price.
|
|
337
|
+
|
|
338
|
+
### Server builders
|
|
339
|
+
|
|
340
|
+
`@kamino-finance/metavault-sdk/dist/server` builds every transaction a server hands out with one
|
|
341
|
+
call: kamino-tx-api is a thin HTTP wrapper over it ([ADR 0001](docs/adr/0001-server-builders.md)).
|
|
342
|
+
Each builder takes the caller's client and wallet, the lookup tables it caches, and the request in
|
|
343
|
+
whole tokens; it returns the instructions in send order, without compute budget instructions, and
|
|
344
|
+
the lookup tables to compile them with.
|
|
345
|
+
|
|
346
|
+
```typescript
|
|
347
|
+
import { getBuyIxs } from "@kamino-finance/metavault-sdk/dist/server";
|
|
348
|
+
|
|
349
|
+
const context = {
|
|
350
|
+
client, // MetaVaultClient
|
|
351
|
+
signer: createNoopSigner(wallet), // a no-op signer builds unsigned transactions
|
|
352
|
+
lookupTableContents: { [vaultState.vaultLookupTable]: vaultTableAddresses }, // or {}
|
|
353
|
+
extendLookupTables, // optional: more tables for the accounts these miss
|
|
354
|
+
};
|
|
355
|
+
const buy = await getBuyIxs({
|
|
356
|
+
...context,
|
|
357
|
+
vault: { address: vaultAddress, state: vaultState },
|
|
358
|
+
mint: tokenMint,
|
|
359
|
+
maxAmount: new Decimal("100"),
|
|
360
|
+
minSharesOut: new Decimal("99"),
|
|
361
|
+
memo: "order-123",
|
|
312
362
|
});
|
|
363
|
+
// buy.instructions, compiled against buy.lookupTables.
|
|
313
364
|
```
|
|
314
365
|
|
|
315
|
-
|
|
316
|
-
|
|
366
|
+
They hold the business rules: wSOL wrapping and unwrapping, memos, order slots, fee-wrapped
|
|
367
|
+
composition and sizing, previews, config encoding from a request's JSON shape
|
|
368
|
+
(`getUpdateVaultConfigIxs`), the leverage step and estimate with their phase JSON codec. What they
|
|
369
|
+
refuse throws a class under `MetavaultSdkError`, from the main entry, carrying the request's fields
|
|
370
|
+
(`TokenNotEnabledError`, `ZeroAmountError`, `NotOrderOwnerError`, ...); anything else that throws is
|
|
371
|
+
the RPC or the SDK, not the request. Each refusal also has a stable `code` from
|
|
372
|
+
`METAVAULT_SDK_ERROR_CODES` (`"TOKEN_NOT_ENABLED"`, ...) and `details`, the JSON fields a client acts
|
|
373
|
+
on (`maxTokensOut` on a sell the kvault cannot pay in full, `programError` on a failed simulation),
|
|
374
|
+
so a server can answer every refusal the same way:
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
if (error instanceof MetavaultSdkError) {
|
|
378
|
+
return reply.code(400).send({ code: error.code, message: error.message, ...error.details });
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Two helpers cover what a server resolves before it calls a builder:
|
|
383
|
+
|
|
384
|
+
- `fetchMetavaultAccount(rpc, programId, address)` (main entry) reads an address and tells a vault, a
|
|
385
|
+
deposit order and a withdraw order apart, or answers `undefined`.
|
|
386
|
+
- `VAULT_CONFIG_FIELDS` (server entry) lists the config fields of each change shape, so a request
|
|
387
|
+
schema for `getUpdateVaultConfigIxs` can be built from it and stays in step with the program.
|
|
317
388
|
|
|
318
389
|
### Decode failures and events
|
|
319
390
|
|
|
@@ -411,10 +482,12 @@ new MetaVaultClient(rpc: Rpc<SolanaRpcApi>, programId?: Address)
|
|
|
411
482
|
|
|
412
483
|
#### Account loaders
|
|
413
484
|
|
|
414
|
-
| Method
|
|
415
|
-
|
|
|
416
|
-
| `fetchVaultState(address)`
|
|
417
|
-
| `fetchGlobalConfig()`
|
|
485
|
+
| Method | Description |
|
|
486
|
+
| ------------------------------------------ | -------------------------------------------------------------------- |
|
|
487
|
+
| `fetchVaultState(address)` | Fetch and decode a vault's on-chain state |
|
|
488
|
+
| `fetchGlobalConfig()` | Fetch the protocol's global configuration |
|
|
489
|
+
| `fetchObligationHealth(address, feePayer)` | Klend health of every registered obligation, refreshed in simulation |
|
|
490
|
+
| `fetchSeedDeposit({ mint, scope })` | What `init_vault` takes from the admin at the feed's current price |
|
|
418
491
|
|
|
419
492
|
#### Buy / Sell
|
|
420
493
|
|
|
@@ -460,10 +533,12 @@ key held in the global config's `KrfqSwapAuthority`. Pass that signer as `krfqAu
|
|
|
460
533
|
the SDK also attaches the fill's `krfqFillMarker` (`krfqFillMarkerPda(vault, tokenIn,
|
|
461
534
|
tokenOut)`), which binds the co-signature to this vault and this ordered mint pair. For an order fill, the marker is derived from the **order address** instead of the vault.
|
|
462
535
|
|
|
463
|
-
The program ends a rebalance during `refreshVaultIx` or a fill
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
536
|
+
The program ends a rebalance during `refreshVaultIx` or a fill once it is over: past its window,
|
|
537
|
+
unable to progress, or with its booked losses past its loss ceiling. Freezing the vault ends it
|
|
538
|
+
too, and `startRebalanceIx` is refused in emergency mode, which also suspends the allocation
|
|
539
|
+
delegate. While the vault's own rebalance is in progress, buys, sells, order fills and
|
|
540
|
+
deposit-order settles wait for it; withdraw-order settles do not, as they pay out only what the
|
|
541
|
+
order locks. Swap output is an exact requested amount.
|
|
467
542
|
|
|
468
543
|
#### Vault refresh / valuation
|
|
469
544
|
|
|
@@ -478,14 +553,12 @@ previous minimum-output interpretation.
|
|
|
478
553
|
These simulate rather than send, so they need an address but never a key. `payer` and `user`
|
|
479
554
|
must be existing, funded, system-owned accounts.
|
|
480
555
|
|
|
481
|
-
| Method
|
|
482
|
-
|
|
|
483
|
-
| `getAum(vault, payer)`
|
|
484
|
-
| `getExchangeRate(vault, mint, payer)`
|
|
485
|
-
| `getSharePrice(vault, payer)`
|
|
486
|
-
| `
|
|
487
|
-
| `previewSell(user, vault, mint, sharesAmount)` | Exact tokens out and shares burned for a withdrawal |
|
|
488
|
-
| `getUserPosition(vault, owner, aumUsd?)` | A holder's shares, freeze state and USD value |
|
|
556
|
+
| Method | Description |
|
|
557
|
+
| ---------------------------------------- | ------------------------------------------------------ |
|
|
558
|
+
| `getAum(vault, payer)` | Vault AUM in USD, from the `aum` view |
|
|
559
|
+
| `getExchangeRate(vault, mint, payer)` | Net withdraw rate for one whole share |
|
|
560
|
+
| `getSharePrice(vault, payer)` | USD value of one whole share, or `null` if none issued |
|
|
561
|
+
| `getUserPosition(vault, owner, aumUsd?)` | A holder's shares, freeze state and USD value |
|
|
489
562
|
|
|
490
563
|
#### Query helpers
|
|
491
564
|
|
|
@@ -13,19 +13,17 @@ export interface MetavaultStateFields {
|
|
|
13
13
|
obligations: Array<types.VaultObligationFields>;
|
|
14
14
|
sharesIssued: bigint;
|
|
15
15
|
alignmentPadding3: Array<number>;
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Retired AUM-snapshot slot, retained to preserve the account layout. Live vaults still
|
|
18
|
+
* hold the last value written, so it is not zero.
|
|
19
|
+
*/
|
|
20
|
+
retiredPadding2: bigint;
|
|
17
21
|
pendingFeesSf: bigint;
|
|
18
22
|
lastFeeChargeTimestamp: bigint;
|
|
19
23
|
alignmentPadding4: Array<number>;
|
|
20
24
|
/**
|
|
21
|
-
* Retired slot,
|
|
22
|
-
* the
|
|
23
|
-
*
|
|
24
|
-
* It summed `new_aum - prev_aum` across fee charges under the name "cumulative earned
|
|
25
|
-
* interest", but it measured neither: the subtraction saturated at zero so drawdowns were
|
|
26
|
-
* dropped, `new_aum` is a Scope valuation so token price moves counted as interest, and
|
|
27
|
-
* every value-moving operation rebased `prev_aum` to its own post-operation AUM, hiding
|
|
28
|
-
* whatever that operation created or destroyed. Nothing on-chain read it.
|
|
25
|
+
* Retired cumulative-interest slot, retained to preserve the account layout. Live vaults
|
|
26
|
+
* still hold the last value written, so it is not zero.
|
|
29
27
|
*/
|
|
30
28
|
retiredPadding1: bigint;
|
|
31
29
|
cumulativeMgmtFeesSf: bigint;
|
|
@@ -83,8 +81,8 @@ export interface MetavaultStateFields {
|
|
|
83
81
|
allocationAdminAuthority: Address;
|
|
84
82
|
/**
|
|
85
83
|
* [`SharePrice`] bits at the last eligible performance-fee charge. Zero means
|
|
86
|
-
* not yet seeded.
|
|
87
|
-
*
|
|
84
|
+
* not yet seeded. Capital flows trade at the current share price; fee mints, fee waivers,
|
|
85
|
+
* deposit fees and configuration changes adjust the checkpoint to preserve its fee basis.
|
|
88
86
|
*/
|
|
89
87
|
lastPerfFeePriceSf: bigint;
|
|
90
88
|
/**
|
|
@@ -114,7 +112,14 @@ export interface MetavaultStateFields {
|
|
|
114
112
|
withdrawOrderCreationEnabled: number;
|
|
115
113
|
/** Allows fills against withdraw orders (never gates the vault's own rebalance fills). */
|
|
116
114
|
withdrawOrderFillEnabled: number;
|
|
117
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Lets fills against orders of either kind run while the vault's own rebalance is in progress
|
|
117
|
+
* (they move only the orders' locked amounts, never the vault's own basket). Off, they wait
|
|
118
|
+
* for it, so the vault's auction is the only one filled in its window. The kind's own fill
|
|
119
|
+
* switch still applies; a deposit order's settle waits for the rebalance either way.
|
|
120
|
+
*/
|
|
121
|
+
orderFillDuringRebalanceEnabled: number;
|
|
122
|
+
alignmentPadding10: Array<number>;
|
|
118
123
|
trailingPadding: Array<bigint>;
|
|
119
124
|
}
|
|
120
125
|
export interface MetavaultStateJSON {
|
|
@@ -129,19 +134,17 @@ export interface MetavaultStateJSON {
|
|
|
129
134
|
obligations: Array<types.VaultObligationJSON>;
|
|
130
135
|
sharesIssued: string;
|
|
131
136
|
alignmentPadding3: Array<number>;
|
|
132
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Retired AUM-snapshot slot, retained to preserve the account layout. Live vaults still
|
|
139
|
+
* hold the last value written, so it is not zero.
|
|
140
|
+
*/
|
|
141
|
+
retiredPadding2: string;
|
|
133
142
|
pendingFeesSf: string;
|
|
134
143
|
lastFeeChargeTimestamp: string;
|
|
135
144
|
alignmentPadding4: Array<number>;
|
|
136
145
|
/**
|
|
137
|
-
* Retired slot,
|
|
138
|
-
* the
|
|
139
|
-
*
|
|
140
|
-
* It summed `new_aum - prev_aum` across fee charges under the name "cumulative earned
|
|
141
|
-
* interest", but it measured neither: the subtraction saturated at zero so drawdowns were
|
|
142
|
-
* dropped, `new_aum` is a Scope valuation so token price moves counted as interest, and
|
|
143
|
-
* every value-moving operation rebased `prev_aum` to its own post-operation AUM, hiding
|
|
144
|
-
* whatever that operation created or destroyed. Nothing on-chain read it.
|
|
146
|
+
* Retired cumulative-interest slot, retained to preserve the account layout. Live vaults
|
|
147
|
+
* still hold the last value written, so it is not zero.
|
|
145
148
|
*/
|
|
146
149
|
retiredPadding1: string;
|
|
147
150
|
cumulativeMgmtFeesSf: string;
|
|
@@ -199,8 +202,8 @@ export interface MetavaultStateJSON {
|
|
|
199
202
|
allocationAdminAuthority: string;
|
|
200
203
|
/**
|
|
201
204
|
* [`SharePrice`] bits at the last eligible performance-fee charge. Zero means
|
|
202
|
-
* not yet seeded.
|
|
203
|
-
*
|
|
205
|
+
* not yet seeded. Capital flows trade at the current share price; fee mints, fee waivers,
|
|
206
|
+
* deposit fees and configuration changes adjust the checkpoint to preserve its fee basis.
|
|
204
207
|
*/
|
|
205
208
|
lastPerfFeePriceSf: string;
|
|
206
209
|
/**
|
|
@@ -230,7 +233,14 @@ export interface MetavaultStateJSON {
|
|
|
230
233
|
withdrawOrderCreationEnabled: number;
|
|
231
234
|
/** Allows fills against withdraw orders (never gates the vault's own rebalance fills). */
|
|
232
235
|
withdrawOrderFillEnabled: number;
|
|
233
|
-
|
|
236
|
+
/**
|
|
237
|
+
* Lets fills against orders of either kind run while the vault's own rebalance is in progress
|
|
238
|
+
* (they move only the orders' locked amounts, never the vault's own basket). Off, they wait
|
|
239
|
+
* for it, so the vault's auction is the only one filled in its window. The kind's own fill
|
|
240
|
+
* switch still applies; a deposit order's settle waits for the rebalance either way.
|
|
241
|
+
*/
|
|
242
|
+
orderFillDuringRebalanceEnabled: number;
|
|
243
|
+
alignmentPadding10: Array<number>;
|
|
234
244
|
trailingPadding: Array<string>;
|
|
235
245
|
}
|
|
236
246
|
export declare class MetavaultState {
|
|
@@ -245,19 +255,17 @@ export declare class MetavaultState {
|
|
|
245
255
|
readonly obligations: Array<types.VaultObligation>;
|
|
246
256
|
readonly sharesIssued: bigint;
|
|
247
257
|
readonly alignmentPadding3: Array<number>;
|
|
248
|
-
|
|
258
|
+
/**
|
|
259
|
+
* Retired AUM-snapshot slot, retained to preserve the account layout. Live vaults still
|
|
260
|
+
* hold the last value written, so it is not zero.
|
|
261
|
+
*/
|
|
262
|
+
readonly retiredPadding2: bigint;
|
|
249
263
|
readonly pendingFeesSf: bigint;
|
|
250
264
|
readonly lastFeeChargeTimestamp: bigint;
|
|
251
265
|
readonly alignmentPadding4: Array<number>;
|
|
252
266
|
/**
|
|
253
|
-
* Retired slot,
|
|
254
|
-
* the
|
|
255
|
-
*
|
|
256
|
-
* It summed `new_aum - prev_aum` across fee charges under the name "cumulative earned
|
|
257
|
-
* interest", but it measured neither: the subtraction saturated at zero so drawdowns were
|
|
258
|
-
* dropped, `new_aum` is a Scope valuation so token price moves counted as interest, and
|
|
259
|
-
* every value-moving operation rebased `prev_aum` to its own post-operation AUM, hiding
|
|
260
|
-
* whatever that operation created or destroyed. Nothing on-chain read it.
|
|
267
|
+
* Retired cumulative-interest slot, retained to preserve the account layout. Live vaults
|
|
268
|
+
* still hold the last value written, so it is not zero.
|
|
261
269
|
*/
|
|
262
270
|
readonly retiredPadding1: bigint;
|
|
263
271
|
readonly cumulativeMgmtFeesSf: bigint;
|
|
@@ -315,8 +323,8 @@ export declare class MetavaultState {
|
|
|
315
323
|
readonly allocationAdminAuthority: Address;
|
|
316
324
|
/**
|
|
317
325
|
* [`SharePrice`] bits at the last eligible performance-fee charge. Zero means
|
|
318
|
-
* not yet seeded.
|
|
319
|
-
*
|
|
326
|
+
* not yet seeded. Capital flows trade at the current share price; fee mints, fee waivers,
|
|
327
|
+
* deposit fees and configuration changes adjust the checkpoint to preserve its fee basis.
|
|
320
328
|
*/
|
|
321
329
|
readonly lastPerfFeePriceSf: bigint;
|
|
322
330
|
/**
|
|
@@ -346,7 +354,14 @@ export declare class MetavaultState {
|
|
|
346
354
|
readonly withdrawOrderCreationEnabled: number;
|
|
347
355
|
/** Allows fills against withdraw orders (never gates the vault's own rebalance fills). */
|
|
348
356
|
readonly withdrawOrderFillEnabled: number;
|
|
349
|
-
|
|
357
|
+
/**
|
|
358
|
+
* Lets fills against orders of either kind run while the vault's own rebalance is in progress
|
|
359
|
+
* (they move only the orders' locked amounts, never the vault's own basket). Off, they wait
|
|
360
|
+
* for it, so the vault's auction is the only one filled in its window. The kind's own fill
|
|
361
|
+
* switch still applies; a deposit order's settle waits for the rebalance either way.
|
|
362
|
+
*/
|
|
363
|
+
readonly orderFillDuringRebalanceEnabled: number;
|
|
364
|
+
readonly alignmentPadding10: Array<number>;
|
|
350
365
|
readonly trailingPadding: Array<bigint>;
|
|
351
366
|
static readonly discriminator: Uint8Array<ArrayBuffer>;
|
|
352
367
|
static readonly layout: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetavaultState.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/metavault/accounts/MetavaultState.ts"],"names":[],"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