@elmntl/jlpd-sdk 0.2.0 → 0.13.4
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/LICENSE +201 -0
- package/README.md +185 -404
- package/dist/common/ata.d.ts +26 -0
- package/dist/common/ata.js +48 -0
- package/dist/common/buffer.d.ts +15 -0
- package/dist/common/buffer.js +118 -0
- package/dist/common/connection.d.ts +13 -0
- package/dist/common/connection.js +2 -0
- package/dist/common/constants.d.ts +14 -0
- package/dist/common/constants.js +31 -0
- package/dist/common/index.d.ts +6 -0
- package/dist/common/index.js +28 -0
- package/dist/common/strategy-interface.d.ts +59 -0
- package/dist/common/strategy-interface.js +42 -0
- package/dist/elemental-lend/accounts.d.ts +103 -0
- package/dist/elemental-lend/accounts.js +354 -0
- package/dist/elemental-lend/constants.d.ts +25 -0
- package/dist/elemental-lend/constants.js +48 -0
- package/dist/elemental-lend/index.d.ts +8 -0
- package/dist/elemental-lend/index.js +24 -0
- package/dist/elemental-lend/instructions.d.ts +104 -0
- package/dist/elemental-lend/instructions.js +266 -0
- package/dist/elemental-lend/jupiter-lend.d.ts +91 -0
- package/dist/elemental-lend/jupiter-lend.js +189 -0
- package/dist/elemental-lend/kamino-vault.d.ts +173 -0
- package/dist/elemental-lend/kamino-vault.js +483 -0
- package/dist/elemental-lend/pda.d.ts +12 -0
- package/dist/elemental-lend/pda.js +24 -0
- package/dist/elemental-lend/protocol-actions.d.ts +56 -0
- package/dist/elemental-lend/protocol-actions.js +244 -0
- package/dist/elemental-lend/types.d.ts +113 -0
- package/dist/elemental-lend/types.js +2 -0
- package/dist/elemental-lend-v2/accounts.d.ts +14 -0
- package/dist/elemental-lend-v2/accounts.js +136 -0
- package/dist/elemental-lend-v2/adapters.d.ts +22 -0
- package/dist/elemental-lend-v2/adapters.js +50 -0
- package/dist/elemental-lend-v2/constants.d.ts +48 -0
- package/dist/elemental-lend-v2/constants.js +104 -0
- package/dist/elemental-lend-v2/index.d.ts +8 -0
- package/dist/elemental-lend-v2/index.js +24 -0
- package/dist/elemental-lend-v2/instructions.d.ts +96 -0
- package/dist/elemental-lend-v2/instructions.js +190 -0
- package/dist/elemental-lend-v2/lut.d.ts +20 -0
- package/dist/elemental-lend-v2/lut.js +65 -0
- package/dist/elemental-lend-v2/pda.d.ts +9 -0
- package/dist/elemental-lend-v2/pda.js +27 -0
- package/dist/elemental-lend-v2/types.d.ts +105 -0
- package/dist/elemental-lend-v2/types.js +2 -0
- package/dist/elemental-lend-v2/update-aum.d.ts +29 -0
- package/dist/elemental-lend-v2/update-aum.js +82 -0
- package/dist/index.d.ts +5 -4199
- package/dist/index.js +37 -5187
- package/dist/jlpd-strategy/accounts.d.ts +83 -0
- package/dist/jlpd-strategy/accounts.js +216 -0
- package/dist/jlpd-strategy/adapter.d.ts +81 -0
- package/dist/jlpd-strategy/adapter.js +118 -0
- package/dist/jlpd-strategy/base-to-base-swap.d.ts +74 -0
- package/dist/jlpd-strategy/base-to-base-swap.js +205 -0
- package/dist/jlpd-strategy/constants.d.ts +127 -0
- package/dist/jlpd-strategy/constants.js +174 -0
- package/dist/jlpd-strategy/fluid-view.d.ts +199 -0
- package/dist/jlpd-strategy/fluid-view.js +799 -0
- package/dist/jlpd-strategy/hedge-derived.d.ts +135 -0
- package/dist/jlpd-strategy/hedge-derived.js +231 -0
- package/dist/jlpd-strategy/hedge-instructions.d.ts +210 -0
- package/dist/jlpd-strategy/hedge-instructions.js +300 -0
- package/dist/jlpd-strategy/hedge-state.d.ts +88 -0
- package/dist/jlpd-strategy/hedge-state.js +110 -0
- package/dist/jlpd-strategy/index.d.ts +17 -0
- package/dist/jlpd-strategy/index.js +33 -0
- package/dist/jlpd-strategy/instructions.d.ts +159 -0
- package/dist/jlpd-strategy/instructions.js +234 -0
- package/dist/jlpd-strategy/jlp-borrow.d.ts +63 -0
- package/dist/jlpd-strategy/jlp-borrow.js +87 -0
- package/dist/jlpd-strategy/jlp-data.d.ts +166 -0
- package/dist/jlpd-strategy/jlp-data.js +611 -0
- package/dist/jlpd-strategy/jupusd-earn.d.ts +90 -0
- package/dist/jlpd-strategy/jupusd-earn.js +166 -0
- package/dist/jlpd-strategy/live-jlp-price.d.ts +46 -0
- package/dist/jlpd-strategy/live-jlp-price.js +267 -0
- package/dist/jlpd-strategy/pda.d.ts +13 -0
- package/dist/jlpd-strategy/pda.js +28 -0
- package/dist/jlpd-strategy/settle-yield.d.ts +45 -0
- package/dist/jlpd-strategy/settle-yield.js +113 -0
- package/dist/jlpd-strategy/swap-jlp.d.ts +198 -0
- package/dist/jlpd-strategy/swap-jlp.js +586 -0
- package/dist/jlpd-strategy/types.d.ts +101 -0
- package/dist/jlpd-strategy/types.js +29 -0
- package/dist/p-stv-core/accounts.d.ts +152 -0
- package/dist/p-stv-core/accounts.js +407 -0
- package/dist/p-stv-core/constants.d.ts +138 -0
- package/dist/p-stv-core/constants.js +181 -0
- package/dist/p-stv-core/events.d.ts +7 -0
- package/dist/p-stv-core/events.js +246 -0
- package/dist/p-stv-core/index.d.ts +11 -0
- package/dist/p-stv-core/index.js +27 -0
- package/dist/p-stv-core/instructions.d.ts +637 -0
- package/dist/p-stv-core/instructions.js +670 -0
- package/dist/p-stv-core/lut.d.ts +41 -0
- package/dist/p-stv-core/lut.js +81 -0
- package/dist/p-stv-core/pda.d.ts +30 -0
- package/dist/p-stv-core/pda.js +65 -0
- package/dist/p-stv-core/prices.d.ts +20 -0
- package/dist/p-stv-core/prices.js +77 -0
- package/dist/p-stv-core/remaining-accounts.d.ts +107 -0
- package/dist/p-stv-core/remaining-accounts.js +326 -0
- package/dist/p-stv-core/send-tx.d.ts +72 -0
- package/dist/p-stv-core/send-tx.js +290 -0
- package/dist/p-stv-core/sol-wrap.d.ts +34 -0
- package/dist/p-stv-core/sol-wrap.js +74 -0
- package/dist/p-stv-core/types.d.ts +361 -0
- package/dist/p-stv-core/types.js +2 -0
- package/package.json +56 -15
- package/dist/index.d.mts +0 -4199
- package/dist/index.mjs +0 -5090
package/dist/index.d.mts
DELETED
|
@@ -1,4199 +0,0 @@
|
|
|
1
|
-
import { PublicKey, AddressLookupTableAccount, Connection, VersionedTransaction, TransactionInstruction } from '@solana/web3.js';
|
|
2
|
-
import { BN, Program } from '@coral-xyz/anchor';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
6
|
-
*
|
|
7
|
-
* Note that this is only a type helper and is not the actual IDL. The original
|
|
8
|
-
* IDL can be found at `target/idl/jlp_d_program.json`.
|
|
9
|
-
*/
|
|
10
|
-
type JlpDProgram = {
|
|
11
|
-
"address": "ELEM2bAobpZNuysfhyF28XGVjA1aTUwm6rPYyv1JX3oq";
|
|
12
|
-
"metadata": {
|
|
13
|
-
"name": "jlpDProgram";
|
|
14
|
-
"version": "0.1.0";
|
|
15
|
-
"spec": "0.1.0";
|
|
16
|
-
"description": "Created with Anchor";
|
|
17
|
-
};
|
|
18
|
-
"instructions": [
|
|
19
|
-
{
|
|
20
|
-
"name": "claimFees";
|
|
21
|
-
"discriminator": [
|
|
22
|
-
82,
|
|
23
|
-
251,
|
|
24
|
-
233,
|
|
25
|
-
156,
|
|
26
|
-
12,
|
|
27
|
-
52,
|
|
28
|
-
184,
|
|
29
|
-
202
|
|
30
|
-
];
|
|
31
|
-
"accounts": [
|
|
32
|
-
{
|
|
33
|
-
"name": "manager";
|
|
34
|
-
"docs": [
|
|
35
|
-
"Manager claiming fees on behalf of fee_receiver"
|
|
36
|
-
];
|
|
37
|
-
"signer": true;
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "jlpVault";
|
|
41
|
-
"docs": [
|
|
42
|
-
"The JLP Vault PDA account",
|
|
43
|
-
"Note: PDA verified in handler via get_pda() to avoid multiple loads"
|
|
44
|
-
];
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "stv";
|
|
48
|
-
"docs": [
|
|
49
|
-
"The STV PDA account",
|
|
50
|
-
"Note: PDA verified in handler via get_pda() to avoid multiple loads"
|
|
51
|
-
];
|
|
52
|
-
"writable": true;
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "baseMint";
|
|
56
|
-
"docs": [
|
|
57
|
-
"Base asset mint"
|
|
58
|
-
];
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"name": "jlMint";
|
|
62
|
-
"docs": [
|
|
63
|
-
"jlX mint (Jupiter Lend token) - for decimals in transfer_checked"
|
|
64
|
-
];
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "jvMint";
|
|
68
|
-
"docs": [
|
|
69
|
-
"jvX mint (vault share token) - for supply reading in crystallization"
|
|
70
|
-
];
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"name": "stvBaseAta";
|
|
74
|
-
"docs": [
|
|
75
|
-
"STV's base ATA (for NAV calculation)"
|
|
76
|
-
];
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "stvJlxAta";
|
|
80
|
-
"docs": [
|
|
81
|
-
"STV's jlX ATA (source for fee transfer)"
|
|
82
|
-
];
|
|
83
|
-
"writable": true;
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "feeReceiverJlxAta";
|
|
87
|
-
"docs": [
|
|
88
|
-
"Fee receiver's jlX ATA (destination for fees)"
|
|
89
|
-
];
|
|
90
|
-
"writable": true;
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"name": "tokenProgram";
|
|
94
|
-
"docs": [
|
|
95
|
-
"Token program"
|
|
96
|
-
];
|
|
97
|
-
}
|
|
98
|
-
];
|
|
99
|
-
"args": [];
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"name": "claimWithdraw";
|
|
103
|
-
"docs": [
|
|
104
|
-
"Claim processed withdrawal (epoch-based delayed withdrawal)",
|
|
105
|
-
"",
|
|
106
|
-
"# Flow",
|
|
107
|
-
"1. Verify request is processed (pps > 0) and claim period reached",
|
|
108
|
-
"2. Transfer base from STV to user",
|
|
109
|
-
"3. Close request's jvX ATA and WithdrawRequest PDA (rent to user)"
|
|
110
|
-
];
|
|
111
|
-
"discriminator": [
|
|
112
|
-
232,
|
|
113
|
-
89,
|
|
114
|
-
154,
|
|
115
|
-
117,
|
|
116
|
-
16,
|
|
117
|
-
204,
|
|
118
|
-
182,
|
|
119
|
-
224
|
|
120
|
-
];
|
|
121
|
-
"accounts": [
|
|
122
|
-
{
|
|
123
|
-
"name": "user";
|
|
124
|
-
"docs": [
|
|
125
|
-
"User claiming their withdrawal"
|
|
126
|
-
];
|
|
127
|
-
"writable": true;
|
|
128
|
-
"signer": true;
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"name": "stv";
|
|
132
|
-
"docs": [
|
|
133
|
-
"The STV PDA account (mut for reserved_base update)"
|
|
134
|
-
];
|
|
135
|
-
"writable": true;
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"name": "baseMint";
|
|
139
|
-
"docs": [
|
|
140
|
-
"Base asset mint (for transfer_checked)"
|
|
141
|
-
];
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"name": "jvMint";
|
|
145
|
-
"docs": [
|
|
146
|
-
"jvX mint (for ATA close verification)"
|
|
147
|
-
];
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"name": "userBaseAta";
|
|
151
|
-
"docs": [
|
|
152
|
-
"User's base token destination"
|
|
153
|
-
];
|
|
154
|
-
"writable": true;
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"name": "stvBaseAta";
|
|
158
|
-
"docs": [
|
|
159
|
-
"STV's base ATA (source for base transfer)"
|
|
160
|
-
];
|
|
161
|
-
"writable": true;
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"name": "withdrawRequest";
|
|
165
|
-
"docs": [
|
|
166
|
-
"WithdrawRequest PDA - closed after claim (rent to user)"
|
|
167
|
-
];
|
|
168
|
-
"writable": true;
|
|
169
|
-
"pda": {
|
|
170
|
-
"seeds": [
|
|
171
|
-
{
|
|
172
|
-
"kind": "const";
|
|
173
|
-
"value": [
|
|
174
|
-
119,
|
|
175
|
-
105,
|
|
176
|
-
116,
|
|
177
|
-
104,
|
|
178
|
-
100,
|
|
179
|
-
114,
|
|
180
|
-
97,
|
|
181
|
-
119,
|
|
182
|
-
95,
|
|
183
|
-
114,
|
|
184
|
-
101,
|
|
185
|
-
113,
|
|
186
|
-
117,
|
|
187
|
-
101,
|
|
188
|
-
115,
|
|
189
|
-
116
|
|
190
|
-
];
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"kind": "account";
|
|
194
|
-
"path": "stv";
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"kind": "account";
|
|
198
|
-
"path": "user";
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
"kind": "account";
|
|
202
|
-
"path": "withdraw_request.epoch_id";
|
|
203
|
-
"account": "WithdrawRequest";
|
|
204
|
-
}
|
|
205
|
-
];
|
|
206
|
-
};
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"name": "requestJvxAta";
|
|
210
|
-
"docs": [
|
|
211
|
-
"Empty jvX ATA owned by WithdrawRequest PDA (to close, rent to user)"
|
|
212
|
-
];
|
|
213
|
-
"writable": true;
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"name": "tokenProgram";
|
|
217
|
-
}
|
|
218
|
-
];
|
|
219
|
-
"args": [];
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"name": "deposit";
|
|
223
|
-
"docs": [
|
|
224
|
-
"Deposit base asset into the STV and receive jvX shares",
|
|
225
|
-
"",
|
|
226
|
-
"# Flow",
|
|
227
|
-
"1. Crystallize fees inline (ensures fair PPS)",
|
|
228
|
-
"2. Transfer base asset from user to STV's base ATA",
|
|
229
|
-
"3. Mint jvX shares to user at post-fee PPS",
|
|
230
|
-
"",
|
|
231
|
-
"# Note",
|
|
232
|
-
"For pools with Jupiter Earn support (SOL, USDC), manager can later convert",
|
|
233
|
-
"base to jlX via jup_earn_deposit_withdraw instruction.",
|
|
234
|
-
"For pools without Jupiter Earn (BTC, ETH), base stays in STV's base ATA.",
|
|
235
|
-
"",
|
|
236
|
-
"Remaining accounts (optional, for exchange rate):",
|
|
237
|
-
"[0] = Jupiter Lend lending account",
|
|
238
|
-
"[1] = Jupiter Lend rewards rate model"
|
|
239
|
-
];
|
|
240
|
-
"discriminator": [
|
|
241
|
-
242,
|
|
242
|
-
35,
|
|
243
|
-
198,
|
|
244
|
-
137,
|
|
245
|
-
82,
|
|
246
|
-
225,
|
|
247
|
-
242,
|
|
248
|
-
182
|
|
249
|
-
];
|
|
250
|
-
"accounts": [
|
|
251
|
-
{
|
|
252
|
-
"name": "user";
|
|
253
|
-
"docs": [
|
|
254
|
-
"User performing the deposit"
|
|
255
|
-
];
|
|
256
|
-
"writable": true;
|
|
257
|
-
"signer": true;
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
"name": "jlpVault";
|
|
261
|
-
"docs": [
|
|
262
|
-
"The JLP Vault PDA account",
|
|
263
|
-
"Note: bump verified in handler after load() to avoid multiple loads"
|
|
264
|
-
];
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"name": "stv";
|
|
268
|
-
"docs": [
|
|
269
|
-
"The STV PDA account",
|
|
270
|
-
"Note: uses base_mint account for seeds; bump verified in handler"
|
|
271
|
-
];
|
|
272
|
-
"writable": true;
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"name": "baseMint";
|
|
276
|
-
"docs": [
|
|
277
|
-
"Base asset mint (underlying token: SOL, BTC, ETH, USDC)"
|
|
278
|
-
];
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
"name": "jlMint";
|
|
282
|
-
"docs": [
|
|
283
|
-
"jlX mint (Jupiter Lend token) - used for exchange rate reading"
|
|
284
|
-
];
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"name": "jvMint";
|
|
288
|
-
"docs": [
|
|
289
|
-
"jvX mint (vault share token) - STV is mint authority",
|
|
290
|
-
"Verified against STV.jv_mint in handler"
|
|
291
|
-
];
|
|
292
|
-
"writable": true;
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"name": "userBaseAta";
|
|
296
|
-
"docs": [
|
|
297
|
-
"User's base asset token account (source for deposit)"
|
|
298
|
-
];
|
|
299
|
-
"writable": true;
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
"name": "userJvxAta";
|
|
303
|
-
"docs": [
|
|
304
|
-
"User's jvX token account (destination for shares)"
|
|
305
|
-
];
|
|
306
|
-
"writable": true;
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"name": "stvBaseAta";
|
|
310
|
-
"docs": [
|
|
311
|
-
"STV's base ATA (destination for user's base tokens)"
|
|
312
|
-
];
|
|
313
|
-
"writable": true;
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
"name": "stvJlxAta";
|
|
317
|
-
"docs": [
|
|
318
|
-
"STV's jlX ATA (used for NAV calculation)"
|
|
319
|
-
];
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"name": "tokenProgram";
|
|
323
|
-
"docs": [
|
|
324
|
-
"Token program"
|
|
325
|
-
];
|
|
326
|
-
}
|
|
327
|
-
];
|
|
328
|
-
"args": [
|
|
329
|
-
{
|
|
330
|
-
"name": "amount";
|
|
331
|
-
"type": "u64";
|
|
332
|
-
}
|
|
333
|
-
];
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
"name": "initOrUpdateJlpVault";
|
|
337
|
-
"docs": [
|
|
338
|
-
"Initialize or update the global JLP Vault",
|
|
339
|
-
"Init: Creates vault PDA with admin, jlp_mint, base_asset_mints (immutable after init)",
|
|
340
|
-
"Update: Modifies manager, fee_receiver, and rebalance parameters",
|
|
341
|
-
"Note: ATAs are created externally via script"
|
|
342
|
-
];
|
|
343
|
-
"discriminator": [
|
|
344
|
-
234,
|
|
345
|
-
24,
|
|
346
|
-
218,
|
|
347
|
-
120,
|
|
348
|
-
213,
|
|
349
|
-
149,
|
|
350
|
-
245,
|
|
351
|
-
213
|
|
352
|
-
];
|
|
353
|
-
"accounts": [
|
|
354
|
-
{
|
|
355
|
-
"name": "admin";
|
|
356
|
-
"docs": [
|
|
357
|
-
"Admin who controls the vault"
|
|
358
|
-
];
|
|
359
|
-
"writable": true;
|
|
360
|
-
"signer": true;
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
"name": "jlpVault";
|
|
364
|
-
"docs": [
|
|
365
|
-
"The JLP Vault PDA account (zero-copy)",
|
|
366
|
-
"Uses init_if_needed to support both init and update paths"
|
|
367
|
-
];
|
|
368
|
-
"writable": true;
|
|
369
|
-
"pda": {
|
|
370
|
-
"seeds": [
|
|
371
|
-
{
|
|
372
|
-
"kind": "const";
|
|
373
|
-
"value": [
|
|
374
|
-
106,
|
|
375
|
-
108,
|
|
376
|
-
112,
|
|
377
|
-
95,
|
|
378
|
-
118,
|
|
379
|
-
97,
|
|
380
|
-
117,
|
|
381
|
-
108,
|
|
382
|
-
116
|
|
383
|
-
];
|
|
384
|
-
}
|
|
385
|
-
];
|
|
386
|
-
};
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
"name": "systemProgram";
|
|
390
|
-
"docs": [
|
|
391
|
-
"System program"
|
|
392
|
-
];
|
|
393
|
-
"address": "11111111111111111111111111111111";
|
|
394
|
-
}
|
|
395
|
-
];
|
|
396
|
-
"args": [
|
|
397
|
-
{
|
|
398
|
-
"name": "params";
|
|
399
|
-
"type": {
|
|
400
|
-
"defined": {
|
|
401
|
-
"name": "InitOrUpdateJlpVaultParams";
|
|
402
|
-
};
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
];
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
"name": "initializeStv";
|
|
409
|
-
"docs": [
|
|
410
|
-
"Initialize a Single Token Vault (STV) for a specific asset",
|
|
411
|
-
"Creates the STV PDA, jvX mint (with STV as authority), and jlX ATA"
|
|
412
|
-
];
|
|
413
|
-
"discriminator": [
|
|
414
|
-
136,
|
|
415
|
-
8,
|
|
416
|
-
178,
|
|
417
|
-
176,
|
|
418
|
-
57,
|
|
419
|
-
33,
|
|
420
|
-
1,
|
|
421
|
-
106
|
|
422
|
-
];
|
|
423
|
-
"accounts": [
|
|
424
|
-
{
|
|
425
|
-
"name": "admin";
|
|
426
|
-
"docs": [
|
|
427
|
-
"Admin of the JLP Vault"
|
|
428
|
-
];
|
|
429
|
-
"writable": true;
|
|
430
|
-
"signer": true;
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
"name": "jlpVault";
|
|
434
|
-
"docs": [
|
|
435
|
-
"The JLP Vault PDA account",
|
|
436
|
-
"Note: PDA and admin verified in handler via get_pda() to avoid multiple loads"
|
|
437
|
-
];
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
"name": "stv";
|
|
441
|
-
"docs": [
|
|
442
|
-
"The STV PDA account (zero-copy)"
|
|
443
|
-
];
|
|
444
|
-
"writable": true;
|
|
445
|
-
"pda": {
|
|
446
|
-
"seeds": [
|
|
447
|
-
{
|
|
448
|
-
"kind": "const";
|
|
449
|
-
"value": [
|
|
450
|
-
115,
|
|
451
|
-
116,
|
|
452
|
-
118
|
|
453
|
-
];
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
"kind": "account";
|
|
457
|
-
"path": "base_mint";
|
|
458
|
-
}
|
|
459
|
-
];
|
|
460
|
-
};
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
"name": "baseMint";
|
|
464
|
-
"docs": [
|
|
465
|
-
"Base asset mint (BTC, ETH, SOL, or USDC)"
|
|
466
|
-
];
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
"name": "jlMint";
|
|
470
|
-
"docs": [
|
|
471
|
-
"Jupiter Lend token mint for this asset"
|
|
472
|
-
];
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
"name": "jvMint";
|
|
476
|
-
"docs": [
|
|
477
|
-
"Vault share token mint (jvX) - STV is the mint authority",
|
|
478
|
-
"Uses init_if_needed in case mint exists from a previous STV initialization"
|
|
479
|
-
];
|
|
480
|
-
"writable": true;
|
|
481
|
-
"signer": true;
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
"name": "stvJlxAta";
|
|
485
|
-
"docs": [
|
|
486
|
-
"STV's jlX ATA (holds Jupiter Lend tokens)",
|
|
487
|
-
"Uses init_if_needed in case ATA exists from a previous STV initialization"
|
|
488
|
-
];
|
|
489
|
-
"writable": true;
|
|
490
|
-
"pda": {
|
|
491
|
-
"seeds": [
|
|
492
|
-
{
|
|
493
|
-
"kind": "account";
|
|
494
|
-
"path": "stv";
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
"kind": "const";
|
|
498
|
-
"value": [
|
|
499
|
-
6,
|
|
500
|
-
221,
|
|
501
|
-
246,
|
|
502
|
-
225,
|
|
503
|
-
215,
|
|
504
|
-
101,
|
|
505
|
-
161,
|
|
506
|
-
147,
|
|
507
|
-
217,
|
|
508
|
-
203,
|
|
509
|
-
225,
|
|
510
|
-
70,
|
|
511
|
-
206,
|
|
512
|
-
235,
|
|
513
|
-
121,
|
|
514
|
-
172,
|
|
515
|
-
28,
|
|
516
|
-
180,
|
|
517
|
-
133,
|
|
518
|
-
237,
|
|
519
|
-
95,
|
|
520
|
-
91,
|
|
521
|
-
55,
|
|
522
|
-
145,
|
|
523
|
-
58,
|
|
524
|
-
140,
|
|
525
|
-
245,
|
|
526
|
-
133,
|
|
527
|
-
126,
|
|
528
|
-
255,
|
|
529
|
-
0,
|
|
530
|
-
169
|
|
531
|
-
];
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
"kind": "account";
|
|
535
|
-
"path": "jl_mint";
|
|
536
|
-
}
|
|
537
|
-
];
|
|
538
|
-
"program": {
|
|
539
|
-
"kind": "const";
|
|
540
|
-
"value": [
|
|
541
|
-
140,
|
|
542
|
-
151,
|
|
543
|
-
37,
|
|
544
|
-
143,
|
|
545
|
-
78,
|
|
546
|
-
36,
|
|
547
|
-
137,
|
|
548
|
-
241,
|
|
549
|
-
187,
|
|
550
|
-
61,
|
|
551
|
-
16,
|
|
552
|
-
41,
|
|
553
|
-
20,
|
|
554
|
-
142,
|
|
555
|
-
13,
|
|
556
|
-
131,
|
|
557
|
-
11,
|
|
558
|
-
90,
|
|
559
|
-
19,
|
|
560
|
-
153,
|
|
561
|
-
218,
|
|
562
|
-
255,
|
|
563
|
-
16,
|
|
564
|
-
132,
|
|
565
|
-
4,
|
|
566
|
-
142,
|
|
567
|
-
123,
|
|
568
|
-
216,
|
|
569
|
-
219,
|
|
570
|
-
233,
|
|
571
|
-
248,
|
|
572
|
-
89
|
|
573
|
-
];
|
|
574
|
-
};
|
|
575
|
-
};
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
"name": "systemProgram";
|
|
579
|
-
"docs": [
|
|
580
|
-
"System program"
|
|
581
|
-
];
|
|
582
|
-
"address": "11111111111111111111111111111111";
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
"name": "tokenProgram";
|
|
586
|
-
"docs": [
|
|
587
|
-
"Token program"
|
|
588
|
-
];
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
"name": "associatedTokenProgram";
|
|
592
|
-
"docs": [
|
|
593
|
-
"Associated token program"
|
|
594
|
-
];
|
|
595
|
-
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
596
|
-
},
|
|
597
|
-
{
|
|
598
|
-
"name": "rent";
|
|
599
|
-
"docs": [
|
|
600
|
-
"Rent sysvar"
|
|
601
|
-
];
|
|
602
|
-
"address": "SysvarRent111111111111111111111111111111111";
|
|
603
|
-
}
|
|
604
|
-
];
|
|
605
|
-
"args": [
|
|
606
|
-
{
|
|
607
|
-
"name": "params";
|
|
608
|
-
"type": {
|
|
609
|
-
"defined": {
|
|
610
|
-
"name": "InitializeStvParams";
|
|
611
|
-
};
|
|
612
|
-
};
|
|
613
|
-
}
|
|
614
|
-
];
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
"name": "jupEarnDepositWithdraw";
|
|
618
|
-
"docs": [
|
|
619
|
-
"Deposit base to or withdraw from Jupiter Earn",
|
|
620
|
-
"",
|
|
621
|
-
"Manager-only operation to convert between base asset and jlX tokens",
|
|
622
|
-
"via Jupiter Lend. This is used for pools that support Jupiter Earn",
|
|
623
|
-
"(SOL, USDC) to earn yield on idle funds.",
|
|
624
|
-
"",
|
|
625
|
-
"# Directions",
|
|
626
|
-
"- Deposit: Convert base asset -> jlX (earn Jupiter Earn yield)",
|
|
627
|
-
"- Withdraw: Convert jlX -> base asset (provide withdrawal liquidity)",
|
|
628
|
-
"",
|
|
629
|
-
"# Use Cases",
|
|
630
|
-
"- After user deposits, manager can deposit base to Jupiter Earn",
|
|
631
|
-
"- Before user withdrawals, manager can withdraw from Jupiter Earn",
|
|
632
|
-
"- BTC/ETH pools cannot use Jupiter Earn (not supported)",
|
|
633
|
-
"",
|
|
634
|
-
"# Remaining Accounts",
|
|
635
|
-
"- Deposit: 17 Jupiter Lend accounts (see jup_lend::deposit_accounts)",
|
|
636
|
-
"- Withdraw: 18 Jupiter Lend accounts (see jup_lend::withdraw_accounts)"
|
|
637
|
-
];
|
|
638
|
-
"discriminator": [
|
|
639
|
-
124,
|
|
640
|
-
60,
|
|
641
|
-
71,
|
|
642
|
-
122,
|
|
643
|
-
162,
|
|
644
|
-
212,
|
|
645
|
-
164,
|
|
646
|
-
191
|
|
647
|
-
];
|
|
648
|
-
"accounts": [
|
|
649
|
-
{
|
|
650
|
-
"name": "manager";
|
|
651
|
-
"docs": [
|
|
652
|
-
"Manager performing the operation"
|
|
653
|
-
];
|
|
654
|
-
"signer": true;
|
|
655
|
-
},
|
|
656
|
-
{
|
|
657
|
-
"name": "jlpVault";
|
|
658
|
-
"docs": [
|
|
659
|
-
"The JLP Vault PDA account",
|
|
660
|
-
"Note: PDA and manager verified in handler"
|
|
661
|
-
];
|
|
662
|
-
},
|
|
663
|
-
{
|
|
664
|
-
"name": "stv";
|
|
665
|
-
"docs": [
|
|
666
|
-
"The STV PDA account",
|
|
667
|
-
"Note: PDA verified in handler"
|
|
668
|
-
];
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
"name": "baseMint";
|
|
672
|
-
"docs": [
|
|
673
|
-
"Using UncheckedAccount to avoid borrow conflicts with Jupiter Lend CPI"
|
|
674
|
-
];
|
|
675
|
-
},
|
|
676
|
-
{
|
|
677
|
-
"name": "jlMint";
|
|
678
|
-
"docs": [
|
|
679
|
-
"Using UncheckedAccount to avoid borrow conflicts with Jupiter Lend CPI"
|
|
680
|
-
];
|
|
681
|
-
"writable": true;
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
"name": "stvBaseAta";
|
|
685
|
-
"docs": [
|
|
686
|
-
"Using UncheckedAccount to avoid borrow conflicts with Jupiter Lend CPI"
|
|
687
|
-
];
|
|
688
|
-
"writable": true;
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
"name": "stvJlxAta";
|
|
692
|
-
"docs": [
|
|
693
|
-
"Using UncheckedAccount to avoid borrow conflicts with Jupiter Lend CPI"
|
|
694
|
-
];
|
|
695
|
-
"writable": true;
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
"name": "tokenProgram";
|
|
699
|
-
"docs": [
|
|
700
|
-
"Token program - used to validate ATA ownership"
|
|
701
|
-
];
|
|
702
|
-
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
703
|
-
}
|
|
704
|
-
];
|
|
705
|
-
"args": [
|
|
706
|
-
{
|
|
707
|
-
"name": "params";
|
|
708
|
-
"type": {
|
|
709
|
-
"defined": {
|
|
710
|
-
"name": "JupEarnParams";
|
|
711
|
-
};
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
];
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
"name": "moveStvToFromVault";
|
|
718
|
-
"docs": [
|
|
719
|
-
"Move jlX tokens between STV and JLPVault staging ATA",
|
|
720
|
-
"Direction::ToVault: STV jlX ATA -> Vault staging ATA (preparation for swap)",
|
|
721
|
-
"Direction::FromVault: Vault staging ATA -> STV jlX ATA (return after swap/unwind)",
|
|
722
|
-
"",
|
|
723
|
-
"Remaining accounts (optional, for pools with Jupiter Earn):",
|
|
724
|
-
"[0] = Jupiter Lend lending account (for exchange rate)",
|
|
725
|
-
"[1] = Jupiter Lend rewards rate model (for exchange rate)",
|
|
726
|
-
"",
|
|
727
|
-
"For base-only pools (BTC, ETH where jl_mint == base_mint):",
|
|
728
|
-
"No remaining accounts needed - uses 1.0 exchange rate"
|
|
729
|
-
];
|
|
730
|
-
"discriminator": [
|
|
731
|
-
60,
|
|
732
|
-
104,
|
|
733
|
-
8,
|
|
734
|
-
126,
|
|
735
|
-
254,
|
|
736
|
-
244,
|
|
737
|
-
95,
|
|
738
|
-
221
|
|
739
|
-
];
|
|
740
|
-
"accounts": [
|
|
741
|
-
{
|
|
742
|
-
"name": "manager";
|
|
743
|
-
"docs": [
|
|
744
|
-
"Manager performing the operation"
|
|
745
|
-
];
|
|
746
|
-
"signer": true;
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
"name": "jlpVault";
|
|
750
|
-
"docs": [
|
|
751
|
-
"The JLP Vault PDA account",
|
|
752
|
-
"Note: PDA and manager verified in handler via get_pda() to avoid multiple loads"
|
|
753
|
-
];
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
"name": "stv";
|
|
757
|
-
"docs": [
|
|
758
|
-
"The STV PDA account (mutable to update base_loaned)",
|
|
759
|
-
"Note: PDA verified in handler via get_pda() to avoid multiple loads"
|
|
760
|
-
];
|
|
761
|
-
"writable": true;
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
"name": "baseMint";
|
|
765
|
-
"docs": [
|
|
766
|
-
"Base asset mint (for detection of base-only pools)"
|
|
767
|
-
];
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
"name": "jlMint";
|
|
771
|
-
"docs": [
|
|
772
|
-
"jlX mint (for decimals in transfer_checked)",
|
|
773
|
-
"For base-only pools (BTC, ETH), jl_mint == base_mint"
|
|
774
|
-
];
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
"name": "stvJlxAta";
|
|
778
|
-
"docs": [
|
|
779
|
-
"STV's jlX ATA",
|
|
780
|
-
"For base-only pools, this is the base ATA (jl_mint == base_mint)"
|
|
781
|
-
];
|
|
782
|
-
"writable": true;
|
|
783
|
-
},
|
|
784
|
-
{
|
|
785
|
-
"name": "vaultStagingAta";
|
|
786
|
-
"docs": [
|
|
787
|
-
"Vault's staging jlX ATA (for this specific jl_mint)",
|
|
788
|
-
"For base-only pools, this is the staging base ATA"
|
|
789
|
-
];
|
|
790
|
-
"writable": true;
|
|
791
|
-
},
|
|
792
|
-
{
|
|
793
|
-
"name": "tokenProgram";
|
|
794
|
-
"docs": [
|
|
795
|
-
"Token program"
|
|
796
|
-
];
|
|
797
|
-
}
|
|
798
|
-
];
|
|
799
|
-
"args": [
|
|
800
|
-
{
|
|
801
|
-
"name": "params";
|
|
802
|
-
"type": {
|
|
803
|
-
"defined": {
|
|
804
|
-
"name": "MoveJlxParams";
|
|
805
|
-
};
|
|
806
|
-
};
|
|
807
|
-
}
|
|
808
|
-
];
|
|
809
|
-
},
|
|
810
|
-
{
|
|
811
|
-
"name": "processEpoch";
|
|
812
|
-
"docs": [
|
|
813
|
-
"Process epoch: burn jvX from withdraw requests, record PPS, earmark base",
|
|
814
|
-
"",
|
|
815
|
-
"Permissionless (anyone can call after epoch ends).",
|
|
816
|
-
"Processes WithdrawRequest pairs from remaining_accounts.",
|
|
817
|
-
"Uses epoch_pps for multi-batch consistency.",
|
|
818
|
-
"",
|
|
819
|
-
"# Remaining Accounts",
|
|
820
|
-
"- [0-1]: Jupiter Lend accounts (if jl_mint != base_mint)",
|
|
821
|
-
"- [N..]: pairs of [WithdrawRequest (mut), request_jvx_ata (mut)]"
|
|
822
|
-
];
|
|
823
|
-
"discriminator": [
|
|
824
|
-
115,
|
|
825
|
-
194,
|
|
826
|
-
215,
|
|
827
|
-
160,
|
|
828
|
-
113,
|
|
829
|
-
154,
|
|
830
|
-
81,
|
|
831
|
-
5
|
|
832
|
-
];
|
|
833
|
-
"accounts": [
|
|
834
|
-
{
|
|
835
|
-
"name": "payer";
|
|
836
|
-
"docs": [
|
|
837
|
-
"Payer/caller - permissionless (anyone can call after epoch ends)"
|
|
838
|
-
];
|
|
839
|
-
"writable": true;
|
|
840
|
-
"signer": true;
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
"name": "jlpVault";
|
|
844
|
-
"docs": [
|
|
845
|
-
"The JLP Vault PDA account (for pause checks)"
|
|
846
|
-
];
|
|
847
|
-
},
|
|
848
|
-
{
|
|
849
|
-
"name": "stv";
|
|
850
|
-
"docs": [
|
|
851
|
-
"The STV PDA account (mut for epoch state + fee crystallization)"
|
|
852
|
-
];
|
|
853
|
-
"writable": true;
|
|
854
|
-
},
|
|
855
|
-
{
|
|
856
|
-
"name": "baseMint";
|
|
857
|
-
"docs": [
|
|
858
|
-
"Base asset mint (for NAV calc)"
|
|
859
|
-
];
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
"name": "jlMint";
|
|
863
|
-
"docs": [
|
|
864
|
-
"jlX mint (for exchange rate)"
|
|
865
|
-
];
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
"name": "jvMint";
|
|
869
|
-
"docs": [
|
|
870
|
-
"jvX mint (mut for burn - supply decreases)"
|
|
871
|
-
];
|
|
872
|
-
"writable": true;
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
"name": "stvBaseAta";
|
|
876
|
-
"docs": [
|
|
877
|
-
"STV's base ATA (for NAV)"
|
|
878
|
-
];
|
|
879
|
-
},
|
|
880
|
-
{
|
|
881
|
-
"name": "stvJlxAta";
|
|
882
|
-
"docs": [
|
|
883
|
-
"STV's jlX ATA (for NAV)"
|
|
884
|
-
];
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
"name": "tokenProgram";
|
|
888
|
-
}
|
|
889
|
-
];
|
|
890
|
-
"args": [];
|
|
891
|
-
},
|
|
892
|
-
{
|
|
893
|
-
"name": "requestWithdraw";
|
|
894
|
-
"docs": [
|
|
895
|
-
"Request withdrawal of jvX shares (epoch-based delayed withdrawal)",
|
|
896
|
-
"",
|
|
897
|
-
"# Flow",
|
|
898
|
-
"1. Validate epoch is active and not ended",
|
|
899
|
-
"2. Create or accumulate into WithdrawRequest PDA for this epoch",
|
|
900
|
-
"3. Transfer jvX from user to request's escrow ATA",
|
|
901
|
-
"",
|
|
902
|
-
"User must wait for process_epoch + claim_withdraw to receive base."
|
|
903
|
-
];
|
|
904
|
-
"discriminator": [
|
|
905
|
-
137,
|
|
906
|
-
95,
|
|
907
|
-
187,
|
|
908
|
-
96,
|
|
909
|
-
250,
|
|
910
|
-
138,
|
|
911
|
-
31,
|
|
912
|
-
182
|
|
913
|
-
];
|
|
914
|
-
"accounts": [
|
|
915
|
-
{
|
|
916
|
-
"name": "user";
|
|
917
|
-
"docs": [
|
|
918
|
-
"User requesting withdrawal"
|
|
919
|
-
];
|
|
920
|
-
"writable": true;
|
|
921
|
-
"signer": true;
|
|
922
|
-
},
|
|
923
|
-
{
|
|
924
|
-
"name": "jlpVault";
|
|
925
|
-
"docs": [
|
|
926
|
-
"The JLP Vault PDA account (for pause checks)"
|
|
927
|
-
];
|
|
928
|
-
},
|
|
929
|
-
{
|
|
930
|
-
"name": "stv";
|
|
931
|
-
"docs": [
|
|
932
|
-
"The STV PDA account (for epoch validation)"
|
|
933
|
-
];
|
|
934
|
-
"writable": true;
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
"name": "jvMint";
|
|
938
|
-
"docs": [
|
|
939
|
-
"jvX mint (vault share token)"
|
|
940
|
-
];
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
"name": "userJvxAta";
|
|
944
|
-
"docs": [
|
|
945
|
-
"User's jvX token account (source of shares)"
|
|
946
|
-
];
|
|
947
|
-
"writable": true;
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
"name": "withdrawRequest";
|
|
951
|
-
"docs": [
|
|
952
|
-
"WithdrawRequest PDA - created or accumulated into"
|
|
953
|
-
];
|
|
954
|
-
"writable": true;
|
|
955
|
-
"pda": {
|
|
956
|
-
"seeds": [
|
|
957
|
-
{
|
|
958
|
-
"kind": "const";
|
|
959
|
-
"value": [
|
|
960
|
-
119,
|
|
961
|
-
105,
|
|
962
|
-
116,
|
|
963
|
-
104,
|
|
964
|
-
100,
|
|
965
|
-
114,
|
|
966
|
-
97,
|
|
967
|
-
119,
|
|
968
|
-
95,
|
|
969
|
-
114,
|
|
970
|
-
101,
|
|
971
|
-
113,
|
|
972
|
-
117,
|
|
973
|
-
101,
|
|
974
|
-
115,
|
|
975
|
-
116
|
|
976
|
-
];
|
|
977
|
-
},
|
|
978
|
-
{
|
|
979
|
-
"kind": "account";
|
|
980
|
-
"path": "stv";
|
|
981
|
-
},
|
|
982
|
-
{
|
|
983
|
-
"kind": "account";
|
|
984
|
-
"path": "user";
|
|
985
|
-
},
|
|
986
|
-
{
|
|
987
|
-
"kind": "arg";
|
|
988
|
-
"path": "epoch_id";
|
|
989
|
-
}
|
|
990
|
-
];
|
|
991
|
-
};
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
"name": "requestJvxAta";
|
|
995
|
-
"docs": [
|
|
996
|
-
"jvX ATA owned by the WithdrawRequest PDA (escrow for shares)"
|
|
997
|
-
];
|
|
998
|
-
"writable": true;
|
|
999
|
-
"pda": {
|
|
1000
|
-
"seeds": [
|
|
1001
|
-
{
|
|
1002
|
-
"kind": "account";
|
|
1003
|
-
"path": "withdraw_request";
|
|
1004
|
-
},
|
|
1005
|
-
{
|
|
1006
|
-
"kind": "const";
|
|
1007
|
-
"value": [
|
|
1008
|
-
6,
|
|
1009
|
-
221,
|
|
1010
|
-
246,
|
|
1011
|
-
225,
|
|
1012
|
-
215,
|
|
1013
|
-
101,
|
|
1014
|
-
161,
|
|
1015
|
-
147,
|
|
1016
|
-
217,
|
|
1017
|
-
203,
|
|
1018
|
-
225,
|
|
1019
|
-
70,
|
|
1020
|
-
206,
|
|
1021
|
-
235,
|
|
1022
|
-
121,
|
|
1023
|
-
172,
|
|
1024
|
-
28,
|
|
1025
|
-
180,
|
|
1026
|
-
133,
|
|
1027
|
-
237,
|
|
1028
|
-
95,
|
|
1029
|
-
91,
|
|
1030
|
-
55,
|
|
1031
|
-
145,
|
|
1032
|
-
58,
|
|
1033
|
-
140,
|
|
1034
|
-
245,
|
|
1035
|
-
133,
|
|
1036
|
-
126,
|
|
1037
|
-
255,
|
|
1038
|
-
0,
|
|
1039
|
-
169
|
|
1040
|
-
];
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
"kind": "account";
|
|
1044
|
-
"path": "jv_mint";
|
|
1045
|
-
}
|
|
1046
|
-
];
|
|
1047
|
-
"program": {
|
|
1048
|
-
"kind": "const";
|
|
1049
|
-
"value": [
|
|
1050
|
-
140,
|
|
1051
|
-
151,
|
|
1052
|
-
37,
|
|
1053
|
-
143,
|
|
1054
|
-
78,
|
|
1055
|
-
36,
|
|
1056
|
-
137,
|
|
1057
|
-
241,
|
|
1058
|
-
187,
|
|
1059
|
-
61,
|
|
1060
|
-
16,
|
|
1061
|
-
41,
|
|
1062
|
-
20,
|
|
1063
|
-
142,
|
|
1064
|
-
13,
|
|
1065
|
-
131,
|
|
1066
|
-
11,
|
|
1067
|
-
90,
|
|
1068
|
-
19,
|
|
1069
|
-
153,
|
|
1070
|
-
218,
|
|
1071
|
-
255,
|
|
1072
|
-
16,
|
|
1073
|
-
132,
|
|
1074
|
-
4,
|
|
1075
|
-
142,
|
|
1076
|
-
123,
|
|
1077
|
-
216,
|
|
1078
|
-
219,
|
|
1079
|
-
233,
|
|
1080
|
-
248,
|
|
1081
|
-
89
|
|
1082
|
-
];
|
|
1083
|
-
};
|
|
1084
|
-
};
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
"name": "tokenProgram";
|
|
1088
|
-
},
|
|
1089
|
-
{
|
|
1090
|
-
"name": "associatedTokenProgram";
|
|
1091
|
-
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
"name": "systemProgram";
|
|
1095
|
-
"address": "11111111111111111111111111111111";
|
|
1096
|
-
}
|
|
1097
|
-
];
|
|
1098
|
-
"args": [
|
|
1099
|
-
{
|
|
1100
|
-
"name": "shares";
|
|
1101
|
-
"type": "u64";
|
|
1102
|
-
},
|
|
1103
|
-
{
|
|
1104
|
-
"name": "epochId";
|
|
1105
|
-
"type": "u32";
|
|
1106
|
-
}
|
|
1107
|
-
];
|
|
1108
|
-
},
|
|
1109
|
-
{
|
|
1110
|
-
"name": "settleYield";
|
|
1111
|
-
"docs": [
|
|
1112
|
-
"Settle yield/loss from JLP positions across all STVs",
|
|
1113
|
-
"Called periodically (~8 hours) to update all STV values based on JLP performance",
|
|
1114
|
-
"",
|
|
1115
|
-
"# USD-Based Settlement",
|
|
1116
|
-
"1. Values total vault holdings (JLP + staging jlX) in USD using oracles",
|
|
1117
|
-
"2. Values total base_loaned across all STVs in USD",
|
|
1118
|
-
"3. Distributes surplus (yield) or deficit (bad debt) proportionally",
|
|
1119
|
-
"",
|
|
1120
|
-
"# Security",
|
|
1121
|
-
"- BTC/ETH/SOL prices come from Doves oracles (manipulation-resistant)",
|
|
1122
|
-
"- JLP price computed directly from Jupiter Perps Pool account (aumUsd / jlp_supply)",
|
|
1123
|
-
"- Exchange rates come from Jupiter Earn (audited, TWAP-based)",
|
|
1124
|
-
"- Distribution is proportional to each STV's share of total loans",
|
|
1125
|
-
"",
|
|
1126
|
-
"# Accounts",
|
|
1127
|
-
"Requires all 5 STVs, 5 staging jlX ATAs, 3 Doves oracles (BTC/ETH/SOL),",
|
|
1128
|
-
"Jupiter Perps Pool account, JLP mint account",
|
|
1129
|
-
"",
|
|
1130
|
-
"# Remaining Accounts (15 accounts)",
|
|
1131
|
-
"For exchange rate calculation with time-accrued rewards:",
|
|
1132
|
-
"- [0-4]: Jupiter Lend lending accounts (BTC, ETH, SOL, USDC, JupUSD)",
|
|
1133
|
-
"- [5-9]: Jupiter Lend rewards rate model accounts (BTC, ETH, SOL, USDC, JupUSD)",
|
|
1134
|
-
"- [10-14]: jlX mint accounts (jlBTC, jlETH, jlSOL, jlUSDC, jlJupUSD)"
|
|
1135
|
-
];
|
|
1136
|
-
"discriminator": [
|
|
1137
|
-
64,
|
|
1138
|
-
28,
|
|
1139
|
-
44,
|
|
1140
|
-
24,
|
|
1141
|
-
43,
|
|
1142
|
-
204,
|
|
1143
|
-
58,
|
|
1144
|
-
215
|
|
1145
|
-
];
|
|
1146
|
-
"accounts": [
|
|
1147
|
-
{
|
|
1148
|
-
"name": "jlpVault";
|
|
1149
|
-
"writable": true;
|
|
1150
|
-
},
|
|
1151
|
-
{
|
|
1152
|
-
"name": "vaultJlpAta";
|
|
1153
|
-
"docs": [
|
|
1154
|
-
"JLP token account owned by vault"
|
|
1155
|
-
];
|
|
1156
|
-
},
|
|
1157
|
-
{
|
|
1158
|
-
"name": "stv0";
|
|
1159
|
-
"writable": true;
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
"name": "stv1";
|
|
1163
|
-
"writable": true;
|
|
1164
|
-
},
|
|
1165
|
-
{
|
|
1166
|
-
"name": "stv2";
|
|
1167
|
-
"writable": true;
|
|
1168
|
-
},
|
|
1169
|
-
{
|
|
1170
|
-
"name": "stv3";
|
|
1171
|
-
"writable": true;
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
"name": "stv4";
|
|
1175
|
-
"writable": true;
|
|
1176
|
-
},
|
|
1177
|
-
{
|
|
1178
|
-
"name": "stagingJlx0";
|
|
1179
|
-
},
|
|
1180
|
-
{
|
|
1181
|
-
"name": "stagingJlx1";
|
|
1182
|
-
},
|
|
1183
|
-
{
|
|
1184
|
-
"name": "stagingJlx2";
|
|
1185
|
-
},
|
|
1186
|
-
{
|
|
1187
|
-
"name": "stagingJlx3";
|
|
1188
|
-
},
|
|
1189
|
-
{
|
|
1190
|
-
"name": "stagingJlx4";
|
|
1191
|
-
},
|
|
1192
|
-
{
|
|
1193
|
-
"name": "dovesBtcUsd";
|
|
1194
|
-
},
|
|
1195
|
-
{
|
|
1196
|
-
"name": "dovesEthUsd";
|
|
1197
|
-
},
|
|
1198
|
-
{
|
|
1199
|
-
"name": "dovesSolUsd";
|
|
1200
|
-
},
|
|
1201
|
-
{
|
|
1202
|
-
"name": "jlpPool";
|
|
1203
|
-
},
|
|
1204
|
-
{
|
|
1205
|
-
"name": "jlpMintAccount";
|
|
1206
|
-
},
|
|
1207
|
-
{
|
|
1208
|
-
"name": "manager";
|
|
1209
|
-
"docs": [
|
|
1210
|
-
"Manager who can perform rebalance operations (verified in handler)"
|
|
1211
|
-
];
|
|
1212
|
-
"signer": true;
|
|
1213
|
-
}
|
|
1214
|
-
];
|
|
1215
|
-
"args": [];
|
|
1216
|
-
},
|
|
1217
|
-
{
|
|
1218
|
-
"name": "swapJlxToFromJlp";
|
|
1219
|
-
"docs": [
|
|
1220
|
-
"Swap between different jlX types (e.g., jlSOL -> jlUSDC) via Jupiter",
|
|
1221
|
-
"Manager-only operation for rebalancing vault composition",
|
|
1222
|
-
"",
|
|
1223
|
-
"Remaining accounts: Jupiter swap accounts from API (varies based on route)",
|
|
1224
|
-
"Swap between jlX and JLP tokens via Jupiter",
|
|
1225
|
-
"JlxToJlp: Swap jlX -> JLP (increase vault JLP balance)",
|
|
1226
|
-
"JlpToJlx: Swap JLP -> jlX (decrease vault JLP balance)",
|
|
1227
|
-
"Manager-only operation for JLP position management",
|
|
1228
|
-
"",
|
|
1229
|
-
"Note: JLP positions are tracked via STV.base_loaned and settled",
|
|
1230
|
-
"using settle_yield with Doves oracle prices (USD-based settlement).",
|
|
1231
|
-
"",
|
|
1232
|
-
"Remaining accounts: Jupiter swap accounts from API (varies based on route)"
|
|
1233
|
-
];
|
|
1234
|
-
"discriminator": [
|
|
1235
|
-
229,
|
|
1236
|
-
185,
|
|
1237
|
-
136,
|
|
1238
|
-
170,
|
|
1239
|
-
210,
|
|
1240
|
-
189,
|
|
1241
|
-
172,
|
|
1242
|
-
241
|
|
1243
|
-
];
|
|
1244
|
-
"accounts": [
|
|
1245
|
-
{
|
|
1246
|
-
"name": "manager";
|
|
1247
|
-
"docs": [
|
|
1248
|
-
"Manager performing the swap"
|
|
1249
|
-
];
|
|
1250
|
-
"signer": true;
|
|
1251
|
-
},
|
|
1252
|
-
{
|
|
1253
|
-
"name": "jlpVault";
|
|
1254
|
-
"docs": [
|
|
1255
|
-
"The JLP Vault PDA account",
|
|
1256
|
-
"Note: PDA and manager verified in handler via get_pda() to avoid multiple loads"
|
|
1257
|
-
];
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
"name": "vaultJlxAta";
|
|
1261
|
-
"docs": [
|
|
1262
|
-
"Vault's staging jlX ATA (source for JlxToJlp, dest for JlpToJlx)",
|
|
1263
|
-
"This is the jlX token that corresponds to stv_index"
|
|
1264
|
-
];
|
|
1265
|
-
"writable": true;
|
|
1266
|
-
},
|
|
1267
|
-
{
|
|
1268
|
-
"name": "vaultJlpAta";
|
|
1269
|
-
"docs": [
|
|
1270
|
-
"Vault's JLP ATA (dest for JlxToJlp, source for JlpToJlx)"
|
|
1271
|
-
];
|
|
1272
|
-
"writable": true;
|
|
1273
|
-
},
|
|
1274
|
-
{
|
|
1275
|
-
"name": "jlpMint";
|
|
1276
|
-
"docs": [
|
|
1277
|
-
"JLP mint"
|
|
1278
|
-
];
|
|
1279
|
-
},
|
|
1280
|
-
{
|
|
1281
|
-
"name": "tokenProgram";
|
|
1282
|
-
"docs": [
|
|
1283
|
-
"Token program"
|
|
1284
|
-
];
|
|
1285
|
-
},
|
|
1286
|
-
{
|
|
1287
|
-
"name": "jupiterProgram";
|
|
1288
|
-
"docs": [
|
|
1289
|
-
"Jupiter aggregator program"
|
|
1290
|
-
];
|
|
1291
|
-
}
|
|
1292
|
-
];
|
|
1293
|
-
"args": [
|
|
1294
|
-
{
|
|
1295
|
-
"name": "params";
|
|
1296
|
-
"type": {
|
|
1297
|
-
"defined": {
|
|
1298
|
-
"name": "SwapJlxJlpParams";
|
|
1299
|
-
};
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
];
|
|
1303
|
-
},
|
|
1304
|
-
{
|
|
1305
|
-
"name": "updateStv";
|
|
1306
|
-
"docs": [
|
|
1307
|
-
"Update STV parameters including fees and flags",
|
|
1308
|
-
"Admin-only operation to modify STV configuration"
|
|
1309
|
-
];
|
|
1310
|
-
"discriminator": [
|
|
1311
|
-
72,
|
|
1312
|
-
173,
|
|
1313
|
-
200,
|
|
1314
|
-
203,
|
|
1315
|
-
74,
|
|
1316
|
-
83,
|
|
1317
|
-
242,
|
|
1318
|
-
43
|
|
1319
|
-
];
|
|
1320
|
-
"accounts": [
|
|
1321
|
-
{
|
|
1322
|
-
"name": "admin";
|
|
1323
|
-
"docs": [
|
|
1324
|
-
"Admin of the JLP Vault"
|
|
1325
|
-
];
|
|
1326
|
-
"writable": true;
|
|
1327
|
-
"signer": true;
|
|
1328
|
-
},
|
|
1329
|
-
{
|
|
1330
|
-
"name": "jlpVault";
|
|
1331
|
-
"docs": [
|
|
1332
|
-
"The JLP Vault PDA account",
|
|
1333
|
-
"Note: PDA and admin verified in handler via get_pda() to avoid multiple loads"
|
|
1334
|
-
];
|
|
1335
|
-
},
|
|
1336
|
-
{
|
|
1337
|
-
"name": "stv";
|
|
1338
|
-
"docs": [
|
|
1339
|
-
"The STV PDA account to update",
|
|
1340
|
-
"Note: PDA verified in handler via get_pda() to avoid multiple loads"
|
|
1341
|
-
];
|
|
1342
|
-
"writable": true;
|
|
1343
|
-
}
|
|
1344
|
-
];
|
|
1345
|
-
"args": [
|
|
1346
|
-
{
|
|
1347
|
-
"name": "params";
|
|
1348
|
-
"type": {
|
|
1349
|
-
"defined": {
|
|
1350
|
-
"name": "UpdateStvParams";
|
|
1351
|
-
};
|
|
1352
|
-
};
|
|
1353
|
-
}
|
|
1354
|
-
];
|
|
1355
|
-
}
|
|
1356
|
-
];
|
|
1357
|
-
"accounts": [
|
|
1358
|
-
{
|
|
1359
|
-
"name": "JLPVault";
|
|
1360
|
-
"discriminator": [
|
|
1361
|
-
41,
|
|
1362
|
-
108,
|
|
1363
|
-
189,
|
|
1364
|
-
168,
|
|
1365
|
-
199,
|
|
1366
|
-
152,
|
|
1367
|
-
221,
|
|
1368
|
-
119
|
|
1369
|
-
];
|
|
1370
|
-
},
|
|
1371
|
-
{
|
|
1372
|
-
"name": "STV";
|
|
1373
|
-
"discriminator": [
|
|
1374
|
-
214,
|
|
1375
|
-
2,
|
|
1376
|
-
96,
|
|
1377
|
-
41,
|
|
1378
|
-
85,
|
|
1379
|
-
163,
|
|
1380
|
-
17,
|
|
1381
|
-
230
|
|
1382
|
-
];
|
|
1383
|
-
},
|
|
1384
|
-
{
|
|
1385
|
-
"name": "WithdrawRequest";
|
|
1386
|
-
"discriminator": [
|
|
1387
|
-
186,
|
|
1388
|
-
239,
|
|
1389
|
-
174,
|
|
1390
|
-
191,
|
|
1391
|
-
189,
|
|
1392
|
-
13,
|
|
1393
|
-
47,
|
|
1394
|
-
196
|
|
1395
|
-
];
|
|
1396
|
-
}
|
|
1397
|
-
];
|
|
1398
|
-
"events": [
|
|
1399
|
-
{
|
|
1400
|
-
"name": "Deposited";
|
|
1401
|
-
"discriminator": [
|
|
1402
|
-
111,
|
|
1403
|
-
141,
|
|
1404
|
-
26,
|
|
1405
|
-
45,
|
|
1406
|
-
161,
|
|
1407
|
-
35,
|
|
1408
|
-
100,
|
|
1409
|
-
57
|
|
1410
|
-
];
|
|
1411
|
-
},
|
|
1412
|
-
{
|
|
1413
|
-
"name": "EpochAdvanced";
|
|
1414
|
-
"discriminator": [
|
|
1415
|
-
41,
|
|
1416
|
-
220,
|
|
1417
|
-
14,
|
|
1418
|
-
123,
|
|
1419
|
-
117,
|
|
1420
|
-
70,
|
|
1421
|
-
117,
|
|
1422
|
-
157
|
|
1423
|
-
];
|
|
1424
|
-
},
|
|
1425
|
-
{
|
|
1426
|
-
"name": "EpochProcessed";
|
|
1427
|
-
"discriminator": [
|
|
1428
|
-
18,
|
|
1429
|
-
238,
|
|
1430
|
-
2,
|
|
1431
|
-
247,
|
|
1432
|
-
238,
|
|
1433
|
-
178,
|
|
1434
|
-
94,
|
|
1435
|
-
138
|
|
1436
|
-
];
|
|
1437
|
-
},
|
|
1438
|
-
{
|
|
1439
|
-
"name": "FeesClaimSkipped";
|
|
1440
|
-
"discriminator": [
|
|
1441
|
-
7,
|
|
1442
|
-
214,
|
|
1443
|
-
20,
|
|
1444
|
-
27,
|
|
1445
|
-
90,
|
|
1446
|
-
132,
|
|
1447
|
-
198,
|
|
1448
|
-
77
|
|
1449
|
-
];
|
|
1450
|
-
},
|
|
1451
|
-
{
|
|
1452
|
-
"name": "FeesClaimed";
|
|
1453
|
-
"discriminator": [
|
|
1454
|
-
22,
|
|
1455
|
-
104,
|
|
1456
|
-
110,
|
|
1457
|
-
222,
|
|
1458
|
-
38,
|
|
1459
|
-
157,
|
|
1460
|
-
14,
|
|
1461
|
-
62
|
|
1462
|
-
];
|
|
1463
|
-
},
|
|
1464
|
-
{
|
|
1465
|
-
"name": "JlpSwapped";
|
|
1466
|
-
"discriminator": [
|
|
1467
|
-
253,
|
|
1468
|
-
47,
|
|
1469
|
-
169,
|
|
1470
|
-
18,
|
|
1471
|
-
222,
|
|
1472
|
-
203,
|
|
1473
|
-
169,
|
|
1474
|
-
15
|
|
1475
|
-
];
|
|
1476
|
-
},
|
|
1477
|
-
{
|
|
1478
|
-
"name": "JlpVaultInitialized";
|
|
1479
|
-
"discriminator": [
|
|
1480
|
-
52,
|
|
1481
|
-
94,
|
|
1482
|
-
202,
|
|
1483
|
-
211,
|
|
1484
|
-
2,
|
|
1485
|
-
98,
|
|
1486
|
-
77,
|
|
1487
|
-
229
|
|
1488
|
-
];
|
|
1489
|
-
},
|
|
1490
|
-
{
|
|
1491
|
-
"name": "JlpVaultUpdated";
|
|
1492
|
-
"discriminator": [
|
|
1493
|
-
20,
|
|
1494
|
-
204,
|
|
1495
|
-
5,
|
|
1496
|
-
243,
|
|
1497
|
-
122,
|
|
1498
|
-
9,
|
|
1499
|
-
109,
|
|
1500
|
-
130
|
|
1501
|
-
];
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
"name": "JlxMoved";
|
|
1505
|
-
"discriminator": [
|
|
1506
|
-
251,
|
|
1507
|
-
80,
|
|
1508
|
-
253,
|
|
1509
|
-
180,
|
|
1510
|
-
106,
|
|
1511
|
-
69,
|
|
1512
|
-
129,
|
|
1513
|
-
70
|
|
1514
|
-
];
|
|
1515
|
-
},
|
|
1516
|
-
{
|
|
1517
|
-
"name": "JlxSwapped";
|
|
1518
|
-
"discriminator": [
|
|
1519
|
-
200,
|
|
1520
|
-
218,
|
|
1521
|
-
196,
|
|
1522
|
-
94,
|
|
1523
|
-
186,
|
|
1524
|
-
141,
|
|
1525
|
-
86,
|
|
1526
|
-
223
|
|
1527
|
-
];
|
|
1528
|
-
},
|
|
1529
|
-
{
|
|
1530
|
-
"name": "JupEarnEvent";
|
|
1531
|
-
"discriminator": [
|
|
1532
|
-
138,
|
|
1533
|
-
10,
|
|
1534
|
-
64,
|
|
1535
|
-
209,
|
|
1536
|
-
244,
|
|
1537
|
-
49,
|
|
1538
|
-
1,
|
|
1539
|
-
188
|
|
1540
|
-
];
|
|
1541
|
-
},
|
|
1542
|
-
{
|
|
1543
|
-
"name": "SettleYieldEvent";
|
|
1544
|
-
"discriminator": [
|
|
1545
|
-
208,
|
|
1546
|
-
142,
|
|
1547
|
-
20,
|
|
1548
|
-
32,
|
|
1549
|
-
204,
|
|
1550
|
-
216,
|
|
1551
|
-
242,
|
|
1552
|
-
189
|
|
1553
|
-
];
|
|
1554
|
-
},
|
|
1555
|
-
{
|
|
1556
|
-
"name": "SettleYieldSkipped";
|
|
1557
|
-
"discriminator": [
|
|
1558
|
-
189,
|
|
1559
|
-
221,
|
|
1560
|
-
140,
|
|
1561
|
-
115,
|
|
1562
|
-
37,
|
|
1563
|
-
102,
|
|
1564
|
-
42,
|
|
1565
|
-
195
|
|
1566
|
-
];
|
|
1567
|
-
},
|
|
1568
|
-
{
|
|
1569
|
-
"name": "SettleYieldStvEvent";
|
|
1570
|
-
"discriminator": [
|
|
1571
|
-
12,
|
|
1572
|
-
42,
|
|
1573
|
-
226,
|
|
1574
|
-
95,
|
|
1575
|
-
60,
|
|
1576
|
-
95,
|
|
1577
|
-
192,
|
|
1578
|
-
238
|
|
1579
|
-
];
|
|
1580
|
-
},
|
|
1581
|
-
{
|
|
1582
|
-
"name": "StvInitialized";
|
|
1583
|
-
"discriminator": [
|
|
1584
|
-
41,
|
|
1585
|
-
106,
|
|
1586
|
-
196,
|
|
1587
|
-
230,
|
|
1588
|
-
138,
|
|
1589
|
-
22,
|
|
1590
|
-
195,
|
|
1591
|
-
188
|
|
1592
|
-
];
|
|
1593
|
-
},
|
|
1594
|
-
{
|
|
1595
|
-
"name": "StvUpdated";
|
|
1596
|
-
"discriminator": [
|
|
1597
|
-
108,
|
|
1598
|
-
129,
|
|
1599
|
-
139,
|
|
1600
|
-
80,
|
|
1601
|
-
212,
|
|
1602
|
-
111,
|
|
1603
|
-
83,
|
|
1604
|
-
199
|
|
1605
|
-
];
|
|
1606
|
-
},
|
|
1607
|
-
{
|
|
1608
|
-
"name": "WithdrawClaimed";
|
|
1609
|
-
"discriminator": [
|
|
1610
|
-
77,
|
|
1611
|
-
130,
|
|
1612
|
-
89,
|
|
1613
|
-
38,
|
|
1614
|
-
239,
|
|
1615
|
-
172,
|
|
1616
|
-
174,
|
|
1617
|
-
85
|
|
1618
|
-
];
|
|
1619
|
-
},
|
|
1620
|
-
{
|
|
1621
|
-
"name": "WithdrawRequested";
|
|
1622
|
-
"discriminator": [
|
|
1623
|
-
114,
|
|
1624
|
-
16,
|
|
1625
|
-
240,
|
|
1626
|
-
206,
|
|
1627
|
-
93,
|
|
1628
|
-
128,
|
|
1629
|
-
151,
|
|
1630
|
-
39
|
|
1631
|
-
];
|
|
1632
|
-
}
|
|
1633
|
-
];
|
|
1634
|
-
"errors": [
|
|
1635
|
-
{
|
|
1636
|
-
"code": 6000;
|
|
1637
|
-
"name": "Unauthorized";
|
|
1638
|
-
"msg": "Unauthorized: not admin";
|
|
1639
|
-
},
|
|
1640
|
-
{
|
|
1641
|
-
"code": 6001;
|
|
1642
|
-
"name": "NotManager";
|
|
1643
|
-
"msg": "Unauthorized: not manager";
|
|
1644
|
-
},
|
|
1645
|
-
{
|
|
1646
|
-
"code": 6002;
|
|
1647
|
-
"name": "VaultPaused";
|
|
1648
|
-
"msg": "Vault is paused";
|
|
1649
|
-
},
|
|
1650
|
-
{
|
|
1651
|
-
"code": 6003;
|
|
1652
|
-
"name": "DepositsDisabled";
|
|
1653
|
-
"msg": "Deposits disabled";
|
|
1654
|
-
},
|
|
1655
|
-
{
|
|
1656
|
-
"code": 6004;
|
|
1657
|
-
"name": "WithdrawalsDisabled";
|
|
1658
|
-
"msg": "Withdrawals disabled";
|
|
1659
|
-
},
|
|
1660
|
-
{
|
|
1661
|
-
"code": 6005;
|
|
1662
|
-
"name": "JlpDisabled";
|
|
1663
|
-
"msg": "JLP operations disabled";
|
|
1664
|
-
},
|
|
1665
|
-
{
|
|
1666
|
-
"code": 6006;
|
|
1667
|
-
"name": "RebalanceDisabled";
|
|
1668
|
-
"msg": "Rebalance operations disabled";
|
|
1669
|
-
},
|
|
1670
|
-
{
|
|
1671
|
-
"code": 6007;
|
|
1672
|
-
"name": "MathOverflow";
|
|
1673
|
-
"msg": "Math overflow";
|
|
1674
|
-
},
|
|
1675
|
-
{
|
|
1676
|
-
"code": 6008;
|
|
1677
|
-
"name": "InvalidTimestamp";
|
|
1678
|
-
"msg": "Invalid timestamp";
|
|
1679
|
-
},
|
|
1680
|
-
{
|
|
1681
|
-
"code": 6009;
|
|
1682
|
-
"name": "DivisionByZero";
|
|
1683
|
-
"msg": "Division by zero";
|
|
1684
|
-
},
|
|
1685
|
-
{
|
|
1686
|
-
"code": 6010;
|
|
1687
|
-
"name": "StagingNotZero";
|
|
1688
|
-
"msg": "Staging ATAs must be zero";
|
|
1689
|
-
},
|
|
1690
|
-
{
|
|
1691
|
-
"code": 6011;
|
|
1692
|
-
"name": "InsufficientLiquidity";
|
|
1693
|
-
"msg": "Insufficient liquidity for withdrawal";
|
|
1694
|
-
},
|
|
1695
|
-
{
|
|
1696
|
-
"code": 6012;
|
|
1697
|
-
"name": "InsufficientBalance";
|
|
1698
|
-
"msg": "Insufficient balance";
|
|
1699
|
-
},
|
|
1700
|
-
{
|
|
1701
|
-
"code": 6013;
|
|
1702
|
-
"name": "SlippageExceeded";
|
|
1703
|
-
"msg": "Slippage exceeded";
|
|
1704
|
-
},
|
|
1705
|
-
{
|
|
1706
|
-
"code": 6014;
|
|
1707
|
-
"name": "InvalidJlpVaultBump";
|
|
1708
|
-
"msg": "Invalid JLP vault PDA bump";
|
|
1709
|
-
},
|
|
1710
|
-
{
|
|
1711
|
-
"code": 6015;
|
|
1712
|
-
"name": "InvalidStvBump";
|
|
1713
|
-
"msg": "Invalid STV PDA bump";
|
|
1714
|
-
},
|
|
1715
|
-
{
|
|
1716
|
-
"code": 6016;
|
|
1717
|
-
"name": "InvalidJlMint";
|
|
1718
|
-
"msg": "Invalid jlX mint (Jupiter Lend token)";
|
|
1719
|
-
},
|
|
1720
|
-
{
|
|
1721
|
-
"code": 6017;
|
|
1722
|
-
"name": "InvalidJvMint";
|
|
1723
|
-
"msg": "Invalid jvX mint (vault share token)";
|
|
1724
|
-
},
|
|
1725
|
-
{
|
|
1726
|
-
"code": 6018;
|
|
1727
|
-
"name": "InvalidBaseMint";
|
|
1728
|
-
"msg": "Invalid base asset mint";
|
|
1729
|
-
},
|
|
1730
|
-
{
|
|
1731
|
-
"code": 6019;
|
|
1732
|
-
"name": "InvalidJlpMint";
|
|
1733
|
-
"msg": "Invalid JLP mint";
|
|
1734
|
-
},
|
|
1735
|
-
{
|
|
1736
|
-
"code": 6020;
|
|
1737
|
-
"name": "InvalidOwner";
|
|
1738
|
-
"msg": "Invalid account owner";
|
|
1739
|
-
},
|
|
1740
|
-
{
|
|
1741
|
-
"code": 6021;
|
|
1742
|
-
"name": "InvalidStvIndex";
|
|
1743
|
-
"msg": "Invalid STV index";
|
|
1744
|
-
},
|
|
1745
|
-
{
|
|
1746
|
-
"code": 6022;
|
|
1747
|
-
"name": "InvalidFeeParams";
|
|
1748
|
-
"msg": "Invalid fee parameters";
|
|
1749
|
-
},
|
|
1750
|
-
{
|
|
1751
|
-
"code": 6023;
|
|
1752
|
-
"name": "AmountTooSmall";
|
|
1753
|
-
"msg": "Amount too small";
|
|
1754
|
-
},
|
|
1755
|
-
{
|
|
1756
|
-
"code": 6024;
|
|
1757
|
-
"name": "ZeroAmount";
|
|
1758
|
-
"msg": "Zero amount not allowed";
|
|
1759
|
-
},
|
|
1760
|
-
{
|
|
1761
|
-
"code": 6025;
|
|
1762
|
-
"name": "FeeCapExceeded";
|
|
1763
|
-
"msg": "Fee cap exceeded";
|
|
1764
|
-
},
|
|
1765
|
-
{
|
|
1766
|
-
"code": 6026;
|
|
1767
|
-
"name": "MintMismatch";
|
|
1768
|
-
"msg": "Mint mismatch";
|
|
1769
|
-
},
|
|
1770
|
-
{
|
|
1771
|
-
"code": 6027;
|
|
1772
|
-
"name": "InsufficientAccounts";
|
|
1773
|
-
"msg": "Insufficient accounts provided";
|
|
1774
|
-
},
|
|
1775
|
-
{
|
|
1776
|
-
"code": 6028;
|
|
1777
|
-
"name": "InvalidProgram";
|
|
1778
|
-
"msg": "Invalid program ID";
|
|
1779
|
-
},
|
|
1780
|
-
{
|
|
1781
|
-
"code": 6029;
|
|
1782
|
-
"name": "InvalidSwapDiscriminator";
|
|
1783
|
-
"msg": "Invalid swap discriminator";
|
|
1784
|
-
},
|
|
1785
|
-
{
|
|
1786
|
-
"code": 6030;
|
|
1787
|
-
"name": "MaxDepositExceeded";
|
|
1788
|
-
"msg": "Deposit exceeds maximum allowed";
|
|
1789
|
-
},
|
|
1790
|
-
{
|
|
1791
|
-
"code": 6031;
|
|
1792
|
-
"name": "InvalidLendingAccount";
|
|
1793
|
-
"msg": "Invalid Jupiter Lend lending account";
|
|
1794
|
-
},
|
|
1795
|
-
{
|
|
1796
|
-
"code": 6032;
|
|
1797
|
-
"name": "MissingExchangeRateAccounts";
|
|
1798
|
-
"msg": "Missing exchange rate accounts - lending and rewards_rate_model required for pools with Jupiter Earn";
|
|
1799
|
-
},
|
|
1800
|
-
{
|
|
1801
|
-
"code": 6033;
|
|
1802
|
-
"name": "JupiterLendCpiFailed";
|
|
1803
|
-
"msg": "Jupiter Lend CPI failed";
|
|
1804
|
-
},
|
|
1805
|
-
{
|
|
1806
|
-
"code": 6034;
|
|
1807
|
-
"name": "JupiterSwapCpiFailed";
|
|
1808
|
-
"msg": "Jupiter swap CPI failed";
|
|
1809
|
-
},
|
|
1810
|
-
{
|
|
1811
|
-
"code": 6035;
|
|
1812
|
-
"name": "OracleStale";
|
|
1813
|
-
"msg": "Oracle price is stale - older than staleness threshold";
|
|
1814
|
-
},
|
|
1815
|
-
{
|
|
1816
|
-
"code": 6036;
|
|
1817
|
-
"name": "OraclePriceNegative";
|
|
1818
|
-
"msg": "Oracle returned negative price";
|
|
1819
|
-
},
|
|
1820
|
-
{
|
|
1821
|
-
"code": 6037;
|
|
1822
|
-
"name": "InvalidBaseAssetIndex";
|
|
1823
|
-
"msg": "Invalid base asset index";
|
|
1824
|
-
},
|
|
1825
|
-
{
|
|
1826
|
-
"code": 6038;
|
|
1827
|
-
"name": "PriceFeedMismatch";
|
|
1828
|
-
"msg": "Price feed mismatch";
|
|
1829
|
-
},
|
|
1830
|
-
{
|
|
1831
|
-
"code": 6039;
|
|
1832
|
-
"name": "OracleAccountInvalid";
|
|
1833
|
-
"msg": "Oracle account invalid";
|
|
1834
|
-
},
|
|
1835
|
-
{
|
|
1836
|
-
"code": 6040;
|
|
1837
|
-
"name": "InvalidAccountData";
|
|
1838
|
-
"msg": "Invalid account data - could not parse account";
|
|
1839
|
-
},
|
|
1840
|
-
{
|
|
1841
|
-
"code": 6041;
|
|
1842
|
-
"name": "InvalidExchangeRate";
|
|
1843
|
-
"msg": "Invalid exchange rate from Jupiter Lend";
|
|
1844
|
-
},
|
|
1845
|
-
{
|
|
1846
|
-
"code": 6042;
|
|
1847
|
-
"name": "InvalidOracleAccount";
|
|
1848
|
-
"msg": "Invalid oracle account - not owned by expected program";
|
|
1849
|
-
},
|
|
1850
|
-
{
|
|
1851
|
-
"code": 6043;
|
|
1852
|
-
"name": "JlpPriceOutOfRange";
|
|
1853
|
-
"msg": "JLP price out of reasonable range ($0.50 - $50.00)";
|
|
1854
|
-
},
|
|
1855
|
-
{
|
|
1856
|
-
"code": 6044;
|
|
1857
|
-
"name": "TestModeRequired";
|
|
1858
|
-
"msg": "Test mode required: FLAG_TEST_MODE must be set for devnet/localnet builds";
|
|
1859
|
-
},
|
|
1860
|
-
{
|
|
1861
|
-
"code": 6045;
|
|
1862
|
-
"name": "NotAdmin";
|
|
1863
|
-
"msg": "Unauthorized: not admin";
|
|
1864
|
-
},
|
|
1865
|
-
{
|
|
1866
|
-
"code": 6046;
|
|
1867
|
-
"name": "TokenAccountNotEmpty";
|
|
1868
|
-
"msg": "Token account balance must be zero before closing";
|
|
1869
|
-
},
|
|
1870
|
-
{
|
|
1871
|
-
"code": 6047;
|
|
1872
|
-
"name": "TokenAccountOwnerMismatch";
|
|
1873
|
-
"msg": "Token account not owned by expected PDA";
|
|
1874
|
-
},
|
|
1875
|
-
{
|
|
1876
|
-
"code": 6048;
|
|
1877
|
-
"name": "EpochEnded";
|
|
1878
|
-
"msg": "Epoch has ended - call process_epoch first";
|
|
1879
|
-
},
|
|
1880
|
-
{
|
|
1881
|
-
"code": 6049;
|
|
1882
|
-
"name": "EpochNotEnded";
|
|
1883
|
-
"msg": "Epoch has not ended yet";
|
|
1884
|
-
},
|
|
1885
|
-
{
|
|
1886
|
-
"code": 6050;
|
|
1887
|
-
"name": "ClaimNotAvailableYet";
|
|
1888
|
-
"msg": "Claim not available yet - wait for next epoch";
|
|
1889
|
-
},
|
|
1890
|
-
{
|
|
1891
|
-
"code": 6051;
|
|
1892
|
-
"name": "InvalidEpochInterval";
|
|
1893
|
-
"msg": "Withdraw epoch interval must be > 0";
|
|
1894
|
-
},
|
|
1895
|
-
{
|
|
1896
|
-
"code": 6052;
|
|
1897
|
-
"name": "ActiveWithdrawReserves";
|
|
1898
|
-
"msg": "Cannot update epoch interval with active reserves";
|
|
1899
|
-
},
|
|
1900
|
-
{
|
|
1901
|
-
"code": 6053;
|
|
1902
|
-
"name": "EpochIdMismatch";
|
|
1903
|
-
"msg": "Epoch ID mismatch";
|
|
1904
|
-
},
|
|
1905
|
-
{
|
|
1906
|
-
"code": 6054;
|
|
1907
|
-
"name": "WithdrawRequestNotProcessed";
|
|
1908
|
-
"msg": "Withdraw request not processed yet";
|
|
1909
|
-
},
|
|
1910
|
-
{
|
|
1911
|
-
"code": 6055;
|
|
1912
|
-
"name": "WithdrawRequestAlreadyProcessed";
|
|
1913
|
-
"msg": "Withdraw request already processed";
|
|
1914
|
-
}
|
|
1915
|
-
];
|
|
1916
|
-
"types": [
|
|
1917
|
-
{
|
|
1918
|
-
"name": "Deposited";
|
|
1919
|
-
"type": {
|
|
1920
|
-
"kind": "struct";
|
|
1921
|
-
"fields": [
|
|
1922
|
-
{
|
|
1923
|
-
"name": "stv";
|
|
1924
|
-
"type": "pubkey";
|
|
1925
|
-
},
|
|
1926
|
-
{
|
|
1927
|
-
"name": "user";
|
|
1928
|
-
"type": "pubkey";
|
|
1929
|
-
},
|
|
1930
|
-
{
|
|
1931
|
-
"name": "amountBase";
|
|
1932
|
-
"docs": [
|
|
1933
|
-
"Amount of base asset deposited"
|
|
1934
|
-
];
|
|
1935
|
-
"type": "u64";
|
|
1936
|
-
},
|
|
1937
|
-
{
|
|
1938
|
-
"name": "sharesMinted";
|
|
1939
|
-
"type": "u64";
|
|
1940
|
-
},
|
|
1941
|
-
{
|
|
1942
|
-
"name": "pps";
|
|
1943
|
-
"type": "u64";
|
|
1944
|
-
}
|
|
1945
|
-
];
|
|
1946
|
-
};
|
|
1947
|
-
},
|
|
1948
|
-
{
|
|
1949
|
-
"name": "Direction";
|
|
1950
|
-
"docs": [
|
|
1951
|
-
"Direction of jlX token movement between STV and Vault"
|
|
1952
|
-
];
|
|
1953
|
-
"type": {
|
|
1954
|
-
"kind": "enum";
|
|
1955
|
-
"variants": [
|
|
1956
|
-
{
|
|
1957
|
-
"name": "ToVault";
|
|
1958
|
-
},
|
|
1959
|
-
{
|
|
1960
|
-
"name": "FromVault";
|
|
1961
|
-
}
|
|
1962
|
-
];
|
|
1963
|
-
};
|
|
1964
|
-
},
|
|
1965
|
-
{
|
|
1966
|
-
"name": "EpochAdvanced";
|
|
1967
|
-
"type": {
|
|
1968
|
-
"kind": "struct";
|
|
1969
|
-
"fields": [
|
|
1970
|
-
{
|
|
1971
|
-
"name": "stv";
|
|
1972
|
-
"type": "pubkey";
|
|
1973
|
-
},
|
|
1974
|
-
{
|
|
1975
|
-
"name": "newEpochId";
|
|
1976
|
-
"type": "u32";
|
|
1977
|
-
},
|
|
1978
|
-
{
|
|
1979
|
-
"name": "newNextEpochTs";
|
|
1980
|
-
"type": "u32";
|
|
1981
|
-
}
|
|
1982
|
-
];
|
|
1983
|
-
};
|
|
1984
|
-
},
|
|
1985
|
-
{
|
|
1986
|
-
"name": "EpochProcessed";
|
|
1987
|
-
"type": {
|
|
1988
|
-
"kind": "struct";
|
|
1989
|
-
"fields": [
|
|
1990
|
-
{
|
|
1991
|
-
"name": "stv";
|
|
1992
|
-
"type": "pubkey";
|
|
1993
|
-
},
|
|
1994
|
-
{
|
|
1995
|
-
"name": "epochId";
|
|
1996
|
-
"type": "u32";
|
|
1997
|
-
},
|
|
1998
|
-
{
|
|
1999
|
-
"name": "pps";
|
|
2000
|
-
"type": "u64";
|
|
2001
|
-
},
|
|
2002
|
-
{
|
|
2003
|
-
"name": "totalShares";
|
|
2004
|
-
"type": "u64";
|
|
2005
|
-
},
|
|
2006
|
-
{
|
|
2007
|
-
"name": "totalBase";
|
|
2008
|
-
"type": "u64";
|
|
2009
|
-
},
|
|
2010
|
-
{
|
|
2011
|
-
"name": "newEpochId";
|
|
2012
|
-
"type": "u32";
|
|
2013
|
-
},
|
|
2014
|
-
{
|
|
2015
|
-
"name": "newNextEpochTs";
|
|
2016
|
-
"type": "u32";
|
|
2017
|
-
}
|
|
2018
|
-
];
|
|
2019
|
-
};
|
|
2020
|
-
},
|
|
2021
|
-
{
|
|
2022
|
-
"name": "FeesClaimSkipped";
|
|
2023
|
-
"docs": [
|
|
2024
|
-
"Event emitted when claim_fees returns early (no fees to claim)"
|
|
2025
|
-
];
|
|
2026
|
-
"type": {
|
|
2027
|
-
"kind": "struct";
|
|
2028
|
-
"fields": [
|
|
2029
|
-
{
|
|
2030
|
-
"name": "stv";
|
|
2031
|
-
"docs": [
|
|
2032
|
-
"The STV account"
|
|
2033
|
-
];
|
|
2034
|
-
"type": "pubkey";
|
|
2035
|
-
},
|
|
2036
|
-
{
|
|
2037
|
-
"name": "reason";
|
|
2038
|
-
"docs": [
|
|
2039
|
-
"Reason for skipping: \"NoFeesToClaim\""
|
|
2040
|
-
];
|
|
2041
|
-
"type": "string";
|
|
2042
|
-
}
|
|
2043
|
-
];
|
|
2044
|
-
};
|
|
2045
|
-
},
|
|
2046
|
-
{
|
|
2047
|
-
"name": "FeesClaimed";
|
|
2048
|
-
"docs": [
|
|
2049
|
-
"Fee claim event - when manager claims accrued fees"
|
|
2050
|
-
];
|
|
2051
|
-
"type": {
|
|
2052
|
-
"kind": "struct";
|
|
2053
|
-
"fields": [
|
|
2054
|
-
{
|
|
2055
|
-
"name": "stv";
|
|
2056
|
-
"type": "pubkey";
|
|
2057
|
-
},
|
|
2058
|
-
{
|
|
2059
|
-
"name": "amountJlx";
|
|
2060
|
-
"docs": [
|
|
2061
|
-
"Total jlX claimed by fee receiver"
|
|
2062
|
-
];
|
|
2063
|
-
"type": "u64";
|
|
2064
|
-
},
|
|
2065
|
-
{
|
|
2066
|
-
"name": "feeReceiver";
|
|
2067
|
-
"docs": [
|
|
2068
|
-
"Fee receiver who received the fees"
|
|
2069
|
-
];
|
|
2070
|
-
"type": "pubkey";
|
|
2071
|
-
}
|
|
2072
|
-
];
|
|
2073
|
-
};
|
|
2074
|
-
},
|
|
2075
|
-
{
|
|
2076
|
-
"name": "InitOrUpdateJlpVaultParams";
|
|
2077
|
-
"docs": [
|
|
2078
|
-
"Parameters for initializing or updating the JLP Vault"
|
|
2079
|
-
];
|
|
2080
|
-
"type": {
|
|
2081
|
-
"kind": "struct";
|
|
2082
|
-
"fields": [
|
|
2083
|
-
{
|
|
2084
|
-
"name": "jlpMint";
|
|
2085
|
-
"docs": [
|
|
2086
|
-
"JLP token mint - required for init, ignored on update"
|
|
2087
|
-
];
|
|
2088
|
-
"type": {
|
|
2089
|
-
"option": "pubkey";
|
|
2090
|
-
};
|
|
2091
|
-
},
|
|
2092
|
-
{
|
|
2093
|
-
"name": "baseAssetMints";
|
|
2094
|
-
"docs": [
|
|
2095
|
-
"Base asset token mints [BTC, ETH, SOL, USDC, JupUSD] - required for init, ignored on update"
|
|
2096
|
-
];
|
|
2097
|
-
"type": {
|
|
2098
|
-
"option": {
|
|
2099
|
-
"array": [
|
|
2100
|
-
"pubkey",
|
|
2101
|
-
5
|
|
2102
|
-
];
|
|
2103
|
-
};
|
|
2104
|
-
};
|
|
2105
|
-
},
|
|
2106
|
-
{
|
|
2107
|
-
"name": "jlxAssetMints";
|
|
2108
|
-
"docs": [
|
|
2109
|
-
"jlX token mints [jlBTC, jlETH, jlSOL, jlUSDC, jlJupUSD] - required for init, ignored on update"
|
|
2110
|
-
];
|
|
2111
|
-
"type": {
|
|
2112
|
-
"option": {
|
|
2113
|
-
"array": [
|
|
2114
|
-
"pubkey",
|
|
2115
|
-
5
|
|
2116
|
-
];
|
|
2117
|
-
};
|
|
2118
|
-
};
|
|
2119
|
-
},
|
|
2120
|
-
{
|
|
2121
|
-
"name": "newAdmin";
|
|
2122
|
-
"docs": [
|
|
2123
|
-
"New admin address - if Some, transfers admin ownership (only current admin can do this)"
|
|
2124
|
-
];
|
|
2125
|
-
"type": {
|
|
2126
|
-
"option": "pubkey";
|
|
2127
|
-
};
|
|
2128
|
-
},
|
|
2129
|
-
{
|
|
2130
|
-
"name": "manager";
|
|
2131
|
-
"docs": [
|
|
2132
|
-
"Manager address (can perform rebalance operations)"
|
|
2133
|
-
];
|
|
2134
|
-
"type": "pubkey";
|
|
2135
|
-
},
|
|
2136
|
-
{
|
|
2137
|
-
"name": "feeReceiver";
|
|
2138
|
-
"docs": [
|
|
2139
|
-
"Fee receiver address"
|
|
2140
|
-
];
|
|
2141
|
-
"type": "pubkey";
|
|
2142
|
-
},
|
|
2143
|
-
{
|
|
2144
|
-
"name": "flags";
|
|
2145
|
-
"docs": [
|
|
2146
|
-
"Vault flags (paused, deposits disabled, etc.)"
|
|
2147
|
-
];
|
|
2148
|
-
"type": "u16";
|
|
2149
|
-
},
|
|
2150
|
-
{
|
|
2151
|
-
"name": "jlpSlippageBps";
|
|
2152
|
-
"docs": [
|
|
2153
|
-
"JLP swap slippage tolerance in basis points (e.g., 100 = 1%)"
|
|
2154
|
-
];
|
|
2155
|
-
"type": "u16";
|
|
2156
|
-
},
|
|
2157
|
-
{
|
|
2158
|
-
"name": "oracleStalenessThreshold";
|
|
2159
|
-
"docs": [
|
|
2160
|
-
"Maximum age in seconds for Doves oracle prices to be considered valid.",
|
|
2161
|
-
"On init: defaults to 60 seconds if None.",
|
|
2162
|
-
"On update: if None, keeps existing value; if Some, updates to new value."
|
|
2163
|
-
];
|
|
2164
|
-
"type": {
|
|
2165
|
-
"option": "u64";
|
|
2166
|
-
};
|
|
2167
|
-
}
|
|
2168
|
-
];
|
|
2169
|
-
};
|
|
2170
|
-
},
|
|
2171
|
-
{
|
|
2172
|
-
"name": "InitializeStvParams";
|
|
2173
|
-
"docs": [
|
|
2174
|
-
"Parameters for initializing an STV"
|
|
2175
|
-
];
|
|
2176
|
-
"type": {
|
|
2177
|
-
"kind": "struct";
|
|
2178
|
-
"fields": [
|
|
2179
|
-
{
|
|
2180
|
-
"name": "mgmtFeeBps";
|
|
2181
|
-
"docs": [
|
|
2182
|
-
"Management fee in basis points (annual)"
|
|
2183
|
-
];
|
|
2184
|
-
"type": "u16";
|
|
2185
|
-
},
|
|
2186
|
-
{
|
|
2187
|
-
"name": "perfFeeBps";
|
|
2188
|
-
"docs": [
|
|
2189
|
-
"Performance fee in basis points"
|
|
2190
|
-
];
|
|
2191
|
-
"type": "u16";
|
|
2192
|
-
},
|
|
2193
|
-
{
|
|
2194
|
-
"name": "maxDeposit";
|
|
2195
|
-
"docs": [
|
|
2196
|
-
"Maximum deposit amount in base asset (0 = unlimited)"
|
|
2197
|
-
];
|
|
2198
|
-
"type": "u64";
|
|
2199
|
-
},
|
|
2200
|
-
{
|
|
2201
|
-
"name": "minDeposit";
|
|
2202
|
-
"docs": [
|
|
2203
|
-
"Minimum deposit amount in base asset (0 = no minimum)"
|
|
2204
|
-
];
|
|
2205
|
-
"type": "u64";
|
|
2206
|
-
},
|
|
2207
|
-
{
|
|
2208
|
-
"name": "epochSec";
|
|
2209
|
-
"docs": [
|
|
2210
|
-
"Epoch duration in seconds for delayed withdrawals"
|
|
2211
|
-
];
|
|
2212
|
-
"type": "u32";
|
|
2213
|
-
}
|
|
2214
|
-
];
|
|
2215
|
-
};
|
|
2216
|
-
},
|
|
2217
|
-
{
|
|
2218
|
-
"name": "JLPVault";
|
|
2219
|
-
"docs": [
|
|
2220
|
-
"JLPVault - Global vault configuration account",
|
|
2221
|
-
"Seeds: [\"jlp_vault\"]",
|
|
2222
|
-
"Size: 8 (discriminator) + 464 (data) = 472 bytes",
|
|
2223
|
-
"",
|
|
2224
|
-
"## USD-Based Settlement Model",
|
|
2225
|
-
"This vault uses USD-based settlement where JLP positions are tracked via",
|
|
2226
|
-
"each STV's `base_loaned` field. Yield is settled by marking `base_loaned`",
|
|
2227
|
-
"to market using Doves oracle prices."
|
|
2228
|
-
];
|
|
2229
|
-
"serialization": "bytemuck";
|
|
2230
|
-
"repr": {
|
|
2231
|
-
"kind": "c";
|
|
2232
|
-
};
|
|
2233
|
-
"type": {
|
|
2234
|
-
"kind": "struct";
|
|
2235
|
-
"fields": [
|
|
2236
|
-
{
|
|
2237
|
-
"name": "admin";
|
|
2238
|
-
"docs": [
|
|
2239
|
-
"Admin who can update vault configuration"
|
|
2240
|
-
];
|
|
2241
|
-
"type": "pubkey";
|
|
2242
|
-
},
|
|
2243
|
-
{
|
|
2244
|
-
"name": "manager";
|
|
2245
|
-
"docs": [
|
|
2246
|
-
"Manager who can perform rebalance operations"
|
|
2247
|
-
];
|
|
2248
|
-
"type": "pubkey";
|
|
2249
|
-
},
|
|
2250
|
-
{
|
|
2251
|
-
"name": "feeReceiver";
|
|
2252
|
-
"docs": [
|
|
2253
|
-
"Account that receives fees"
|
|
2254
|
-
];
|
|
2255
|
-
"type": "pubkey";
|
|
2256
|
-
},
|
|
2257
|
-
{
|
|
2258
|
-
"name": "jlpMint";
|
|
2259
|
-
"docs": [
|
|
2260
|
-
"JLP token mint address"
|
|
2261
|
-
];
|
|
2262
|
-
"type": "pubkey";
|
|
2263
|
-
},
|
|
2264
|
-
{
|
|
2265
|
-
"name": "baseAssetMints";
|
|
2266
|
-
"docs": [
|
|
2267
|
-
"Base asset token mints [BTC, ETH, SOL, USDC, JupUSD]"
|
|
2268
|
-
];
|
|
2269
|
-
"type": {
|
|
2270
|
-
"array": [
|
|
2271
|
-
"pubkey",
|
|
2272
|
-
5
|
|
2273
|
-
];
|
|
2274
|
-
};
|
|
2275
|
-
},
|
|
2276
|
-
{
|
|
2277
|
-
"name": "jlxAssetMints";
|
|
2278
|
-
"docs": [
|
|
2279
|
-
"jlX token mints [jlBTC, jlETH, jlSOL, jlUSDC, jlJupUSD]"
|
|
2280
|
-
];
|
|
2281
|
-
"type": {
|
|
2282
|
-
"array": [
|
|
2283
|
-
"pubkey",
|
|
2284
|
-
5
|
|
2285
|
-
];
|
|
2286
|
-
};
|
|
2287
|
-
},
|
|
2288
|
-
{
|
|
2289
|
-
"name": "oracleStalenessThreshold";
|
|
2290
|
-
"docs": [
|
|
2291
|
-
"Maximum age in seconds for Doves oracle prices to be considered valid.",
|
|
2292
|
-
"Used during yield settlement to ensure price freshness.",
|
|
2293
|
-
"Default: 60 seconds. Setting to 0 disables staleness check (not recommended)."
|
|
2294
|
-
];
|
|
2295
|
-
"type": "u64";
|
|
2296
|
-
},
|
|
2297
|
-
{
|
|
2298
|
-
"name": "flags";
|
|
2299
|
-
"docs": [
|
|
2300
|
-
"Vault state flags"
|
|
2301
|
-
];
|
|
2302
|
-
"type": "u16";
|
|
2303
|
-
},
|
|
2304
|
-
{
|
|
2305
|
-
"name": "jlpSlippageBps";
|
|
2306
|
-
"docs": [
|
|
2307
|
-
"JLP swap slippage tolerance in basis points (e.g., 100 = 1%)"
|
|
2308
|
-
];
|
|
2309
|
-
"type": "u16";
|
|
2310
|
-
},
|
|
2311
|
-
{
|
|
2312
|
-
"name": "version";
|
|
2313
|
-
"docs": [
|
|
2314
|
-
"Account version for migrations"
|
|
2315
|
-
];
|
|
2316
|
-
"type": "u8";
|
|
2317
|
-
},
|
|
2318
|
-
{
|
|
2319
|
-
"name": "bump";
|
|
2320
|
-
"docs": [
|
|
2321
|
-
"PDA bump seed"
|
|
2322
|
-
];
|
|
2323
|
-
"type": "u8";
|
|
2324
|
-
},
|
|
2325
|
-
{
|
|
2326
|
-
"name": "reserved";
|
|
2327
|
-
"docs": [
|
|
2328
|
-
"Reserved for 8-byte alignment"
|
|
2329
|
-
];
|
|
2330
|
-
"type": {
|
|
2331
|
-
"array": [
|
|
2332
|
-
"u8",
|
|
2333
|
-
2
|
|
2334
|
-
];
|
|
2335
|
-
};
|
|
2336
|
-
}
|
|
2337
|
-
];
|
|
2338
|
-
};
|
|
2339
|
-
},
|
|
2340
|
-
{
|
|
2341
|
-
"name": "JlpSwapped";
|
|
2342
|
-
"type": {
|
|
2343
|
-
"kind": "struct";
|
|
2344
|
-
"fields": [
|
|
2345
|
-
{
|
|
2346
|
-
"name": "vault";
|
|
2347
|
-
"type": "pubkey";
|
|
2348
|
-
},
|
|
2349
|
-
{
|
|
2350
|
-
"name": "stvIndex";
|
|
2351
|
-
"type": "u8";
|
|
2352
|
-
},
|
|
2353
|
-
{
|
|
2354
|
-
"name": "amountIn";
|
|
2355
|
-
"type": "u64";
|
|
2356
|
-
},
|
|
2357
|
-
{
|
|
2358
|
-
"name": "amountOut";
|
|
2359
|
-
"type": "u64";
|
|
2360
|
-
},
|
|
2361
|
-
{
|
|
2362
|
-
"name": "direction";
|
|
2363
|
-
"docs": [
|
|
2364
|
-
"Direction: 0 = JlxToJlp, 1 = JlpToJlx"
|
|
2365
|
-
];
|
|
2366
|
-
"type": "u8";
|
|
2367
|
-
},
|
|
2368
|
-
{
|
|
2369
|
-
"name": "jlpBalanceBefore";
|
|
2370
|
-
"type": "u64";
|
|
2371
|
-
},
|
|
2372
|
-
{
|
|
2373
|
-
"name": "jlpBalanceAfter";
|
|
2374
|
-
"type": "u64";
|
|
2375
|
-
}
|
|
2376
|
-
];
|
|
2377
|
-
};
|
|
2378
|
-
},
|
|
2379
|
-
{
|
|
2380
|
-
"name": "JlpVaultInitialized";
|
|
2381
|
-
"type": {
|
|
2382
|
-
"kind": "struct";
|
|
2383
|
-
"fields": [
|
|
2384
|
-
{
|
|
2385
|
-
"name": "vault";
|
|
2386
|
-
"type": "pubkey";
|
|
2387
|
-
},
|
|
2388
|
-
{
|
|
2389
|
-
"name": "admin";
|
|
2390
|
-
"type": "pubkey";
|
|
2391
|
-
},
|
|
2392
|
-
{
|
|
2393
|
-
"name": "manager";
|
|
2394
|
-
"type": "pubkey";
|
|
2395
|
-
},
|
|
2396
|
-
{
|
|
2397
|
-
"name": "feeReceiver";
|
|
2398
|
-
"type": "pubkey";
|
|
2399
|
-
},
|
|
2400
|
-
{
|
|
2401
|
-
"name": "jlpMint";
|
|
2402
|
-
"type": "pubkey";
|
|
2403
|
-
}
|
|
2404
|
-
];
|
|
2405
|
-
};
|
|
2406
|
-
},
|
|
2407
|
-
{
|
|
2408
|
-
"name": "JlpVaultUpdated";
|
|
2409
|
-
"type": {
|
|
2410
|
-
"kind": "struct";
|
|
2411
|
-
"fields": [
|
|
2412
|
-
{
|
|
2413
|
-
"name": "vault";
|
|
2414
|
-
"type": "pubkey";
|
|
2415
|
-
},
|
|
2416
|
-
{
|
|
2417
|
-
"name": "oldManager";
|
|
2418
|
-
"type": "pubkey";
|
|
2419
|
-
},
|
|
2420
|
-
{
|
|
2421
|
-
"name": "newManager";
|
|
2422
|
-
"type": "pubkey";
|
|
2423
|
-
},
|
|
2424
|
-
{
|
|
2425
|
-
"name": "oldFeeReceiver";
|
|
2426
|
-
"type": "pubkey";
|
|
2427
|
-
},
|
|
2428
|
-
{
|
|
2429
|
-
"name": "newFeeReceiver";
|
|
2430
|
-
"type": "pubkey";
|
|
2431
|
-
},
|
|
2432
|
-
{
|
|
2433
|
-
"name": "oldFlags";
|
|
2434
|
-
"type": "u16";
|
|
2435
|
-
},
|
|
2436
|
-
{
|
|
2437
|
-
"name": "newFlags";
|
|
2438
|
-
"type": "u16";
|
|
2439
|
-
},
|
|
2440
|
-
{
|
|
2441
|
-
"name": "oldJlpSlippageBps";
|
|
2442
|
-
"type": "u16";
|
|
2443
|
-
},
|
|
2444
|
-
{
|
|
2445
|
-
"name": "newJlpSlippageBps";
|
|
2446
|
-
"type": "u16";
|
|
2447
|
-
},
|
|
2448
|
-
{
|
|
2449
|
-
"name": "oldOracleStalenessThreshold";
|
|
2450
|
-
"type": "u64";
|
|
2451
|
-
},
|
|
2452
|
-
{
|
|
2453
|
-
"name": "newOracleStalenessThreshold";
|
|
2454
|
-
"type": "u64";
|
|
2455
|
-
}
|
|
2456
|
-
];
|
|
2457
|
-
};
|
|
2458
|
-
},
|
|
2459
|
-
{
|
|
2460
|
-
"name": "JlxMoved";
|
|
2461
|
-
"type": {
|
|
2462
|
-
"kind": "struct";
|
|
2463
|
-
"fields": [
|
|
2464
|
-
{
|
|
2465
|
-
"name": "stv";
|
|
2466
|
-
"type": "pubkey";
|
|
2467
|
-
},
|
|
2468
|
-
{
|
|
2469
|
-
"name": "vault";
|
|
2470
|
-
"type": "pubkey";
|
|
2471
|
-
},
|
|
2472
|
-
{
|
|
2473
|
-
"name": "amountJlx";
|
|
2474
|
-
"type": "u64";
|
|
2475
|
-
},
|
|
2476
|
-
{
|
|
2477
|
-
"name": "direction";
|
|
2478
|
-
"docs": [
|
|
2479
|
-
"Direction: 0 = ToVault (STV -> Vault), 1 = FromVault (Vault -> STV)"
|
|
2480
|
-
];
|
|
2481
|
-
"type": "u8";
|
|
2482
|
-
},
|
|
2483
|
-
{
|
|
2484
|
-
"name": "baseValue";
|
|
2485
|
-
"docs": [
|
|
2486
|
-
"Base asset value of the jlX moved (at current exchange rate)"
|
|
2487
|
-
];
|
|
2488
|
-
"type": "u64";
|
|
2489
|
-
},
|
|
2490
|
-
{
|
|
2491
|
-
"name": "exchangeRate";
|
|
2492
|
-
"docs": [
|
|
2493
|
-
"Jupiter Lend exchange rate used for calculation (12 decimals)"
|
|
2494
|
-
];
|
|
2495
|
-
"type": "u64";
|
|
2496
|
-
},
|
|
2497
|
-
{
|
|
2498
|
-
"name": "newBaseLoaned";
|
|
2499
|
-
"docs": [
|
|
2500
|
-
"New base_loaned after the move"
|
|
2501
|
-
];
|
|
2502
|
-
"type": "u64";
|
|
2503
|
-
}
|
|
2504
|
-
];
|
|
2505
|
-
};
|
|
2506
|
-
},
|
|
2507
|
-
{
|
|
2508
|
-
"name": "JlxSwapped";
|
|
2509
|
-
"type": {
|
|
2510
|
-
"kind": "struct";
|
|
2511
|
-
"fields": [
|
|
2512
|
-
{
|
|
2513
|
-
"name": "vault";
|
|
2514
|
-
"type": "pubkey";
|
|
2515
|
-
},
|
|
2516
|
-
{
|
|
2517
|
-
"name": "fromIndex";
|
|
2518
|
-
"type": "u8";
|
|
2519
|
-
},
|
|
2520
|
-
{
|
|
2521
|
-
"name": "toIndex";
|
|
2522
|
-
"type": "u8";
|
|
2523
|
-
},
|
|
2524
|
-
{
|
|
2525
|
-
"name": "amountIn";
|
|
2526
|
-
"type": "u64";
|
|
2527
|
-
},
|
|
2528
|
-
{
|
|
2529
|
-
"name": "minOut";
|
|
2530
|
-
"type": "u64";
|
|
2531
|
-
},
|
|
2532
|
-
{
|
|
2533
|
-
"name": "amountOut";
|
|
2534
|
-
"type": "u64";
|
|
2535
|
-
}
|
|
2536
|
-
];
|
|
2537
|
-
};
|
|
2538
|
-
},
|
|
2539
|
-
{
|
|
2540
|
-
"name": "JupEarnDirection";
|
|
2541
|
-
"docs": [
|
|
2542
|
-
"Direction for Jupiter Earn operations"
|
|
2543
|
-
];
|
|
2544
|
-
"type": {
|
|
2545
|
-
"kind": "enum";
|
|
2546
|
-
"variants": [
|
|
2547
|
-
{
|
|
2548
|
-
"name": "Deposit";
|
|
2549
|
-
},
|
|
2550
|
-
{
|
|
2551
|
-
"name": "Withdraw";
|
|
2552
|
-
}
|
|
2553
|
-
];
|
|
2554
|
-
};
|
|
2555
|
-
},
|
|
2556
|
-
{
|
|
2557
|
-
"name": "JupEarnEvent";
|
|
2558
|
-
"docs": [
|
|
2559
|
-
"Event emitted for Jupiter Earn deposit/withdraw operations"
|
|
2560
|
-
];
|
|
2561
|
-
"type": {
|
|
2562
|
-
"kind": "struct";
|
|
2563
|
-
"fields": [
|
|
2564
|
-
{
|
|
2565
|
-
"name": "stv";
|
|
2566
|
-
"docs": [
|
|
2567
|
-
"The STV account"
|
|
2568
|
-
];
|
|
2569
|
-
"type": "pubkey";
|
|
2570
|
-
},
|
|
2571
|
-
{
|
|
2572
|
-
"name": "direction";
|
|
2573
|
-
"docs": [
|
|
2574
|
-
"Direction: 0 = Deposit (base -> jlX), 1 = Withdraw (jlX -> base)"
|
|
2575
|
-
];
|
|
2576
|
-
"type": "u8";
|
|
2577
|
-
},
|
|
2578
|
-
{
|
|
2579
|
-
"name": "baseAmount";
|
|
2580
|
-
"docs": [
|
|
2581
|
-
"Amount of base asset (deposited or received)"
|
|
2582
|
-
];
|
|
2583
|
-
"type": "u64";
|
|
2584
|
-
},
|
|
2585
|
-
{
|
|
2586
|
-
"name": "jlxAmount";
|
|
2587
|
-
"docs": [
|
|
2588
|
-
"Amount of jlX (received or burned)"
|
|
2589
|
-
];
|
|
2590
|
-
"type": "u64";
|
|
2591
|
-
}
|
|
2592
|
-
];
|
|
2593
|
-
};
|
|
2594
|
-
},
|
|
2595
|
-
{
|
|
2596
|
-
"name": "JupEarnParams";
|
|
2597
|
-
"docs": [
|
|
2598
|
-
"Parameters for Jupiter Earn deposit/withdraw"
|
|
2599
|
-
];
|
|
2600
|
-
"type": {
|
|
2601
|
-
"kind": "struct";
|
|
2602
|
-
"fields": [
|
|
2603
|
-
{
|
|
2604
|
-
"name": "direction";
|
|
2605
|
-
"docs": [
|
|
2606
|
-
"Direction of the operation"
|
|
2607
|
-
];
|
|
2608
|
-
"type": {
|
|
2609
|
-
"defined": {
|
|
2610
|
-
"name": "JupEarnDirection";
|
|
2611
|
-
};
|
|
2612
|
-
};
|
|
2613
|
-
},
|
|
2614
|
-
{
|
|
2615
|
-
"name": "amount";
|
|
2616
|
-
"docs": [
|
|
2617
|
-
"Amount to deposit (base) or withdraw (jlX)"
|
|
2618
|
-
];
|
|
2619
|
-
"type": "u64";
|
|
2620
|
-
}
|
|
2621
|
-
];
|
|
2622
|
-
};
|
|
2623
|
-
},
|
|
2624
|
-
{
|
|
2625
|
-
"name": "MoveJlxParams";
|
|
2626
|
-
"docs": [
|
|
2627
|
-
"Parameters for moving jlX tokens between STV and Vault"
|
|
2628
|
-
];
|
|
2629
|
-
"type": {
|
|
2630
|
-
"kind": "struct";
|
|
2631
|
-
"fields": [
|
|
2632
|
-
{
|
|
2633
|
-
"name": "amountJlx";
|
|
2634
|
-
"docs": [
|
|
2635
|
-
"Amount of jlX tokens to move"
|
|
2636
|
-
];
|
|
2637
|
-
"type": "u64";
|
|
2638
|
-
},
|
|
2639
|
-
{
|
|
2640
|
-
"name": "direction";
|
|
2641
|
-
"docs": [
|
|
2642
|
-
"Direction of the transfer"
|
|
2643
|
-
];
|
|
2644
|
-
"type": {
|
|
2645
|
-
"defined": {
|
|
2646
|
-
"name": "Direction";
|
|
2647
|
-
};
|
|
2648
|
-
};
|
|
2649
|
-
}
|
|
2650
|
-
];
|
|
2651
|
-
};
|
|
2652
|
-
},
|
|
2653
|
-
{
|
|
2654
|
-
"name": "STV";
|
|
2655
|
-
"docs": [
|
|
2656
|
-
"STV - Single Token Vault account",
|
|
2657
|
-
"Seeds: [\"stv\", base_mint.key().as_ref()]",
|
|
2658
|
-
"Size: 8 (discriminator) + 200 (data) = 208 bytes"
|
|
2659
|
-
];
|
|
2660
|
-
"serialization": "bytemuck";
|
|
2661
|
-
"repr": {
|
|
2662
|
-
"kind": "c";
|
|
2663
|
-
};
|
|
2664
|
-
"type": {
|
|
2665
|
-
"kind": "struct";
|
|
2666
|
-
"fields": [
|
|
2667
|
-
{
|
|
2668
|
-
"name": "baseMint";
|
|
2669
|
-
"docs": [
|
|
2670
|
-
"Base asset mint (BTC, ETH, SOL, or USDC)"
|
|
2671
|
-
];
|
|
2672
|
-
"type": "pubkey";
|
|
2673
|
-
},
|
|
2674
|
-
{
|
|
2675
|
-
"name": "jlMint";
|
|
2676
|
-
"docs": [
|
|
2677
|
-
"Jupiter Lend token mint (jlBTC, jlETH, jlSOL, jlUSDC, jlJupUSD)"
|
|
2678
|
-
];
|
|
2679
|
-
"type": "pubkey";
|
|
2680
|
-
},
|
|
2681
|
-
{
|
|
2682
|
-
"name": "jvMint";
|
|
2683
|
-
"docs": [
|
|
2684
|
-
"Vault share token mint (jvBTC, jvETH, jvSOL, jvUSDC, jvJupUSD)"
|
|
2685
|
-
];
|
|
2686
|
-
"type": "pubkey";
|
|
2687
|
-
},
|
|
2688
|
-
{
|
|
2689
|
-
"name": "pps";
|
|
2690
|
-
"docs": [
|
|
2691
|
-
"Price per share in base asset terms (scaled by PPS_DECIMALS)"
|
|
2692
|
-
];
|
|
2693
|
-
"type": "u64";
|
|
2694
|
-
},
|
|
2695
|
-
{
|
|
2696
|
-
"name": "hwm";
|
|
2697
|
-
"docs": [
|
|
2698
|
-
"High water mark for performance fee (scaled by PPS_DECIMALS)"
|
|
2699
|
-
];
|
|
2700
|
-
"type": "u64";
|
|
2701
|
-
},
|
|
2702
|
-
{
|
|
2703
|
-
"name": "lastMgmtFeeTs";
|
|
2704
|
-
"docs": [
|
|
2705
|
-
"Timestamp of last management fee accrual"
|
|
2706
|
-
];
|
|
2707
|
-
"type": "u64";
|
|
2708
|
-
},
|
|
2709
|
-
{
|
|
2710
|
-
"name": "baseLoaned";
|
|
2711
|
-
"docs": [
|
|
2712
|
-
"Base asset value loaned to JLP Vault (illiquid assets)",
|
|
2713
|
-
"Updated on: move_stv_to_from_vault (+/-), settle_yield (+/-)",
|
|
2714
|
-
"Denominated in base asset (SOL, BTC, etc.), NOT jlX"
|
|
2715
|
-
];
|
|
2716
|
-
"type": "u64";
|
|
2717
|
-
},
|
|
2718
|
-
{
|
|
2719
|
-
"name": "accruedFeesJlx";
|
|
2720
|
-
"docs": [
|
|
2721
|
-
"Accrued fees in jlX terms (unclaimed, reduces effective NAV for PPS)",
|
|
2722
|
-
"Updated on: crystallize_fees (+), claim_fees (reset to 0)"
|
|
2723
|
-
];
|
|
2724
|
-
"type": "u64";
|
|
2725
|
-
},
|
|
2726
|
-
{
|
|
2727
|
-
"name": "maxDeposit";
|
|
2728
|
-
"docs": [
|
|
2729
|
-
"Maximum deposit amount in base asset (0 = unlimited)"
|
|
2730
|
-
];
|
|
2731
|
-
"type": "u64";
|
|
2732
|
-
},
|
|
2733
|
-
{
|
|
2734
|
-
"name": "minDeposit";
|
|
2735
|
-
"docs": [
|
|
2736
|
-
"Minimum deposit amount in base asset (0 = no minimum)"
|
|
2737
|
-
];
|
|
2738
|
-
"type": "u64";
|
|
2739
|
-
},
|
|
2740
|
-
{
|
|
2741
|
-
"name": "requestedBase";
|
|
2742
|
-
"docs": [
|
|
2743
|
-
"Estimated base for current epoch's withdrawal requests (reset on process_epoch)",
|
|
2744
|
-
"Manager reads this to know how much to unwind before next epoch"
|
|
2745
|
-
];
|
|
2746
|
-
"type": "u64";
|
|
2747
|
-
},
|
|
2748
|
-
{
|
|
2749
|
-
"name": "reservedBase";
|
|
2750
|
-
"docs": [
|
|
2751
|
-
"Base earmarked for unclaimed withdrawals (+process_epoch, -claim_withdraw)",
|
|
2752
|
-
"Subtracted from NAV so reserved funds don't inflate PPS"
|
|
2753
|
-
];
|
|
2754
|
-
"type": "u64";
|
|
2755
|
-
},
|
|
2756
|
-
{
|
|
2757
|
-
"name": "epochPps";
|
|
2758
|
-
"docs": [
|
|
2759
|
-
"PPS locked at first process_epoch batch (0 = not set, reset on epoch advance)"
|
|
2760
|
-
];
|
|
2761
|
-
"type": "u64";
|
|
2762
|
-
},
|
|
2763
|
-
{
|
|
2764
|
-
"name": "nextEpochTs";
|
|
2765
|
-
"docs": [
|
|
2766
|
-
"Unix timestamp when current epoch ends"
|
|
2767
|
-
];
|
|
2768
|
-
"type": "u32";
|
|
2769
|
-
},
|
|
2770
|
-
{
|
|
2771
|
-
"name": "epochSec";
|
|
2772
|
-
"docs": [
|
|
2773
|
-
"Epoch duration in seconds"
|
|
2774
|
-
];
|
|
2775
|
-
"type": "u32";
|
|
2776
|
-
},
|
|
2777
|
-
{
|
|
2778
|
-
"name": "currentEpochId";
|
|
2779
|
-
"docs": [
|
|
2780
|
-
"Incrementing epoch counter"
|
|
2781
|
-
];
|
|
2782
|
-
"type": "u32";
|
|
2783
|
-
},
|
|
2784
|
-
{
|
|
2785
|
-
"name": "mgmtFeeBps";
|
|
2786
|
-
"docs": [
|
|
2787
|
-
"Management fee in basis points (annual)"
|
|
2788
|
-
];
|
|
2789
|
-
"type": "u16";
|
|
2790
|
-
},
|
|
2791
|
-
{
|
|
2792
|
-
"name": "perfFeeBps";
|
|
2793
|
-
"docs": [
|
|
2794
|
-
"Performance fee in basis points"
|
|
2795
|
-
];
|
|
2796
|
-
"type": "u16";
|
|
2797
|
-
},
|
|
2798
|
-
{
|
|
2799
|
-
"name": "flags";
|
|
2800
|
-
"docs": [
|
|
2801
|
-
"STV state flags"
|
|
2802
|
-
];
|
|
2803
|
-
"type": "u16";
|
|
2804
|
-
},
|
|
2805
|
-
{
|
|
2806
|
-
"name": "version";
|
|
2807
|
-
"docs": [
|
|
2808
|
-
"Account version for migrations"
|
|
2809
|
-
];
|
|
2810
|
-
"type": "u8";
|
|
2811
|
-
},
|
|
2812
|
-
{
|
|
2813
|
-
"name": "bump";
|
|
2814
|
-
"docs": [
|
|
2815
|
-
"PDA bump seed"
|
|
2816
|
-
];
|
|
2817
|
-
"type": "u8";
|
|
2818
|
-
},
|
|
2819
|
-
{
|
|
2820
|
-
"name": "Padding";
|
|
2821
|
-
"docs": [
|
|
2822
|
-
"Alignment padding"
|
|
2823
|
-
];
|
|
2824
|
-
"type": {
|
|
2825
|
-
"array": [
|
|
2826
|
-
"u8",
|
|
2827
|
-
4
|
|
2828
|
-
];
|
|
2829
|
-
};
|
|
2830
|
-
}
|
|
2831
|
-
];
|
|
2832
|
-
};
|
|
2833
|
-
},
|
|
2834
|
-
{
|
|
2835
|
-
"name": "SettleYieldEvent";
|
|
2836
|
-
"docs": [
|
|
2837
|
-
"Aggregate yield settlement event - emitted once per settle_yield call"
|
|
2838
|
-
];
|
|
2839
|
-
"type": {
|
|
2840
|
-
"kind": "struct";
|
|
2841
|
-
"fields": [
|
|
2842
|
-
{
|
|
2843
|
-
"name": "vault";
|
|
2844
|
-
"docs": [
|
|
2845
|
-
"The JLP vault"
|
|
2846
|
-
];
|
|
2847
|
-
"type": "pubkey";
|
|
2848
|
-
},
|
|
2849
|
-
{
|
|
2850
|
-
"name": "vaultUsd";
|
|
2851
|
-
"docs": [
|
|
2852
|
-
"Total vault USD value (JLP + staging jlX) with 6 decimals"
|
|
2853
|
-
];
|
|
2854
|
-
"type": "u128";
|
|
2855
|
-
},
|
|
2856
|
-
{
|
|
2857
|
-
"name": "totalLoanedUsd";
|
|
2858
|
-
"docs": [
|
|
2859
|
-
"Total base_loaned USD value across all STVs with 6 decimals"
|
|
2860
|
-
];
|
|
2861
|
-
"type": "u128";
|
|
2862
|
-
},
|
|
2863
|
-
{
|
|
2864
|
-
"name": "deltaUsd";
|
|
2865
|
-
"docs": [
|
|
2866
|
-
"Absolute delta between vault_usd and total_loaned_usd"
|
|
2867
|
-
];
|
|
2868
|
-
"type": "u128";
|
|
2869
|
-
},
|
|
2870
|
-
{
|
|
2871
|
-
"name": "isSurplus";
|
|
2872
|
-
"docs": [
|
|
2873
|
-
"True if vault_usd >= total_loaned_usd (yield), false if deficit (bad debt)"
|
|
2874
|
-
];
|
|
2875
|
-
"type": "bool";
|
|
2876
|
-
},
|
|
2877
|
-
{
|
|
2878
|
-
"name": "timestamp";
|
|
2879
|
-
"docs": [
|
|
2880
|
-
"Settlement timestamp"
|
|
2881
|
-
];
|
|
2882
|
-
"type": "i64";
|
|
2883
|
-
}
|
|
2884
|
-
];
|
|
2885
|
-
};
|
|
2886
|
-
},
|
|
2887
|
-
{
|
|
2888
|
-
"name": "SettleYieldSkipped";
|
|
2889
|
-
"docs": [
|
|
2890
|
-
"Event emitted when settle_yield returns early (no loans outstanding)"
|
|
2891
|
-
];
|
|
2892
|
-
"type": {
|
|
2893
|
-
"kind": "struct";
|
|
2894
|
-
"fields": [
|
|
2895
|
-
{
|
|
2896
|
-
"name": "vault";
|
|
2897
|
-
"docs": [
|
|
2898
|
-
"The JLP vault"
|
|
2899
|
-
];
|
|
2900
|
-
"type": "pubkey";
|
|
2901
|
-
},
|
|
2902
|
-
{
|
|
2903
|
-
"name": "reason";
|
|
2904
|
-
"docs": [
|
|
2905
|
-
"Reason for skipping: \"NoLoansOutstanding\""
|
|
2906
|
-
];
|
|
2907
|
-
"type": "string";
|
|
2908
|
-
}
|
|
2909
|
-
];
|
|
2910
|
-
};
|
|
2911
|
-
},
|
|
2912
|
-
{
|
|
2913
|
-
"name": "SettleYieldStvEvent";
|
|
2914
|
-
"docs": [
|
|
2915
|
-
"Per-STV yield settlement event - emitted for each STV with non-zero base_loaned"
|
|
2916
|
-
];
|
|
2917
|
-
"type": {
|
|
2918
|
-
"kind": "struct";
|
|
2919
|
-
"fields": [
|
|
2920
|
-
{
|
|
2921
|
-
"name": "stv";
|
|
2922
|
-
"docs": [
|
|
2923
|
-
"The STV account"
|
|
2924
|
-
];
|
|
2925
|
-
"type": "pubkey";
|
|
2926
|
-
},
|
|
2927
|
-
{
|
|
2928
|
-
"name": "oldBaseLoaned";
|
|
2929
|
-
"docs": [
|
|
2930
|
-
"base_loaned before settlement"
|
|
2931
|
-
];
|
|
2932
|
-
"type": "u64";
|
|
2933
|
-
},
|
|
2934
|
-
{
|
|
2935
|
-
"name": "newBaseLoaned";
|
|
2936
|
-
"docs": [
|
|
2937
|
-
"base_loaned after settlement"
|
|
2938
|
-
];
|
|
2939
|
-
"type": "u64";
|
|
2940
|
-
},
|
|
2941
|
-
{
|
|
2942
|
-
"name": "adjustmentBase";
|
|
2943
|
-
"docs": [
|
|
2944
|
-
"Adjustment amount in base asset terms"
|
|
2945
|
-
];
|
|
2946
|
-
"type": "u64";
|
|
2947
|
-
},
|
|
2948
|
-
{
|
|
2949
|
-
"name": "isSurplus";
|
|
2950
|
-
"docs": [
|
|
2951
|
-
"True if surplus (yield added), false if deficit (bad debt deducted)"
|
|
2952
|
-
];
|
|
2953
|
-
"type": "bool";
|
|
2954
|
-
}
|
|
2955
|
-
];
|
|
2956
|
-
};
|
|
2957
|
-
},
|
|
2958
|
-
{
|
|
2959
|
-
"name": "StvInitialized";
|
|
2960
|
-
"type": {
|
|
2961
|
-
"kind": "struct";
|
|
2962
|
-
"fields": [
|
|
2963
|
-
{
|
|
2964
|
-
"name": "stv";
|
|
2965
|
-
"type": "pubkey";
|
|
2966
|
-
},
|
|
2967
|
-
{
|
|
2968
|
-
"name": "baseMint";
|
|
2969
|
-
"type": "pubkey";
|
|
2970
|
-
},
|
|
2971
|
-
{
|
|
2972
|
-
"name": "jlMint";
|
|
2973
|
-
"type": "pubkey";
|
|
2974
|
-
},
|
|
2975
|
-
{
|
|
2976
|
-
"name": "jvMint";
|
|
2977
|
-
"type": "pubkey";
|
|
2978
|
-
}
|
|
2979
|
-
];
|
|
2980
|
-
};
|
|
2981
|
-
},
|
|
2982
|
-
{
|
|
2983
|
-
"name": "StvUpdated";
|
|
2984
|
-
"type": {
|
|
2985
|
-
"kind": "struct";
|
|
2986
|
-
"fields": [
|
|
2987
|
-
{
|
|
2988
|
-
"name": "stv";
|
|
2989
|
-
"type": "pubkey";
|
|
2990
|
-
},
|
|
2991
|
-
{
|
|
2992
|
-
"name": "baseMint";
|
|
2993
|
-
"type": "pubkey";
|
|
2994
|
-
},
|
|
2995
|
-
{
|
|
2996
|
-
"name": "oldMgmtFeeBps";
|
|
2997
|
-
"type": "u16";
|
|
2998
|
-
},
|
|
2999
|
-
{
|
|
3000
|
-
"name": "newMgmtFeeBps";
|
|
3001
|
-
"type": "u16";
|
|
3002
|
-
},
|
|
3003
|
-
{
|
|
3004
|
-
"name": "oldPerfFeeBps";
|
|
3005
|
-
"type": "u16";
|
|
3006
|
-
},
|
|
3007
|
-
{
|
|
3008
|
-
"name": "newPerfFeeBps";
|
|
3009
|
-
"type": "u16";
|
|
3010
|
-
},
|
|
3011
|
-
{
|
|
3012
|
-
"name": "oldFlags";
|
|
3013
|
-
"type": "u16";
|
|
3014
|
-
},
|
|
3015
|
-
{
|
|
3016
|
-
"name": "newFlags";
|
|
3017
|
-
"type": "u16";
|
|
3018
|
-
},
|
|
3019
|
-
{
|
|
3020
|
-
"name": "oldMaxDeposit";
|
|
3021
|
-
"type": "u64";
|
|
3022
|
-
},
|
|
3023
|
-
{
|
|
3024
|
-
"name": "newMaxDeposit";
|
|
3025
|
-
"type": "u64";
|
|
3026
|
-
},
|
|
3027
|
-
{
|
|
3028
|
-
"name": "oldMinDeposit";
|
|
3029
|
-
"type": "u64";
|
|
3030
|
-
},
|
|
3031
|
-
{
|
|
3032
|
-
"name": "newMinDeposit";
|
|
3033
|
-
"type": "u64";
|
|
3034
|
-
},
|
|
3035
|
-
{
|
|
3036
|
-
"name": "oldJlMint";
|
|
3037
|
-
"type": "pubkey";
|
|
3038
|
-
},
|
|
3039
|
-
{
|
|
3040
|
-
"name": "newJlMint";
|
|
3041
|
-
"type": "pubkey";
|
|
3042
|
-
}
|
|
3043
|
-
];
|
|
3044
|
-
};
|
|
3045
|
-
},
|
|
3046
|
-
{
|
|
3047
|
-
"name": "SwapDirection";
|
|
3048
|
-
"docs": [
|
|
3049
|
-
"Direction of the swap operation"
|
|
3050
|
-
];
|
|
3051
|
-
"type": {
|
|
3052
|
-
"kind": "enum";
|
|
3053
|
-
"variants": [
|
|
3054
|
-
{
|
|
3055
|
-
"name": "JlxToJlp";
|
|
3056
|
-
},
|
|
3057
|
-
{
|
|
3058
|
-
"name": "JlpToJlx";
|
|
3059
|
-
}
|
|
3060
|
-
];
|
|
3061
|
-
};
|
|
3062
|
-
},
|
|
3063
|
-
{
|
|
3064
|
-
"name": "SwapJlxJlpParams";
|
|
3065
|
-
"docs": [
|
|
3066
|
-
"Parameters for the swap instruction"
|
|
3067
|
-
];
|
|
3068
|
-
"type": {
|
|
3069
|
-
"kind": "struct";
|
|
3070
|
-
"fields": [
|
|
3071
|
-
{
|
|
3072
|
-
"name": "stvIndex";
|
|
3073
|
-
"docs": [
|
|
3074
|
-
"Which STV this JLP belongs to (0-4: BTC, ETH, SOL, USDC, JupUSD)"
|
|
3075
|
-
];
|
|
3076
|
-
"type": "u8";
|
|
3077
|
-
},
|
|
3078
|
-
{
|
|
3079
|
-
"name": "direction";
|
|
3080
|
-
"docs": [
|
|
3081
|
-
"Direction of the swap"
|
|
3082
|
-
];
|
|
3083
|
-
"type": {
|
|
3084
|
-
"defined": {
|
|
3085
|
-
"name": "SwapDirection";
|
|
3086
|
-
};
|
|
3087
|
-
};
|
|
3088
|
-
},
|
|
3089
|
-
{
|
|
3090
|
-
"name": "amountIn";
|
|
3091
|
-
"docs": [
|
|
3092
|
-
"Amount of input token being swapped"
|
|
3093
|
-
];
|
|
3094
|
-
"type": "u64";
|
|
3095
|
-
},
|
|
3096
|
-
{
|
|
3097
|
-
"name": "expectedAmountOut";
|
|
3098
|
-
"docs": [
|
|
3099
|
-
"Expected output amount (used for devnet mock, verified on mainnet)"
|
|
3100
|
-
];
|
|
3101
|
-
"type": "u64";
|
|
3102
|
-
},
|
|
3103
|
-
{
|
|
3104
|
-
"name": "jupiterData";
|
|
3105
|
-
"docs": [
|
|
3106
|
-
"Jupiter swap instruction data (includes discriminator and route)",
|
|
3107
|
-
"This is obtained from Jupiter API off-chain",
|
|
3108
|
-
"On devnet (with `devnet` feature), this can be empty"
|
|
3109
|
-
];
|
|
3110
|
-
"type": "bytes";
|
|
3111
|
-
}
|
|
3112
|
-
];
|
|
3113
|
-
};
|
|
3114
|
-
},
|
|
3115
|
-
{
|
|
3116
|
-
"name": "UpdateStvParams";
|
|
3117
|
-
"docs": [
|
|
3118
|
-
"Parameters for updating an STV"
|
|
3119
|
-
];
|
|
3120
|
-
"type": {
|
|
3121
|
-
"kind": "struct";
|
|
3122
|
-
"fields": [
|
|
3123
|
-
{
|
|
3124
|
-
"name": "mgmtFeeBps";
|
|
3125
|
-
"docs": [
|
|
3126
|
-
"Management fee in basis points (annual)"
|
|
3127
|
-
];
|
|
3128
|
-
"type": "u16";
|
|
3129
|
-
},
|
|
3130
|
-
{
|
|
3131
|
-
"name": "perfFeeBps";
|
|
3132
|
-
"docs": [
|
|
3133
|
-
"Performance fee in basis points"
|
|
3134
|
-
];
|
|
3135
|
-
"type": "u16";
|
|
3136
|
-
},
|
|
3137
|
-
{
|
|
3138
|
-
"name": "flags";
|
|
3139
|
-
"docs": [
|
|
3140
|
-
"STV state flags"
|
|
3141
|
-
];
|
|
3142
|
-
"type": "u16";
|
|
3143
|
-
},
|
|
3144
|
-
{
|
|
3145
|
-
"name": "maxDeposit";
|
|
3146
|
-
"docs": [
|
|
3147
|
-
"Maximum deposit amount in base asset (0 = unlimited)"
|
|
3148
|
-
];
|
|
3149
|
-
"type": "u64";
|
|
3150
|
-
},
|
|
3151
|
-
{
|
|
3152
|
-
"name": "minDeposit";
|
|
3153
|
-
"docs": [
|
|
3154
|
-
"Minimum deposit amount in base asset (0 = no minimum)"
|
|
3155
|
-
];
|
|
3156
|
-
"type": "u64";
|
|
3157
|
-
},
|
|
3158
|
-
{
|
|
3159
|
-
"name": "jlMint";
|
|
3160
|
-
"docs": [
|
|
3161
|
-
"Optional new jl_mint for migrating base-only pools to Jupiter Lend"
|
|
3162
|
-
];
|
|
3163
|
-
"type": {
|
|
3164
|
-
"option": "pubkey";
|
|
3165
|
-
};
|
|
3166
|
-
},
|
|
3167
|
-
{
|
|
3168
|
-
"name": "pps";
|
|
3169
|
-
"docs": [
|
|
3170
|
-
"Override price per share (9 decimals, e.g. 1_000_000_000 = 1.0)"
|
|
3171
|
-
];
|
|
3172
|
-
"type": {
|
|
3173
|
-
"option": "u64";
|
|
3174
|
-
};
|
|
3175
|
-
},
|
|
3176
|
-
{
|
|
3177
|
-
"name": "hwm";
|
|
3178
|
-
"docs": [
|
|
3179
|
-
"Override high water mark (9 decimals)"
|
|
3180
|
-
];
|
|
3181
|
-
"type": {
|
|
3182
|
-
"option": "u64";
|
|
3183
|
-
};
|
|
3184
|
-
},
|
|
3185
|
-
{
|
|
3186
|
-
"name": "baseLoaned";
|
|
3187
|
-
"docs": [
|
|
3188
|
-
"Override base_loaned accounting field"
|
|
3189
|
-
];
|
|
3190
|
-
"type": {
|
|
3191
|
-
"option": "u64";
|
|
3192
|
-
};
|
|
3193
|
-
},
|
|
3194
|
-
{
|
|
3195
|
-
"name": "epochSec";
|
|
3196
|
-
"docs": [
|
|
3197
|
-
"Optional new epoch duration in seconds"
|
|
3198
|
-
];
|
|
3199
|
-
"type": {
|
|
3200
|
-
"option": "u32";
|
|
3201
|
-
};
|
|
3202
|
-
}
|
|
3203
|
-
];
|
|
3204
|
-
};
|
|
3205
|
-
},
|
|
3206
|
-
{
|
|
3207
|
-
"name": "WithdrawClaimed";
|
|
3208
|
-
"type": {
|
|
3209
|
-
"kind": "struct";
|
|
3210
|
-
"fields": [
|
|
3211
|
-
{
|
|
3212
|
-
"name": "stv";
|
|
3213
|
-
"type": "pubkey";
|
|
3214
|
-
},
|
|
3215
|
-
{
|
|
3216
|
-
"name": "user";
|
|
3217
|
-
"type": "pubkey";
|
|
3218
|
-
},
|
|
3219
|
-
{
|
|
3220
|
-
"name": "shares";
|
|
3221
|
-
"type": "u64";
|
|
3222
|
-
},
|
|
3223
|
-
{
|
|
3224
|
-
"name": "baseAmount";
|
|
3225
|
-
"type": "u64";
|
|
3226
|
-
},
|
|
3227
|
-
{
|
|
3228
|
-
"name": "epochId";
|
|
3229
|
-
"type": "u32";
|
|
3230
|
-
}
|
|
3231
|
-
];
|
|
3232
|
-
};
|
|
3233
|
-
},
|
|
3234
|
-
{
|
|
3235
|
-
"name": "WithdrawRequest";
|
|
3236
|
-
"docs": [
|
|
3237
|
-
"WithdrawRequest - Per-user per-epoch withdrawal request",
|
|
3238
|
-
"Seeds: [\"withdraw_request\", stv.key(), user.key(), &epoch_id.to_le_bytes()]",
|
|
3239
|
-
"",
|
|
3240
|
-
"One PDA per user per STV per epoch. Multiple request_withdraw calls",
|
|
3241
|
-
"in the same epoch accumulate into the same PDA.",
|
|
3242
|
-
"",
|
|
3243
|
-
"Lifecycle:",
|
|
3244
|
-
"1. Created by request_withdraw (user escrows jvX into request's ATA)",
|
|
3245
|
-
"2. Processed by process_epoch (jvX burned, pps + claim_available_after set)",
|
|
3246
|
-
"3. Closed by claim_withdraw (base transferred, PDA + ATA closed)"
|
|
3247
|
-
];
|
|
3248
|
-
"type": {
|
|
3249
|
-
"kind": "struct";
|
|
3250
|
-
"fields": [
|
|
3251
|
-
{
|
|
3252
|
-
"name": "stv";
|
|
3253
|
-
"docs": [
|
|
3254
|
-
"Back-reference to the STV"
|
|
3255
|
-
];
|
|
3256
|
-
"type": "pubkey";
|
|
3257
|
-
},
|
|
3258
|
-
{
|
|
3259
|
-
"name": "user";
|
|
3260
|
-
"docs": [
|
|
3261
|
-
"The user who requested the withdrawal"
|
|
3262
|
-
];
|
|
3263
|
-
"type": "pubkey";
|
|
3264
|
-
},
|
|
3265
|
-
{
|
|
3266
|
-
"name": "shares";
|
|
3267
|
-
"docs": [
|
|
3268
|
-
"Total jvX shares escrowed (accumulated across multiple requests in same epoch)"
|
|
3269
|
-
];
|
|
3270
|
-
"type": "u64";
|
|
3271
|
-
},
|
|
3272
|
-
{
|
|
3273
|
-
"name": "pps";
|
|
3274
|
-
"docs": [
|
|
3275
|
-
"PPS at process time (0 = unprocessed)"
|
|
3276
|
-
];
|
|
3277
|
-
"type": "u64";
|
|
3278
|
-
},
|
|
3279
|
-
{
|
|
3280
|
-
"name": "epochId";
|
|
3281
|
-
"docs": [
|
|
3282
|
-
"Epoch when request was made"
|
|
3283
|
-
];
|
|
3284
|
-
"type": "u32";
|
|
3285
|
-
},
|
|
3286
|
-
{
|
|
3287
|
-
"name": "claimAvailableAfter";
|
|
3288
|
-
"docs": [
|
|
3289
|
-
"Unix timestamp after which claim is available (0 = unprocessed)"
|
|
3290
|
-
];
|
|
3291
|
-
"type": "u32";
|
|
3292
|
-
},
|
|
3293
|
-
{
|
|
3294
|
-
"name": "bump";
|
|
3295
|
-
"docs": [
|
|
3296
|
-
"PDA bump seed"
|
|
3297
|
-
];
|
|
3298
|
-
"type": "u8";
|
|
3299
|
-
}
|
|
3300
|
-
];
|
|
3301
|
-
};
|
|
3302
|
-
},
|
|
3303
|
-
{
|
|
3304
|
-
"name": "WithdrawRequested";
|
|
3305
|
-
"type": {
|
|
3306
|
-
"kind": "struct";
|
|
3307
|
-
"fields": [
|
|
3308
|
-
{
|
|
3309
|
-
"name": "stv";
|
|
3310
|
-
"type": "pubkey";
|
|
3311
|
-
},
|
|
3312
|
-
{
|
|
3313
|
-
"name": "user";
|
|
3314
|
-
"type": "pubkey";
|
|
3315
|
-
},
|
|
3316
|
-
{
|
|
3317
|
-
"name": "shares";
|
|
3318
|
-
"type": "u64";
|
|
3319
|
-
},
|
|
3320
|
-
{
|
|
3321
|
-
"name": "totalShares";
|
|
3322
|
-
"type": "u64";
|
|
3323
|
-
},
|
|
3324
|
-
{
|
|
3325
|
-
"name": "epochId";
|
|
3326
|
-
"type": "u32";
|
|
3327
|
-
}
|
|
3328
|
-
];
|
|
3329
|
-
};
|
|
3330
|
-
}
|
|
3331
|
-
];
|
|
3332
|
-
};
|
|
3333
|
-
|
|
3334
|
-
type PoolName = "SOL" | "USDC" | "JupUSD" | "BTC" | "ETH";
|
|
3335
|
-
type JupEarnDirection = "Deposit" | "Withdraw";
|
|
3336
|
-
type MoveDirection = "ToVault" | "FromVault";
|
|
3337
|
-
type SwapDirection = "JlxToJlp" | "JlpToJlx";
|
|
3338
|
-
interface JLPVault {
|
|
3339
|
-
admin: PublicKey;
|
|
3340
|
-
manager: PublicKey;
|
|
3341
|
-
feeReceiver: PublicKey;
|
|
3342
|
-
jlpMint: PublicKey;
|
|
3343
|
-
baseAssetMints: PublicKey[];
|
|
3344
|
-
jlxAssetMints: PublicKey[];
|
|
3345
|
-
oracleStalenessThreshold: BN;
|
|
3346
|
-
flags: number;
|
|
3347
|
-
jlpSlippageBps: number;
|
|
3348
|
-
version: number;
|
|
3349
|
-
bump: number;
|
|
3350
|
-
}
|
|
3351
|
-
interface STV {
|
|
3352
|
-
baseMint: PublicKey;
|
|
3353
|
-
jlMint: PublicKey;
|
|
3354
|
-
jvMint: PublicKey;
|
|
3355
|
-
pps: BN;
|
|
3356
|
-
hwm: BN;
|
|
3357
|
-
lastMgmtFeeTs: BN;
|
|
3358
|
-
baseLoaned: BN;
|
|
3359
|
-
accruedFeesJlx: BN;
|
|
3360
|
-
maxDeposit: BN;
|
|
3361
|
-
minDeposit: BN;
|
|
3362
|
-
requestedBase: BN;
|
|
3363
|
-
reservedBase: BN;
|
|
3364
|
-
epochPps: BN;
|
|
3365
|
-
nextEpochTs: number;
|
|
3366
|
-
epochSec: number;
|
|
3367
|
-
currentEpochId: number;
|
|
3368
|
-
mgmtFeeBps: number;
|
|
3369
|
-
perfFeeBps: number;
|
|
3370
|
-
flags: number;
|
|
3371
|
-
version: number;
|
|
3372
|
-
bump: number;
|
|
3373
|
-
}
|
|
3374
|
-
interface WithdrawRequest {
|
|
3375
|
-
stv: PublicKey;
|
|
3376
|
-
user: PublicKey;
|
|
3377
|
-
shares: BN;
|
|
3378
|
-
pps: BN;
|
|
3379
|
-
epochId: number;
|
|
3380
|
-
claimAvailableAfter: number;
|
|
3381
|
-
bump: number;
|
|
3382
|
-
}
|
|
3383
|
-
interface ExchangeRateResult {
|
|
3384
|
-
rate: number;
|
|
3385
|
-
rawRate: bigint;
|
|
3386
|
-
storedRate: number;
|
|
3387
|
-
staleness: number;
|
|
3388
|
-
isFresh: boolean;
|
|
3389
|
-
}
|
|
3390
|
-
interface JupiterLendPool {
|
|
3391
|
-
mint: PublicKey;
|
|
3392
|
-
name: PoolName;
|
|
3393
|
-
lending: PublicKey;
|
|
3394
|
-
fTokenMint: PublicKey;
|
|
3395
|
-
tokenReservesLiquidity: PublicKey;
|
|
3396
|
-
supplyPositionOnLiquidity: PublicKey;
|
|
3397
|
-
rewardsRateModel: PublicKey;
|
|
3398
|
-
vault: PublicKey;
|
|
3399
|
-
rateModel: PublicKey;
|
|
3400
|
-
claimAccount: PublicKey;
|
|
3401
|
-
decimals: number;
|
|
3402
|
-
stvIndex: number;
|
|
3403
|
-
hasJupiterLend: boolean;
|
|
3404
|
-
jupDirectSwap: boolean;
|
|
3405
|
-
}
|
|
3406
|
-
interface AccountMeta {
|
|
3407
|
-
pubkey: PublicKey;
|
|
3408
|
-
isSigner: boolean;
|
|
3409
|
-
isWritable: boolean;
|
|
3410
|
-
}
|
|
3411
|
-
interface SwapQuote {
|
|
3412
|
-
inputMint: PublicKey;
|
|
3413
|
-
outputMint: PublicKey;
|
|
3414
|
-
inAmount: BN;
|
|
3415
|
-
outAmount: BN;
|
|
3416
|
-
minOutAmount: BN;
|
|
3417
|
-
priceImpactPct: number;
|
|
3418
|
-
route: string[];
|
|
3419
|
-
jupiterData: Buffer;
|
|
3420
|
-
remainingAccounts: AccountMeta[];
|
|
3421
|
-
addressLookupTables: AddressLookupTableAccount[];
|
|
3422
|
-
computeUnitLimit: number;
|
|
3423
|
-
}
|
|
3424
|
-
interface LendingAccountData {
|
|
3425
|
-
mint: PublicKey;
|
|
3426
|
-
fTokenMint: PublicKey;
|
|
3427
|
-
lendingId: number;
|
|
3428
|
-
decimals: number;
|
|
3429
|
-
rewardsRateModel: PublicKey;
|
|
3430
|
-
liquidityExchangePrice: bigint;
|
|
3431
|
-
tokenExchangePrice: bigint;
|
|
3432
|
-
lastUpdateTimestamp: bigint;
|
|
3433
|
-
tokenReservesLiquidity: PublicKey;
|
|
3434
|
-
supplyPositionOnLiquidity: PublicKey;
|
|
3435
|
-
bump: number;
|
|
3436
|
-
}
|
|
3437
|
-
interface RewardsRateModelData {
|
|
3438
|
-
mint: PublicKey;
|
|
3439
|
-
startTvl: bigint;
|
|
3440
|
-
duration: bigint;
|
|
3441
|
-
startTime: bigint;
|
|
3442
|
-
yearlyReward: bigint;
|
|
3443
|
-
nextDuration: bigint;
|
|
3444
|
-
nextRewardAmount: bigint;
|
|
3445
|
-
bump: number;
|
|
3446
|
-
}
|
|
3447
|
-
interface UpdateVaultParams {
|
|
3448
|
-
jlpMint?: PublicKey | null;
|
|
3449
|
-
baseAssetMints?: PublicKey[] | null;
|
|
3450
|
-
jlxAssetMints?: PublicKey[] | null;
|
|
3451
|
-
newAdmin?: PublicKey | null;
|
|
3452
|
-
manager?: PublicKey;
|
|
3453
|
-
feeReceiver?: PublicKey;
|
|
3454
|
-
oracleStalenessThreshold?: BN | null;
|
|
3455
|
-
jlpSlippageBps?: number;
|
|
3456
|
-
flags?: number;
|
|
3457
|
-
}
|
|
3458
|
-
interface UpdateStvParams$1 {
|
|
3459
|
-
mgmtFeeBps?: number;
|
|
3460
|
-
perfFeeBps?: number;
|
|
3461
|
-
maxDeposit?: BN;
|
|
3462
|
-
minDeposit?: BN;
|
|
3463
|
-
flags?: number;
|
|
3464
|
-
jlMint?: PublicKey;
|
|
3465
|
-
pps?: BN;
|
|
3466
|
-
hwm?: BN;
|
|
3467
|
-
baseLoaned?: BN;
|
|
3468
|
-
epochSec?: number;
|
|
3469
|
-
}
|
|
3470
|
-
interface InitializeStvParams$1 {
|
|
3471
|
-
poolName: PoolName;
|
|
3472
|
-
mgmtFeeBps: number;
|
|
3473
|
-
perfFeeBps: number;
|
|
3474
|
-
maxDeposit: BN;
|
|
3475
|
-
minDeposit: BN;
|
|
3476
|
-
withdrawEpochSec: number;
|
|
3477
|
-
}
|
|
3478
|
-
interface JupiterQuoteResponse {
|
|
3479
|
-
inputMint: string;
|
|
3480
|
-
inAmount: string;
|
|
3481
|
-
outputMint: string;
|
|
3482
|
-
outAmount: string;
|
|
3483
|
-
otherAmountThreshold: string;
|
|
3484
|
-
swapMode: string;
|
|
3485
|
-
slippageBps: number;
|
|
3486
|
-
platformFee: {
|
|
3487
|
-
amount: string;
|
|
3488
|
-
feeBps: number;
|
|
3489
|
-
} | null;
|
|
3490
|
-
priceImpactPct: string;
|
|
3491
|
-
routePlan: Array<{
|
|
3492
|
-
swapInfo: {
|
|
3493
|
-
ammKey: string;
|
|
3494
|
-
label?: string;
|
|
3495
|
-
inputMint: string;
|
|
3496
|
-
outputMint: string;
|
|
3497
|
-
inAmount: string;
|
|
3498
|
-
outAmount: string;
|
|
3499
|
-
feeAmount: string;
|
|
3500
|
-
feeMint: string;
|
|
3501
|
-
};
|
|
3502
|
-
percent: number;
|
|
3503
|
-
}>;
|
|
3504
|
-
contextSlot?: number;
|
|
3505
|
-
timeTaken?: number;
|
|
3506
|
-
}
|
|
3507
|
-
interface JupiterSwapInstructionsResponse {
|
|
3508
|
-
tokenLedgerInstruction: SerializedInstruction | null;
|
|
3509
|
-
computeBudgetInstructions: SerializedInstruction[];
|
|
3510
|
-
setupInstructions: SerializedInstruction[];
|
|
3511
|
-
swapInstruction: SerializedInstruction;
|
|
3512
|
-
cleanupInstruction: SerializedInstruction | null;
|
|
3513
|
-
addressLookupTableAddresses: string[];
|
|
3514
|
-
computeUnitLimit?: number;
|
|
3515
|
-
error?: string;
|
|
3516
|
-
}
|
|
3517
|
-
interface SerializedInstruction {
|
|
3518
|
-
programId: string;
|
|
3519
|
-
accounts: Array<{
|
|
3520
|
-
pubkey: string;
|
|
3521
|
-
isSigner: boolean;
|
|
3522
|
-
isWritable: boolean;
|
|
3523
|
-
}>;
|
|
3524
|
-
data: string;
|
|
3525
|
-
}
|
|
3526
|
-
|
|
3527
|
-
declare class JlpdClientError extends Error {
|
|
3528
|
-
constructor(message: string);
|
|
3529
|
-
}
|
|
3530
|
-
interface DepositParams {
|
|
3531
|
-
user: PublicKey;
|
|
3532
|
-
amount: BN;
|
|
3533
|
-
}
|
|
3534
|
-
interface RequestWithdrawParams {
|
|
3535
|
-
user: PublicKey;
|
|
3536
|
-
shares: BN;
|
|
3537
|
-
}
|
|
3538
|
-
interface ClaimWithdrawParams {
|
|
3539
|
-
user: PublicKey;
|
|
3540
|
-
epochId: number;
|
|
3541
|
-
}
|
|
3542
|
-
interface JupEarnParams$1 {
|
|
3543
|
-
manager: PublicKey;
|
|
3544
|
-
direction: JupEarnDirection;
|
|
3545
|
-
amount: BN;
|
|
3546
|
-
}
|
|
3547
|
-
interface MoveJlxParams$1 {
|
|
3548
|
-
manager: PublicKey;
|
|
3549
|
-
direction: MoveDirection;
|
|
3550
|
-
jlxAmount: BN;
|
|
3551
|
-
}
|
|
3552
|
-
interface ClaimFeesParams {
|
|
3553
|
-
manager: PublicKey;
|
|
3554
|
-
}
|
|
3555
|
-
interface SwapJlxJlpParams$1 {
|
|
3556
|
-
manager: PublicKey;
|
|
3557
|
-
pool: PoolName;
|
|
3558
|
-
direction: SwapDirection;
|
|
3559
|
-
amountIn: BN;
|
|
3560
|
-
expectedOut: BN;
|
|
3561
|
-
quote: SwapQuote;
|
|
3562
|
-
}
|
|
3563
|
-
interface SettleYieldParams {
|
|
3564
|
-
manager: PublicKey;
|
|
3565
|
-
}
|
|
3566
|
-
interface ProcessEpochParams {
|
|
3567
|
-
payer: PublicKey;
|
|
3568
|
-
poolName: PoolName;
|
|
3569
|
-
withdrawRequests: PublicKey[];
|
|
3570
|
-
}
|
|
3571
|
-
/**
|
|
3572
|
-
* Main SDK client for JLP.D program
|
|
3573
|
-
*/
|
|
3574
|
-
declare class JlpdClient {
|
|
3575
|
-
readonly connection: Connection;
|
|
3576
|
-
readonly programId: PublicKey;
|
|
3577
|
-
readonly program: Program<JlpDProgram>;
|
|
3578
|
-
readonly vaultPda: PublicKey;
|
|
3579
|
-
readonly vaultBump: number;
|
|
3580
|
-
readonly jupiterApiKey?: string;
|
|
3581
|
-
private readonly poolContextCache;
|
|
3582
|
-
constructor(connection: Connection, programId?: PublicKey, options?: {
|
|
3583
|
-
jupiterApiKey?: string;
|
|
3584
|
-
});
|
|
3585
|
-
static mainnet(connection: Connection, options?: {
|
|
3586
|
-
jupiterApiKey?: string;
|
|
3587
|
-
}): JlpdClient;
|
|
3588
|
-
static devnet(connection: Connection, options?: {
|
|
3589
|
-
jupiterApiKey?: string;
|
|
3590
|
-
}): JlpdClient;
|
|
3591
|
-
fetchVault(): Promise<JLPVault | null>;
|
|
3592
|
-
fetchStv(baseMint: PublicKey): Promise<STV | null>;
|
|
3593
|
-
fetchExchangeRate(poolName: PoolName): Promise<ExchangeRateResult>;
|
|
3594
|
-
/**
|
|
3595
|
-
* Calculate APY based on PPS growth over time
|
|
3596
|
-
*
|
|
3597
|
-
* @param poolName Pool to calculate APY for
|
|
3598
|
-
* @param startPps PPS at the start of the period (as BN with 9 decimals)
|
|
3599
|
-
* @param startTime Unix timestamp (seconds) when startPps was recorded
|
|
3600
|
-
* @returns APY as a decimal (e.g., 0.12 = 12% APY)
|
|
3601
|
-
*
|
|
3602
|
-
* @example
|
|
3603
|
-
* ```typescript
|
|
3604
|
-
* // Calculate APY from a week ago
|
|
3605
|
-
* const startPps = new BN("1050000000"); // 1.05 (9 decimals)
|
|
3606
|
-
* const startTime = Math.floor(Date.now() / 1000) - 7 * 24 * 60 * 60;
|
|
3607
|
-
* const apy = await client.calculateApy("SOL", startPps, startTime);
|
|
3608
|
-
* console.log(`APY: ${(apy * 100).toFixed(2)}%`);
|
|
3609
|
-
* ```
|
|
3610
|
-
*/
|
|
3611
|
-
calculateApy(poolName: PoolName, startPps: BN, startTime: number): Promise<number>;
|
|
3612
|
-
/**
|
|
3613
|
-
* Calculate simple APY (non-compounded) based on PPS growth
|
|
3614
|
-
*
|
|
3615
|
-
* @param poolName Pool to calculate APY for
|
|
3616
|
-
* @param startPps PPS at the start of the period
|
|
3617
|
-
* @param startTime Unix timestamp when startPps was recorded
|
|
3618
|
-
* @returns Simple APY as a decimal
|
|
3619
|
-
*/
|
|
3620
|
-
calculateSimpleApy(poolName: PoolName, startPps: BN, startTime: number): Promise<number>;
|
|
3621
|
-
pool(poolNameOrMint: PoolName | PublicKey): PoolContext;
|
|
3622
|
-
swap(): SwapContext;
|
|
3623
|
-
admin(): AdminContext;
|
|
3624
|
-
buildTransaction(payer: PublicKey, ixs: TransactionInstruction[], alts?: AddressLookupTableAccount[]): Promise<VersionedTransaction>;
|
|
3625
|
-
}
|
|
3626
|
-
/**
|
|
3627
|
-
* Context for pool-specific operations
|
|
3628
|
-
*/
|
|
3629
|
-
declare class PoolContext {
|
|
3630
|
-
readonly client: JlpdClient;
|
|
3631
|
-
readonly pool: JupiterLendPool;
|
|
3632
|
-
readonly stvPda: PublicKey;
|
|
3633
|
-
readonly stvBump: number;
|
|
3634
|
-
readonly vaultStagingAta: PublicKey;
|
|
3635
|
-
readonly vaultJlpAta: PublicKey;
|
|
3636
|
-
readonly vaultBaseAta: PublicKey;
|
|
3637
|
-
readonly stvBaseAta: PublicKey;
|
|
3638
|
-
readonly stvJlxAta: PublicKey;
|
|
3639
|
-
constructor(client: JlpdClient, pool: JupiterLendPool);
|
|
3640
|
-
deposit(params: DepositParams): Promise<VersionedTransaction>;
|
|
3641
|
-
requestWithdraw(params: RequestWithdrawParams): Promise<VersionedTransaction>;
|
|
3642
|
-
claimWithdraw(params: ClaimWithdrawParams): Promise<VersionedTransaction>;
|
|
3643
|
-
jupEarn(params: JupEarnParams$1): Promise<VersionedTransaction>;
|
|
3644
|
-
moveJlx(params: MoveJlxParams$1): Promise<VersionedTransaction>;
|
|
3645
|
-
claimFees(params: ClaimFeesParams): Promise<VersionedTransaction>;
|
|
3646
|
-
updateStv(params: {
|
|
3647
|
-
admin: PublicKey;
|
|
3648
|
-
} & UpdateStvParams$1): Promise<VersionedTransaction>;
|
|
3649
|
-
}
|
|
3650
|
-
/**
|
|
3651
|
-
* Context for swap operations
|
|
3652
|
-
*/
|
|
3653
|
-
declare class SwapContext {
|
|
3654
|
-
readonly client: JlpdClient;
|
|
3655
|
-
constructor(client: JlpdClient);
|
|
3656
|
-
quoteJlxJlp(params: {
|
|
3657
|
-
pool: PoolName;
|
|
3658
|
-
direction: SwapDirection;
|
|
3659
|
-
amountIn: BN;
|
|
3660
|
-
slippageBps?: number;
|
|
3661
|
-
}): Promise<SwapQuote>;
|
|
3662
|
-
swapJlxJlp(params: SwapJlxJlpParams$1): Promise<VersionedTransaction>;
|
|
3663
|
-
}
|
|
3664
|
-
/**
|
|
3665
|
-
* Context for admin operations
|
|
3666
|
-
*/
|
|
3667
|
-
declare class AdminContext {
|
|
3668
|
-
readonly client: JlpdClient;
|
|
3669
|
-
constructor(client: JlpdClient);
|
|
3670
|
-
initOrUpdateVault(params: {
|
|
3671
|
-
admin: PublicKey;
|
|
3672
|
-
} & UpdateVaultParams): Promise<VersionedTransaction>;
|
|
3673
|
-
initializeStv(params: {
|
|
3674
|
-
admin: PublicKey;
|
|
3675
|
-
} & InitializeStvParams$1, jvMintKeypair: PublicKey): Promise<VersionedTransaction>;
|
|
3676
|
-
processEpoch(params: ProcessEpochParams): Promise<VersionedTransaction>;
|
|
3677
|
-
settleYield(params: SettleYieldParams): Promise<VersionedTransaction>;
|
|
3678
|
-
}
|
|
3679
|
-
|
|
3680
|
-
/**
|
|
3681
|
-
* Creates an Anchor Program instance for the JLP.D program
|
|
3682
|
-
* @param connection - Solana connection instance
|
|
3683
|
-
* @returns Typed Anchor Program instance
|
|
3684
|
-
*/
|
|
3685
|
-
declare function createProgram(connection: Connection): Program<JlpDProgram>;
|
|
3686
|
-
|
|
3687
|
-
declare const JLPD_PROGRAM_ID: PublicKey;
|
|
3688
|
-
declare const JUPITER_LEND_PROGRAM_ID$1: PublicKey;
|
|
3689
|
-
declare const JUPITER_SWAP_PROGRAM_ID: PublicKey;
|
|
3690
|
-
declare const SEED_JLP_VAULT = "jlp_vault";
|
|
3691
|
-
declare const SEED_STV = "stv";
|
|
3692
|
-
declare const SEED_WITHDRAW_REQUEST = "withdraw_request";
|
|
3693
|
-
declare const FLAG_PAUSED = 1;
|
|
3694
|
-
declare const FLAG_DEPOSITS_DISABLED = 2;
|
|
3695
|
-
declare const FLAG_WITHDRAWALS_DISABLED = 4;
|
|
3696
|
-
declare const FLAG_JLP_DISABLED = 8;
|
|
3697
|
-
declare const FLAG_REBALANCE_DISABLED = 16;
|
|
3698
|
-
declare const PPS_DECIMALS = 1000000000;
|
|
3699
|
-
declare const EXCHANGE_RATE_PRECISION = 1000000000000;
|
|
3700
|
-
declare const MINTS: {
|
|
3701
|
-
readonly JLP: PublicKey;
|
|
3702
|
-
readonly WSOL: PublicKey;
|
|
3703
|
-
readonly USDC: PublicKey;
|
|
3704
|
-
readonly WBTC: PublicKey;
|
|
3705
|
-
readonly WETH: PublicKey;
|
|
3706
|
-
readonly JupUSD: PublicKey;
|
|
3707
|
-
};
|
|
3708
|
-
declare enum STV_INDEX {
|
|
3709
|
-
BTC = 0,
|
|
3710
|
-
ETH = 1,
|
|
3711
|
-
SOL = 2,
|
|
3712
|
-
USDC = 3,
|
|
3713
|
-
JupUSD = 4
|
|
3714
|
-
}
|
|
3715
|
-
declare const ORACLES: {
|
|
3716
|
-
readonly DOVES_BTC_USD: PublicKey;
|
|
3717
|
-
readonly DOVES_ETH_USD: PublicKey;
|
|
3718
|
-
readonly DOVES_SOL_USD: PublicKey;
|
|
3719
|
-
};
|
|
3720
|
-
declare const JLP_POOL_PUBKEY: PublicKey;
|
|
3721
|
-
declare const JUPITER_PERPS_PROGRAM_ID: PublicKey;
|
|
3722
|
-
|
|
3723
|
-
/**
|
|
3724
|
-
* Derive the JLP Vault PDA address (cached)
|
|
3725
|
-
* Seeds: ["jlp_vault"]
|
|
3726
|
-
*/
|
|
3727
|
-
declare function deriveVaultPda(programId: PublicKey): [PublicKey, number];
|
|
3728
|
-
/**
|
|
3729
|
-
* Derive an STV (Single Token Vault) PDA address (cached)
|
|
3730
|
-
* Seeds: ["stv", base_mint]
|
|
3731
|
-
*/
|
|
3732
|
-
declare function deriveStvPda(baseMint: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
3733
|
-
/**
|
|
3734
|
-
* Derive WithdrawRequest PDA address (cached)
|
|
3735
|
-
* Seeds: ["withdraw_request", stv, user, epoch_id.to_le_bytes()]
|
|
3736
|
-
*/
|
|
3737
|
-
declare function deriveWithdrawRequestPda(stvPda: PublicKey, user: PublicKey, epochId: number, programId: PublicKey): [PublicKey, number];
|
|
3738
|
-
/**
|
|
3739
|
-
* Clear PDA cache (useful for testing)
|
|
3740
|
-
*/
|
|
3741
|
-
declare function clearPdaCache(): void;
|
|
3742
|
-
|
|
3743
|
-
/**
|
|
3744
|
-
* JLPVault account layout (464 bytes data + 8 byte discriminator = 472 bytes total)
|
|
3745
|
-
*/
|
|
3746
|
-
declare const JLP_VAULT_DATA_SIZE = 464;
|
|
3747
|
-
declare const JLP_VAULT_ACCOUNT_SIZE: number;
|
|
3748
|
-
declare const JLP_VAULT_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
3749
|
-
/**
|
|
3750
|
-
* Parse a JLPVault account from raw account data
|
|
3751
|
-
*/
|
|
3752
|
-
declare function parseVault(data: Buffer): JLPVault;
|
|
3753
|
-
|
|
3754
|
-
/**
|
|
3755
|
-
* STV (Single Token Vault) account layout (200 bytes data + 8 byte discriminator = 208 bytes total)
|
|
3756
|
-
*
|
|
3757
|
-
* Layout (data starts after 8-byte discriminator):
|
|
3758
|
-
* Offset 0-31: baseMint (Pubkey)
|
|
3759
|
-
* Offset 32-63: jlMint (Pubkey)
|
|
3760
|
-
* Offset 64-95: jvMint (Pubkey)
|
|
3761
|
-
* Offset 96-103: pps (u64 LE)
|
|
3762
|
-
* Offset 104-111: hwm (u64 LE)
|
|
3763
|
-
* Offset 112-119: lastMgmtFeeTs (u64 LE)
|
|
3764
|
-
* Offset 120-127: baseLoaned (u64 LE)
|
|
3765
|
-
* Offset 128-135: accruedFeesJlx (u64 LE)
|
|
3766
|
-
* Offset 136-143: maxDeposit (u64 LE)
|
|
3767
|
-
* Offset 144-151: minDeposit (u64 LE)
|
|
3768
|
-
* Offset 152-159: requestedBase (u64 LE)
|
|
3769
|
-
* Offset 160-167: reservedBase (u64 LE)
|
|
3770
|
-
* Offset 168-175: epochPps (u64 LE)
|
|
3771
|
-
* Offset 176-179: nextEpochTs (u32 LE)
|
|
3772
|
-
* Offset 180-183: epochSec (u32 LE)
|
|
3773
|
-
* Offset 184-187: currentEpochId (u32 LE)
|
|
3774
|
-
* Offset 188-189: mgmtFeeBps (u16 LE)
|
|
3775
|
-
* Offset 190-191: perfFeeBps (u16 LE)
|
|
3776
|
-
* Offset 192-193: flags (u16 LE)
|
|
3777
|
-
* Offset 194: version (u8)
|
|
3778
|
-
* Offset 195: bump (u8)
|
|
3779
|
-
* Offset 196-199: _padding (4 bytes)
|
|
3780
|
-
*/
|
|
3781
|
-
declare const STV_DATA_SIZE = 200;
|
|
3782
|
-
declare const STV_ACCOUNT_SIZE: number;
|
|
3783
|
-
declare const STV_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
3784
|
-
/**
|
|
3785
|
-
* Parse an STV account from raw account data
|
|
3786
|
-
*/
|
|
3787
|
-
declare function parseStv(data: Buffer): STV;
|
|
3788
|
-
|
|
3789
|
-
/**
|
|
3790
|
-
* WithdrawRequest account layout
|
|
3791
|
-
* Seeds: ["withdraw_request", stv, user, epoch_id.to_le_bytes()]
|
|
3792
|
-
*
|
|
3793
|
-
* Layout (data starts after 8-byte discriminator):
|
|
3794
|
-
* Offset 0-31: stv (Pubkey)
|
|
3795
|
-
* Offset 32-63: user (Pubkey)
|
|
3796
|
-
* Offset 64-71: shares (u64 LE)
|
|
3797
|
-
* Offset 72-79: pps (u64 LE) — 0 = unprocessed
|
|
3798
|
-
* Offset 80-83: epochId (u32 LE)
|
|
3799
|
-
* Offset 84-87: claimAvailableAfter (u32 LE) — 0 = unprocessed
|
|
3800
|
-
* Offset 88: bump (u8)
|
|
3801
|
-
*/
|
|
3802
|
-
declare const WITHDRAW_REQUEST_DATA_SIZE = 89;
|
|
3803
|
-
declare const WITHDRAW_REQUEST_ACCOUNT_SIZE: number;
|
|
3804
|
-
declare const WITHDRAW_REQUEST_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
3805
|
-
/**
|
|
3806
|
-
* Parse a WithdrawRequest account from raw account data
|
|
3807
|
-
*/
|
|
3808
|
-
declare function parseWithdrawRequest(data: Buffer): WithdrawRequest;
|
|
3809
|
-
|
|
3810
|
-
/**
|
|
3811
|
-
* Derive ATA address (cached)
|
|
3812
|
-
*/
|
|
3813
|
-
declare function deriveAta(mint: PublicKey, owner: PublicKey, allowPda?: boolean): PublicKey;
|
|
3814
|
-
/**
|
|
3815
|
-
* Derive all ATAs for a user interacting with an STV (cached)
|
|
3816
|
-
*/
|
|
3817
|
-
declare function deriveUserAtas(baseMint: PublicKey, jvMint: PublicKey, userWallet: PublicKey): {
|
|
3818
|
-
baseAta: PublicKey;
|
|
3819
|
-
jvxAta: PublicKey;
|
|
3820
|
-
};
|
|
3821
|
-
/**
|
|
3822
|
-
* Derive all ATAs owned by an STV PDA (cached)
|
|
3823
|
-
*/
|
|
3824
|
-
declare function deriveStvAtas(baseMint: PublicKey, jlxMint: PublicKey, stvPda: PublicKey): {
|
|
3825
|
-
baseAta: PublicKey;
|
|
3826
|
-
jlxAta: PublicKey;
|
|
3827
|
-
};
|
|
3828
|
-
/**
|
|
3829
|
-
* Derive vault staging and JLP ATAs (owned by vault PDA, cached)
|
|
3830
|
-
*/
|
|
3831
|
-
declare function deriveVaultAtas(jlxMint: PublicKey, jlpMint: PublicKey, vaultPda: PublicKey): {
|
|
3832
|
-
stagingAta: PublicKey;
|
|
3833
|
-
jlpAta: PublicKey;
|
|
3834
|
-
};
|
|
3835
|
-
/**
|
|
3836
|
-
* Clear ATA cache (useful for testing)
|
|
3837
|
-
*/
|
|
3838
|
-
declare function clearAtaCache(): void;
|
|
3839
|
-
|
|
3840
|
-
/**
|
|
3841
|
-
* Calculate NAV for an STV
|
|
3842
|
-
* NAV = stv_base_ata.amount + (stv_jlx_ata.amount * exchange_rate / 1e12) + base_loaned - reserved_base
|
|
3843
|
-
*
|
|
3844
|
-
* @param stvBaseBalance - STV base token balance
|
|
3845
|
-
* @param stvJlxBalance - STV jlX token balance
|
|
3846
|
-
* @param exchangeRate - Jupiter Lend exchange rate (12 decimals)
|
|
3847
|
-
* @param baseLoaned - Base loaned to vault
|
|
3848
|
-
* @param reservedBase - Optional: base earmarked for unclaimed processed withdrawals (subtracted from NAV)
|
|
3849
|
-
*/
|
|
3850
|
-
declare function calculateNav(stvBaseBalance: BN, stvJlxBalance: BN, exchangeRate: bigint, baseLoaned: BN, reservedBase?: BN): BN;
|
|
3851
|
-
/**
|
|
3852
|
-
* Calculate PPS from NAV and total jvX supply
|
|
3853
|
-
* PPS = NAV * PPS_DECIMALS / total_jvx_supply
|
|
3854
|
-
*/
|
|
3855
|
-
declare function calculatePps(nav: BN, jvSupply: BN): BN;
|
|
3856
|
-
/**
|
|
3857
|
-
* Convert shares to base amount
|
|
3858
|
-
*/
|
|
3859
|
-
declare function sharesToBase(shares: BN, pps: BN): BN;
|
|
3860
|
-
/**
|
|
3861
|
-
* Convert base amount to shares
|
|
3862
|
-
*/
|
|
3863
|
-
declare function baseToShares(base: BN, pps: BN): BN;
|
|
3864
|
-
/**
|
|
3865
|
-
* Convert jlX to base using exchange rate
|
|
3866
|
-
*/
|
|
3867
|
-
declare function jlxToBase(jlxAmount: BN, exchangeRate: BN): BN;
|
|
3868
|
-
/**
|
|
3869
|
-
* Convert base to jlX using exchange rate
|
|
3870
|
-
*/
|
|
3871
|
-
declare function baseToJlx(baseAmount: BN, exchangeRate: BN): BN;
|
|
3872
|
-
/**
|
|
3873
|
-
* Calculate full exchange rate including time-accrued rewards
|
|
3874
|
-
*/
|
|
3875
|
-
declare function calculateExchangeRate(storedRate: bigint, rewardsRate: bigint, currentTimestamp: bigint, lastUpdateTimestamp: bigint, fTokenTotalSupply: bigint): bigint;
|
|
3876
|
-
|
|
3877
|
-
declare const LENDING_ADMIN: PublicKey;
|
|
3878
|
-
declare const LIQUIDITY_PROGRAM_ID: PublicKey;
|
|
3879
|
-
declare const LIQUIDITY_SINGLETON: PublicKey;
|
|
3880
|
-
declare const WSOL_POOL: JupiterLendPool;
|
|
3881
|
-
declare const USDC_POOL: JupiterLendPool;
|
|
3882
|
-
declare const JUPUSD_POOL: JupiterLendPool;
|
|
3883
|
-
declare const WBTC_POOL: JupiterLendPool;
|
|
3884
|
-
declare const WETH_POOL: JupiterLendPool;
|
|
3885
|
-
declare const POOLS: Record<PoolName, JupiterLendPool>;
|
|
3886
|
-
declare function getPoolByName(name: PoolName): JupiterLendPool | undefined;
|
|
3887
|
-
declare function getPoolByMint(mint: PublicKey): JupiterLendPool | undefined;
|
|
3888
|
-
|
|
3889
|
-
declare const JUPITER_LEND_PROGRAM_ID: PublicKey;
|
|
3890
|
-
/**
|
|
3891
|
-
* Build remaining accounts for deposit/withdraw exchange rate lookup
|
|
3892
|
-
*/
|
|
3893
|
-
declare function buildExchangeRateAccounts(pool: JupiterLendPool): {
|
|
3894
|
-
lending: PublicKey;
|
|
3895
|
-
rewardsRateModel: PublicKey;
|
|
3896
|
-
} | null;
|
|
3897
|
-
/**
|
|
3898
|
-
* Build remaining accounts for jup_earn_deposit instruction (17 accounts + program ID)
|
|
3899
|
-
*/
|
|
3900
|
-
declare function buildJupEarnDepositAccounts(pool: JupiterLendPool, stvPda: PublicKey, stvBaseAta: PublicKey, stvJlxAta: PublicKey): AccountMeta[];
|
|
3901
|
-
/**
|
|
3902
|
-
* Build remaining accounts for jup_earn_withdraw instruction (18 accounts + program ID)
|
|
3903
|
-
*/
|
|
3904
|
-
declare function buildJupEarnWithdrawAccounts(pool: JupiterLendPool, stvPda: PublicKey, stvJlxAta: PublicKey, stvBaseAta: PublicKey): AccountMeta[];
|
|
3905
|
-
/**
|
|
3906
|
-
* Parse Lending account data from buffer
|
|
3907
|
-
*/
|
|
3908
|
-
declare function parseLendingAccount(data: Buffer): LendingAccountData;
|
|
3909
|
-
/**
|
|
3910
|
-
* Parse LendingRewardsRateModel account data from buffer
|
|
3911
|
-
*/
|
|
3912
|
-
declare function parseRewardsRateModel(data: Buffer): RewardsRateModelData;
|
|
3913
|
-
|
|
3914
|
-
/**
|
|
3915
|
-
* Get a swap quote from Jupiter API
|
|
3916
|
-
*/
|
|
3917
|
-
declare function getJupiterQuote(inputMint: PublicKey, outputMint: PublicKey, amount: bigint | number, slippageBps?: number, maxAccounts?: number, apiKey?: string): Promise<JupiterQuoteResponse>;
|
|
3918
|
-
/**
|
|
3919
|
-
* Get swap instructions from Jupiter API
|
|
3920
|
-
*/
|
|
3921
|
-
declare function getJupiterSwapInstructions(quote: JupiterQuoteResponse, userPubkey: PublicKey, apiKey?: string): Promise<JupiterSwapInstructionsResponse>;
|
|
3922
|
-
/**
|
|
3923
|
-
* Parse swap instruction to extract remaining accounts
|
|
3924
|
-
*/
|
|
3925
|
-
declare function parseSwapRemainingAccounts(swapInstruction: SerializedInstruction): AccountMeta[];
|
|
3926
|
-
/**
|
|
3927
|
-
* Fetch Address Lookup Tables from the chain
|
|
3928
|
-
*/
|
|
3929
|
-
declare function fetchAddressLookupTables(connection: Connection, addresses: string[]): Promise<AddressLookupTableAccount[]>;
|
|
3930
|
-
/**
|
|
3931
|
-
* Build complete swap data for CPI including quote, instructions, and ALTs
|
|
3932
|
-
*/
|
|
3933
|
-
declare function buildSwapData(connection: Connection, inputMint: PublicKey, outputMint: PublicKey, amount: bigint | number, userPubkey: PublicKey, slippageBps?: number, maxAccounts?: number, apiKey?: string): Promise<{
|
|
3934
|
-
quote: JupiterQuoteResponse;
|
|
3935
|
-
instructions: JupiterSwapInstructionsResponse;
|
|
3936
|
-
remainingAccounts: AccountMeta[];
|
|
3937
|
-
addressLookupTables: AddressLookupTableAccount[];
|
|
3938
|
-
}>;
|
|
3939
|
-
|
|
3940
|
-
/**
|
|
3941
|
-
* Jupiter Price API V3 Integration
|
|
3942
|
-
*
|
|
3943
|
-
* Used to fetch token prices for settle_yield instruction.
|
|
3944
|
-
* Manager must provide JLP rate which is validated against Pyth on-chain.
|
|
3945
|
-
*/
|
|
3946
|
-
|
|
3947
|
-
/**
|
|
3948
|
-
* Jupiter Price API V3 response for a single token
|
|
3949
|
-
*/
|
|
3950
|
-
interface JupiterPriceData {
|
|
3951
|
-
createdAt: string;
|
|
3952
|
-
liquidity: number;
|
|
3953
|
-
usdPrice: number;
|
|
3954
|
-
blockId: number;
|
|
3955
|
-
decimals: number;
|
|
3956
|
-
priceChange24h: number;
|
|
3957
|
-
}
|
|
3958
|
-
/**
|
|
3959
|
-
* Jupiter Price API V3 response
|
|
3960
|
-
*/
|
|
3961
|
-
type JupiterPriceResponse = {
|
|
3962
|
-
[mint: string]: JupiterPriceData;
|
|
3963
|
-
};
|
|
3964
|
-
/**
|
|
3965
|
-
* Fetch token price from Jupiter Price API V3
|
|
3966
|
-
*
|
|
3967
|
-
* @param mint Token mint address
|
|
3968
|
-
* @param apiKey Jupiter API key
|
|
3969
|
-
* @returns Price in USD as a number, or null if unavailable
|
|
3970
|
-
*/
|
|
3971
|
-
declare function fetchJupiterPriceUsd(mint: string, apiKey: string): Promise<number | null>;
|
|
3972
|
-
/**
|
|
3973
|
-
* Fetch JLP price and convert to 8 decimals for on-chain use
|
|
3974
|
-
*
|
|
3975
|
-
* This is the format required by the settle_yield instruction's jlp_rate parameter.
|
|
3976
|
-
* The rate is validated against Pyth oracle on-chain (must be within 50 bps).
|
|
3977
|
-
*
|
|
3978
|
-
* @param jlpMint JLP token mint address
|
|
3979
|
-
* @param fallbackPrice Fallback price in USD if API fails (default: $4.60)
|
|
3980
|
-
* @param apiKey Jupiter API key
|
|
3981
|
-
* @returns Price as BN with 8 decimals (e.g., $4.60 -> 460_000_000)
|
|
3982
|
-
*
|
|
3983
|
-
* @example
|
|
3984
|
-
* ```typescript
|
|
3985
|
-
* const jlpRate = await fetchJlpRate(MINTS.JLP);
|
|
3986
|
-
* const tx = await adminContext.settleYield({
|
|
3987
|
-
* manager: wallet.publicKey,
|
|
3988
|
-
* jlpRate,
|
|
3989
|
-
* oracles: { ... }
|
|
3990
|
-
* });
|
|
3991
|
-
* ```
|
|
3992
|
-
*/
|
|
3993
|
-
declare function fetchJlpRate(jlpMint: string, fallbackPrice: number | undefined, apiKey: string): Promise<BN>;
|
|
3994
|
-
|
|
3995
|
-
interface InitOrUpdateJlpVaultParams {
|
|
3996
|
-
jlpMint: PublicKey | null;
|
|
3997
|
-
baseAssetMints: PublicKey[] | null;
|
|
3998
|
-
jlxAssetMints: PublicKey[] | null;
|
|
3999
|
-
newAdmin: PublicKey | null;
|
|
4000
|
-
manager: PublicKey;
|
|
4001
|
-
feeReceiver: PublicKey;
|
|
4002
|
-
flags: number;
|
|
4003
|
-
jlpSlippageBps: number;
|
|
4004
|
-
oracleStalenessThreshold: BN | null;
|
|
4005
|
-
}
|
|
4006
|
-
interface InitializeStvParams {
|
|
4007
|
-
mgmtFeeBps: number;
|
|
4008
|
-
perfFeeBps: number;
|
|
4009
|
-
maxDeposit: BN;
|
|
4010
|
-
minDeposit: BN;
|
|
4011
|
-
epochSec: number;
|
|
4012
|
-
}
|
|
4013
|
-
interface UpdateStvParams {
|
|
4014
|
-
mgmtFeeBps: number;
|
|
4015
|
-
perfFeeBps: number;
|
|
4016
|
-
flags: number;
|
|
4017
|
-
maxDeposit: BN;
|
|
4018
|
-
minDeposit: BN;
|
|
4019
|
-
jlMint: PublicKey | null;
|
|
4020
|
-
pps: BN | null;
|
|
4021
|
-
hwm: BN | null;
|
|
4022
|
-
baseLoaned: BN | null;
|
|
4023
|
-
epochSec: number | null;
|
|
4024
|
-
}
|
|
4025
|
-
interface InitOrUpdateJlpVaultAccounts {
|
|
4026
|
-
admin: PublicKey;
|
|
4027
|
-
}
|
|
4028
|
-
interface InitializeStvAccounts {
|
|
4029
|
-
admin: PublicKey;
|
|
4030
|
-
jlpVault: PublicKey;
|
|
4031
|
-
baseMint: PublicKey;
|
|
4032
|
-
jlMint: PublicKey;
|
|
4033
|
-
jvMint: PublicKey;
|
|
4034
|
-
tokenProgram: PublicKey;
|
|
4035
|
-
}
|
|
4036
|
-
interface UpdateStvAccounts {
|
|
4037
|
-
admin: PublicKey;
|
|
4038
|
-
jlpVault: PublicKey;
|
|
4039
|
-
stv: PublicKey;
|
|
4040
|
-
}
|
|
4041
|
-
declare function createInitOrUpdateVaultInstruction(program: Program<JlpDProgram>, params: InitOrUpdateJlpVaultParams, accounts: InitOrUpdateJlpVaultAccounts): Promise<TransactionInstruction>;
|
|
4042
|
-
declare function createInitializeStvInstruction(program: Program<JlpDProgram>, params: InitializeStvParams, accounts: InitializeStvAccounts): Promise<TransactionInstruction>;
|
|
4043
|
-
declare function createUpdateStvInstruction(program: Program<JlpDProgram>, params: UpdateStvParams, accounts: UpdateStvAccounts): Promise<TransactionInstruction>;
|
|
4044
|
-
|
|
4045
|
-
interface DepositAccounts {
|
|
4046
|
-
user: PublicKey;
|
|
4047
|
-
jlpVault: PublicKey;
|
|
4048
|
-
stv: PublicKey;
|
|
4049
|
-
baseMint: PublicKey;
|
|
4050
|
-
jlMint: PublicKey;
|
|
4051
|
-
jvMint: PublicKey;
|
|
4052
|
-
userBaseAta: PublicKey;
|
|
4053
|
-
userJvxAta: PublicKey;
|
|
4054
|
-
stvBaseAta: PublicKey;
|
|
4055
|
-
stvJlxAta: PublicKey;
|
|
4056
|
-
tokenProgram: PublicKey;
|
|
4057
|
-
}
|
|
4058
|
-
interface RequestWithdrawAccounts {
|
|
4059
|
-
user: PublicKey;
|
|
4060
|
-
jlpVault: PublicKey;
|
|
4061
|
-
stv: PublicKey;
|
|
4062
|
-
jvMint: PublicKey;
|
|
4063
|
-
userJvxAta: PublicKey;
|
|
4064
|
-
withdrawRequest: PublicKey;
|
|
4065
|
-
requestJvxAta: PublicKey;
|
|
4066
|
-
tokenProgram: PublicKey;
|
|
4067
|
-
associatedTokenProgram: PublicKey;
|
|
4068
|
-
systemProgram: PublicKey;
|
|
4069
|
-
}
|
|
4070
|
-
interface ClaimWithdrawAccounts {
|
|
4071
|
-
user: PublicKey;
|
|
4072
|
-
stv: PublicKey;
|
|
4073
|
-
baseMint: PublicKey;
|
|
4074
|
-
jvMint: PublicKey;
|
|
4075
|
-
userBaseAta: PublicKey;
|
|
4076
|
-
stvBaseAta: PublicKey;
|
|
4077
|
-
withdrawRequest: PublicKey;
|
|
4078
|
-
requestJvxAta: PublicKey;
|
|
4079
|
-
tokenProgram: PublicKey;
|
|
4080
|
-
}
|
|
4081
|
-
/**
|
|
4082
|
-
* Create a deposit instruction
|
|
4083
|
-
*/
|
|
4084
|
-
declare function createDepositInstruction(program: Program<JlpDProgram>, amount: BN, accounts: DepositAccounts, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>;
|
|
4085
|
-
/**
|
|
4086
|
-
* Create a request_withdraw instruction.
|
|
4087
|
-
* Escrows the user's jvX shares into the WithdrawRequest PDA's ATA for the current epoch.
|
|
4088
|
-
*/
|
|
4089
|
-
declare function createRequestWithdrawInstruction(program: Program<JlpDProgram>, params: {
|
|
4090
|
-
shares: BN;
|
|
4091
|
-
epochId: number;
|
|
4092
|
-
}, accounts: RequestWithdrawAccounts): Promise<TransactionInstruction>;
|
|
4093
|
-
/**
|
|
4094
|
-
* Create a claim_withdraw instruction.
|
|
4095
|
-
* Claims base tokens for a processed WithdrawRequest, closing the PDA.
|
|
4096
|
-
*/
|
|
4097
|
-
declare function createClaimWithdrawInstruction(program: Program<JlpDProgram>, accounts: ClaimWithdrawAccounts): Promise<TransactionInstruction>;
|
|
4098
|
-
|
|
4099
|
-
interface JupEarnParams {
|
|
4100
|
-
direction: JupEarnDirection;
|
|
4101
|
-
amount: BN;
|
|
4102
|
-
}
|
|
4103
|
-
interface MoveJlxParams {
|
|
4104
|
-
amountJlx: BN;
|
|
4105
|
-
direction: MoveDirection;
|
|
4106
|
-
}
|
|
4107
|
-
interface SwapJlxJlpParams {
|
|
4108
|
-
stvIndex: number;
|
|
4109
|
-
direction: SwapDirection;
|
|
4110
|
-
amountIn: BN;
|
|
4111
|
-
expectedAmountOut: BN;
|
|
4112
|
-
jupiterData: Buffer;
|
|
4113
|
-
}
|
|
4114
|
-
interface JupEarnAccounts {
|
|
4115
|
-
manager: PublicKey;
|
|
4116
|
-
jlpVault: PublicKey;
|
|
4117
|
-
stv: PublicKey;
|
|
4118
|
-
baseMint: PublicKey;
|
|
4119
|
-
jlMint: PublicKey;
|
|
4120
|
-
stvBaseAta: PublicKey;
|
|
4121
|
-
stvJlxAta: PublicKey;
|
|
4122
|
-
}
|
|
4123
|
-
interface MoveStvAccounts {
|
|
4124
|
-
manager: PublicKey;
|
|
4125
|
-
jlpVault: PublicKey;
|
|
4126
|
-
stv: PublicKey;
|
|
4127
|
-
baseMint: PublicKey;
|
|
4128
|
-
jlMint: PublicKey;
|
|
4129
|
-
stvJlxAta: PublicKey;
|
|
4130
|
-
vaultStagingAta: PublicKey;
|
|
4131
|
-
tokenProgram: PublicKey;
|
|
4132
|
-
}
|
|
4133
|
-
interface SwapJlxJlpAccounts {
|
|
4134
|
-
manager: PublicKey;
|
|
4135
|
-
jlpVault: PublicKey;
|
|
4136
|
-
vaultJlxAta: PublicKey;
|
|
4137
|
-
vaultJlpAta: PublicKey;
|
|
4138
|
-
jlpMint: PublicKey;
|
|
4139
|
-
tokenProgram: PublicKey;
|
|
4140
|
-
jupiterProgram: PublicKey;
|
|
4141
|
-
}
|
|
4142
|
-
interface SettleYieldAccounts {
|
|
4143
|
-
manager: PublicKey;
|
|
4144
|
-
jlpVault: PublicKey;
|
|
4145
|
-
vaultJlpAta: PublicKey;
|
|
4146
|
-
jlpMint: PublicKey;
|
|
4147
|
-
stvBtc: PublicKey;
|
|
4148
|
-
stvEth: PublicKey;
|
|
4149
|
-
stvSol: PublicKey;
|
|
4150
|
-
stvUsdc: PublicKey;
|
|
4151
|
-
stvJupusd: PublicKey;
|
|
4152
|
-
stagingBtc: PublicKey;
|
|
4153
|
-
stagingEth: PublicKey;
|
|
4154
|
-
stagingSol: PublicKey;
|
|
4155
|
-
stagingUsdc: PublicKey;
|
|
4156
|
-
stagingJupusd: PublicKey;
|
|
4157
|
-
oracleBtc: PublicKey;
|
|
4158
|
-
oracleEth: PublicKey;
|
|
4159
|
-
oracleSol: PublicKey;
|
|
4160
|
-
jlpPool: PublicKey;
|
|
4161
|
-
jlpMintAccount: PublicKey;
|
|
4162
|
-
}
|
|
4163
|
-
interface SettleYieldInstructionParams {
|
|
4164
|
-
}
|
|
4165
|
-
declare function createJupEarnInstruction(program: Program<JlpDProgram>, params: JupEarnParams, accounts: JupEarnAccounts, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>;
|
|
4166
|
-
declare function createMoveJlxInstruction(program: Program<JlpDProgram>, params: MoveJlxParams, accounts: MoveStvAccounts, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>;
|
|
4167
|
-
declare function createSwapJlxJlpInstruction(program: Program<JlpDProgram>, params: SwapJlxJlpParams, accounts: SwapJlxJlpAccounts, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>;
|
|
4168
|
-
interface ProcessEpochAccounts {
|
|
4169
|
-
payer: PublicKey;
|
|
4170
|
-
jlpVault: PublicKey;
|
|
4171
|
-
stv: PublicKey;
|
|
4172
|
-
baseMint: PublicKey;
|
|
4173
|
-
jlMint: PublicKey;
|
|
4174
|
-
jvMint: PublicKey;
|
|
4175
|
-
stvBaseAta: PublicKey;
|
|
4176
|
-
stvJlxAta: PublicKey;
|
|
4177
|
-
tokenProgram: PublicKey;
|
|
4178
|
-
}
|
|
4179
|
-
declare function createProcessEpochInstruction(program: Program<JlpDProgram>, accounts: ProcessEpochAccounts, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>;
|
|
4180
|
-
declare function createSettleYieldInstruction(program: Program<JlpDProgram>, params: SettleYieldInstructionParams, accounts: SettleYieldAccounts, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>;
|
|
4181
|
-
|
|
4182
|
-
interface ClaimFeesAccounts {
|
|
4183
|
-
manager: PublicKey;
|
|
4184
|
-
jlpVault: PublicKey;
|
|
4185
|
-
stv: PublicKey;
|
|
4186
|
-
baseMint: PublicKey;
|
|
4187
|
-
jlMint: PublicKey;
|
|
4188
|
-
jvMint: PublicKey;
|
|
4189
|
-
stvBaseAta: PublicKey;
|
|
4190
|
-
stvJlxAta: PublicKey;
|
|
4191
|
-
feeReceiverJlxAta: PublicKey;
|
|
4192
|
-
tokenProgram: PublicKey;
|
|
4193
|
-
}
|
|
4194
|
-
/**
|
|
4195
|
-
* Create a claim_fees instruction using Anchor's program.methods
|
|
4196
|
-
*/
|
|
4197
|
-
declare function createClaimFeesInstruction(program: Program<JlpDProgram>, accounts: ClaimFeesAccounts, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>;
|
|
4198
|
-
|
|
4199
|
-
export { type AccountMeta, AdminContext, type ClaimFeesAccounts, type ClaimFeesParams, type ClaimWithdrawAccounts, type ClaimWithdrawParams, type DepositAccounts, type DepositParams, EXCHANGE_RATE_PRECISION, type ExchangeRateResult, FLAG_DEPOSITS_DISABLED, FLAG_JLP_DISABLED, FLAG_PAUSED, FLAG_REBALANCE_DISABLED, FLAG_WITHDRAWALS_DISABLED, type InitOrUpdateJlpVaultAccounts, type InitOrUpdateJlpVaultParams, type InitializeStvAccounts, type InitializeStvParams$1 as InitializeStvParams, JLPD_PROGRAM_ID, type JLPVault, JLP_POOL_PUBKEY, JLP_VAULT_ACCOUNT_SIZE, JLP_VAULT_DATA_SIZE, JLP_VAULT_DISCRIMINATOR, JUPITER_LEND_PROGRAM_ID$1 as JUPITER_LEND_PROGRAM_ID, JUPITER_PERPS_PROGRAM_ID, JUPITER_SWAP_PROGRAM_ID, JUPUSD_POOL, JUPITER_LEND_PROGRAM_ID as JUP_LEND_PROGRAM_ID, type JlpDProgram, JlpdClient, JlpdClientError, type JupEarnAccounts, type JupEarnDirection, type JupEarnParams$1 as JupEarnParams, type JupiterLendPool, type JupiterPriceData, type JupiterPriceResponse, type JupiterQuoteResponse, type JupiterSwapInstructionsResponse, LENDING_ADMIN, LIQUIDITY_PROGRAM_ID, LIQUIDITY_SINGLETON, type LendingAccountData, MINTS, type MoveDirection, type MoveJlxParams$1 as MoveJlxParams, type MoveStvAccounts, ORACLES, POOLS, PPS_DECIMALS, PoolContext, type PoolName, type ProcessEpochAccounts, type ProcessEpochParams, type RequestWithdrawAccounts, type RequestWithdrawParams, type RewardsRateModelData, SEED_JLP_VAULT, SEED_STV, SEED_WITHDRAW_REQUEST, type STV, STV_ACCOUNT_SIZE, STV_DATA_SIZE, STV_DISCRIMINATOR, STV_INDEX, type SerializedInstruction, type SettleYieldAccounts, type SettleYieldInstructionParams, type SettleYieldParams, SwapContext, type SwapDirection, type SwapJlxJlpAccounts, type SwapJlxJlpParams$1 as SwapJlxJlpParams, type SwapQuote, USDC_POOL, type UpdateStvAccounts, type UpdateStvParams$1 as UpdateStvParams, type UpdateVaultParams, WBTC_POOL, WETH_POOL, WITHDRAW_REQUEST_ACCOUNT_SIZE, WITHDRAW_REQUEST_DATA_SIZE, WITHDRAW_REQUEST_DISCRIMINATOR, WSOL_POOL, type WithdrawRequest, baseToJlx, baseToShares, buildExchangeRateAccounts, buildJupEarnDepositAccounts, buildJupEarnWithdrawAccounts, buildSwapData, calculateExchangeRate, calculateNav, calculatePps, clearAtaCache, clearPdaCache, createClaimFeesInstruction, createClaimWithdrawInstruction, createDepositInstruction, createInitOrUpdateVaultInstruction, createInitializeStvInstruction, createJupEarnInstruction, createMoveJlxInstruction, createProcessEpochInstruction, createProgram, createRequestWithdrawInstruction, createSettleYieldInstruction, createSwapJlxJlpInstruction, createUpdateStvInstruction, deriveAta, deriveStvAtas, deriveStvPda, deriveUserAtas, deriveVaultAtas, deriveVaultPda, deriveWithdrawRequestPda, fetchAddressLookupTables, fetchJlpRate, fetchJupiterPriceUsd, getJupiterQuote, getJupiterSwapInstructions, getPoolByMint, getPoolByName, jlxToBase, parseLendingAccount, parseRewardsRateModel, parseStv, parseSwapRemainingAccounts, parseVault, parseWithdrawRequest, sharesToBase };
|