@neutral-trade/sdk 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/index.d.mts +254 -2243
- package/dist/index.mjs +308 -2574
- package/package.json +3 -5
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnchorProvider,
|
|
2
|
-
import { AnchorProvider as AnchorProvider$1, Program as Program$1 } from "@coral-xyz/anchor-32";
|
|
1
|
+
import { AnchorProvider, Program } from "@coral-xyz/anchor";
|
|
3
2
|
import { Connection, Keypair, PublicKey, SYSVAR_RENT_PUBKEY, SystemProgram } from "@solana/web3.js";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
import { TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync } from "@solana/spl-token";
|
|
5
|
+
import BN from "bn.js";
|
|
6
6
|
|
|
7
7
|
//#region src/constants/addr.ts
|
|
8
8
|
const ZERO_ADDRESS = new PublicKey("11111111111111111111111111111111");
|
|
@@ -21,2411 +21,14 @@ function createDummyWallet() {
|
|
|
21
21
|
function createConnection(rpcUrl) {
|
|
22
22
|
return new Connection(rpcUrl, "confirmed");
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function createAnchorProvider(connection, wallet) {
|
|
25
25
|
return new AnchorProvider(connection, wallet ?? createDummyWallet(), AnchorProvider.defaultOptions());
|
|
26
26
|
}
|
|
27
|
-
function createAnchorProviderV32(connection, wallet) {
|
|
28
|
-
return new AnchorProvider$1(connection, wallet ?? createDummyWallet(), AnchorProvider$1.defaultOptions());
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/constants/points-vaults.ts
|
|
33
|
-
/**
|
|
34
|
-
* Get vaults that earn points, filtered by pointsEnabled !== false.
|
|
35
|
-
* Returns entries ready for points backend consumption.
|
|
36
|
-
*/
|
|
37
|
-
function getPointsVaults(registry) {
|
|
38
|
-
return Object.values(registry).filter((v) => v.pointsEnabled !== false).map((v) => toPointsVaultEntry(v));
|
|
39
|
-
}
|
|
40
|
-
function toPointsVaultEntry(entry) {
|
|
41
|
-
return {
|
|
42
|
-
vaultId: entry.vaultId,
|
|
43
|
-
name: entry.subname ? `${entry.name} -- ${entry.subname}` : entry.name,
|
|
44
|
-
address: entry.vaultAddress,
|
|
45
|
-
depositToken: entry.depositToken,
|
|
46
|
-
type: entry.type,
|
|
47
|
-
multiplier: entry.pointsMultiplier ?? 1,
|
|
48
|
-
enabled: entry.pointsEnabled !== false,
|
|
49
|
-
bundleProgramId: entry.bundleProgramId
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/idl/bundle-v1.json
|
|
55
|
-
var bundle_v1_default = {
|
|
56
|
-
version: "0.1.0",
|
|
57
|
-
name: "ntbundle",
|
|
58
|
-
instructions: [
|
|
59
|
-
{
|
|
60
|
-
"name": "initializeBundleMasterAccount",
|
|
61
|
-
"accounts": [
|
|
62
|
-
{
|
|
63
|
-
"name": "admin",
|
|
64
|
-
"isMut": true,
|
|
65
|
-
"isSigner": true
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"name": "bundleMasterAccount",
|
|
69
|
-
"isMut": true,
|
|
70
|
-
"isSigner": false
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"name": "systemProgram",
|
|
74
|
-
"isMut": false,
|
|
75
|
-
"isSigner": false
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"args": []
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"name": "changeBundleMasterAdmin",
|
|
82
|
-
"accounts": [{
|
|
83
|
-
"name": "admin",
|
|
84
|
-
"isMut": true,
|
|
85
|
-
"isSigner": true
|
|
86
|
-
}, {
|
|
87
|
-
"name": "bundleMasterAccount",
|
|
88
|
-
"isMut": true,
|
|
89
|
-
"isSigner": false
|
|
90
|
-
}],
|
|
91
|
-
"args": [{
|
|
92
|
-
"name": "newAdmin",
|
|
93
|
-
"type": "publicKey"
|
|
94
|
-
}]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"name": "setBundleCreator",
|
|
98
|
-
"accounts": [
|
|
99
|
-
{
|
|
100
|
-
"name": "admin",
|
|
101
|
-
"isMut": true,
|
|
102
|
-
"isSigner": true
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"name": "bundleMasterAccount",
|
|
106
|
-
"isMut": false,
|
|
107
|
-
"isSigner": false
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"name": "creator",
|
|
111
|
-
"isMut": false,
|
|
112
|
-
"isSigner": false,
|
|
113
|
-
"docs": ["CHECK safe as only the pubkey is read"]
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"name": "bundleCreatorAccount",
|
|
117
|
-
"isMut": true,
|
|
118
|
-
"isSigner": false
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"name": "systemProgram",
|
|
122
|
-
"isMut": false,
|
|
123
|
-
"isSigner": false
|
|
124
|
-
}
|
|
125
|
-
],
|
|
126
|
-
"args": [{
|
|
127
|
-
"name": "allowed",
|
|
128
|
-
"type": "bool"
|
|
129
|
-
}]
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"name": "initializeBundle",
|
|
133
|
-
"accounts": [
|
|
134
|
-
{
|
|
135
|
-
"name": "creator",
|
|
136
|
-
"isMut": true,
|
|
137
|
-
"isSigner": true
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"name": "bundleCreatorAccount",
|
|
141
|
-
"isMut": false,
|
|
142
|
-
"isSigner": false
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"name": "systemProgram",
|
|
146
|
-
"isMut": false,
|
|
147
|
-
"isSigner": false
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"name": "treasuryAccount",
|
|
151
|
-
"isMut": true,
|
|
152
|
-
"isSigner": false
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"name": "assetAddress",
|
|
156
|
-
"isMut": true,
|
|
157
|
-
"isSigner": false
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"name": "bundleAccount",
|
|
161
|
-
"isMut": true,
|
|
162
|
-
"isSigner": false
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"name": "bundleTempData",
|
|
166
|
-
"isMut": true,
|
|
167
|
-
"isSigner": false
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"name": "oracleData",
|
|
171
|
-
"isMut": true,
|
|
172
|
-
"isSigner": false
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
|
-
"args": [
|
|
176
|
-
{
|
|
177
|
-
"name": "name",
|
|
178
|
-
"type": { "array": ["u8", 32] }
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"name": "keeper",
|
|
182
|
-
"type": "publicKey"
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"name": "depositFee",
|
|
186
|
-
"type": "u32"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"name": "withdrawalFee",
|
|
190
|
-
"type": "u32"
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"name": "performanceFee",
|
|
194
|
-
"type": "u32"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"name": "managementFeeBps",
|
|
198
|
-
"type": "u32"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
"name": "oracleBuffer",
|
|
202
|
-
"type": "u64"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"name": "maxDepositAmount",
|
|
206
|
-
"type": "u64"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"name": "withdrawalDelay",
|
|
210
|
-
"type": "u64"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"name": "withdrawalTMin",
|
|
214
|
-
"type": "i64"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"name": "withdrawalTMax",
|
|
218
|
-
"type": "i64"
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
"name": "withdrawalCurve",
|
|
222
|
-
"type": "f32"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"name": "permissionned",
|
|
226
|
-
"type": "bool"
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"name": "initializeBundleDepositor",
|
|
232
|
-
"accounts": [
|
|
233
|
-
{
|
|
234
|
-
"name": "payer",
|
|
235
|
-
"isMut": true,
|
|
236
|
-
"isSigner": true
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"name": "authority",
|
|
240
|
-
"isMut": true,
|
|
241
|
-
"isSigner": false
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"name": "systemProgram",
|
|
245
|
-
"isMut": false,
|
|
246
|
-
"isSigner": false
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
"name": "bundleAccount",
|
|
250
|
-
"isMut": true,
|
|
251
|
-
"isSigner": false
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
"name": "userBundleAccount",
|
|
255
|
-
"isMut": true,
|
|
256
|
-
"isSigner": false,
|
|
257
|
-
"docs": ["each user gets one UserBundleAccount account; it will be created if it doesn't exist."]
|
|
258
|
-
}
|
|
259
|
-
],
|
|
260
|
-
"args": []
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"name": "setOracleBuffer",
|
|
264
|
-
"accounts": [{
|
|
265
|
-
"name": "manager",
|
|
266
|
-
"isMut": true,
|
|
267
|
-
"isSigner": true
|
|
268
|
-
}, {
|
|
269
|
-
"name": "bundleAccount",
|
|
270
|
-
"isMut": true,
|
|
271
|
-
"isSigner": false
|
|
272
|
-
}],
|
|
273
|
-
"args": [{
|
|
274
|
-
"name": "oracleBuffer",
|
|
275
|
-
"type": "u64"
|
|
276
|
-
}]
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
"name": "setDelays",
|
|
280
|
-
"accounts": [{
|
|
281
|
-
"name": "manager",
|
|
282
|
-
"isMut": true,
|
|
283
|
-
"isSigner": true
|
|
284
|
-
}, {
|
|
285
|
-
"name": "bundleAccount",
|
|
286
|
-
"isMut": true,
|
|
287
|
-
"isSigner": false
|
|
288
|
-
}],
|
|
289
|
-
"args": [
|
|
290
|
-
{
|
|
291
|
-
"name": "withdrawalDelay",
|
|
292
|
-
"type": "u64"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"name": "withdrawalTMin",
|
|
296
|
-
"type": "i64"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"name": "withdrawalTMax",
|
|
300
|
-
"type": "i64"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"name": "withdrawalCurve",
|
|
304
|
-
"type": "f32"
|
|
305
|
-
}
|
|
306
|
-
]
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"name": "setMaxDepositAmount",
|
|
310
|
-
"accounts": [{
|
|
311
|
-
"name": "manager",
|
|
312
|
-
"isMut": true,
|
|
313
|
-
"isSigner": true
|
|
314
|
-
}, {
|
|
315
|
-
"name": "bundleAccount",
|
|
316
|
-
"isMut": true,
|
|
317
|
-
"isSigner": false
|
|
318
|
-
}],
|
|
319
|
-
"args": [{
|
|
320
|
-
"name": "maxDepositAmount",
|
|
321
|
-
"type": "u64"
|
|
322
|
-
}]
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
"name": "setKeeper",
|
|
326
|
-
"accounts": [{
|
|
327
|
-
"name": "manager",
|
|
328
|
-
"isMut": true,
|
|
329
|
-
"isSigner": true
|
|
330
|
-
}, {
|
|
331
|
-
"name": "bundleAccount",
|
|
332
|
-
"isMut": true,
|
|
333
|
-
"isSigner": false
|
|
334
|
-
}],
|
|
335
|
-
"args": [{
|
|
336
|
-
"name": "newkeeper",
|
|
337
|
-
"type": "publicKey"
|
|
338
|
-
}]
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
"name": "addStrategy",
|
|
342
|
-
"accounts": [
|
|
343
|
-
{
|
|
344
|
-
"name": "manager",
|
|
345
|
-
"isMut": true,
|
|
346
|
-
"isSigner": true
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
"name": "strategyAccount",
|
|
350
|
-
"isMut": true,
|
|
351
|
-
"isSigner": false
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
"name": "bundleAccount",
|
|
355
|
-
"isMut": true,
|
|
356
|
-
"isSigner": false
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
"name": "receiverAddress",
|
|
360
|
-
"isMut": true,
|
|
361
|
-
"isSigner": false
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
"name": "systemProgram",
|
|
365
|
-
"isMut": false,
|
|
366
|
-
"isSigner": false
|
|
367
|
-
}
|
|
368
|
-
],
|
|
369
|
-
"args": [{
|
|
370
|
-
"name": "allocationBps",
|
|
371
|
-
"type": "u32"
|
|
372
|
-
}]
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
"name": "removeStrategy",
|
|
376
|
-
"accounts": [
|
|
377
|
-
{
|
|
378
|
-
"name": "manager",
|
|
379
|
-
"isMut": true,
|
|
380
|
-
"isSigner": true
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
"name": "strategyAccount",
|
|
384
|
-
"isMut": true,
|
|
385
|
-
"isSigner": false
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
"name": "bundleAccount",
|
|
389
|
-
"isMut": true,
|
|
390
|
-
"isSigner": false
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"name": "receiverAddress",
|
|
394
|
-
"isMut": true,
|
|
395
|
-
"isSigner": false
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
"name": "systemProgram",
|
|
399
|
-
"isMut": false,
|
|
400
|
-
"isSigner": false
|
|
401
|
-
}
|
|
402
|
-
],
|
|
403
|
-
"args": []
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
"name": "enableStrategy",
|
|
407
|
-
"accounts": [
|
|
408
|
-
{
|
|
409
|
-
"name": "manager",
|
|
410
|
-
"isMut": true,
|
|
411
|
-
"isSigner": true
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
"name": "strategyAccount",
|
|
415
|
-
"isMut": true,
|
|
416
|
-
"isSigner": false
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
"name": "bundleAccount",
|
|
420
|
-
"isMut": true,
|
|
421
|
-
"isSigner": false
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
"name": "receiverAddress",
|
|
425
|
-
"isMut": true,
|
|
426
|
-
"isSigner": false
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
"name": "systemProgram",
|
|
430
|
-
"isMut": false,
|
|
431
|
-
"isSigner": false
|
|
432
|
-
}
|
|
433
|
-
],
|
|
434
|
-
"args": []
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
"name": "updateAllocations",
|
|
438
|
-
"accounts": [
|
|
439
|
-
{
|
|
440
|
-
"name": "manager",
|
|
441
|
-
"isMut": true,
|
|
442
|
-
"isSigner": true
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"name": "receiverAddress",
|
|
446
|
-
"isMut": true,
|
|
447
|
-
"isSigner": false
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
"name": "bundleAccount",
|
|
451
|
-
"isMut": true,
|
|
452
|
-
"isSigner": false
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
"name": "strategyAccount",
|
|
456
|
-
"isMut": true,
|
|
457
|
-
"isSigner": false
|
|
458
|
-
}
|
|
459
|
-
],
|
|
460
|
-
"args": [{
|
|
461
|
-
"name": "newAllocationBps",
|
|
462
|
-
"type": "u32"
|
|
463
|
-
}]
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
"name": "changeManager",
|
|
467
|
-
"accounts": [{
|
|
468
|
-
"name": "manager",
|
|
469
|
-
"isMut": true,
|
|
470
|
-
"isSigner": true
|
|
471
|
-
}, {
|
|
472
|
-
"name": "bundleAccount",
|
|
473
|
-
"isMut": true,
|
|
474
|
-
"isSigner": false
|
|
475
|
-
}],
|
|
476
|
-
"args": [{
|
|
477
|
-
"name": "newManager",
|
|
478
|
-
"type": "publicKey"
|
|
479
|
-
}]
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
"name": "setFees",
|
|
483
|
-
"accounts": [{
|
|
484
|
-
"name": "manager",
|
|
485
|
-
"isMut": true,
|
|
486
|
-
"isSigner": true
|
|
487
|
-
}, {
|
|
488
|
-
"name": "bundleAccount",
|
|
489
|
-
"isMut": true,
|
|
490
|
-
"isSigner": false
|
|
491
|
-
}],
|
|
492
|
-
"args": [
|
|
493
|
-
{
|
|
494
|
-
"name": "treasury",
|
|
495
|
-
"type": "publicKey"
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
"name": "depositFee",
|
|
499
|
-
"type": "u32"
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
"name": "withdrawalFee",
|
|
503
|
-
"type": "u32"
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
"name": "performanceFee",
|
|
507
|
-
"type": "u32"
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
"name": "managementFeeBps",
|
|
511
|
-
"type": "u32"
|
|
512
|
-
}
|
|
513
|
-
]
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
"name": "updateOracle",
|
|
517
|
-
"accounts": [
|
|
518
|
-
{
|
|
519
|
-
"name": "keeper",
|
|
520
|
-
"isMut": true,
|
|
521
|
-
"isSigner": true
|
|
522
|
-
},
|
|
523
|
-
{
|
|
524
|
-
"name": "bundleAccount",
|
|
525
|
-
"isMut": true,
|
|
526
|
-
"isSigner": false
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
"name": "bundleTempData",
|
|
530
|
-
"isMut": true,
|
|
531
|
-
"isSigner": false
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
"name": "oracleData",
|
|
535
|
-
"isMut": true,
|
|
536
|
-
"isSigner": false
|
|
537
|
-
}
|
|
538
|
-
],
|
|
539
|
-
"args": [{
|
|
540
|
-
"name": "newEquity",
|
|
541
|
-
"type": "u64"
|
|
542
|
-
}]
|
|
543
|
-
},
|
|
544
|
-
{
|
|
545
|
-
"name": "applyFeesToUser",
|
|
546
|
-
"accounts": [
|
|
547
|
-
{
|
|
548
|
-
"name": "keeper",
|
|
549
|
-
"isMut": true,
|
|
550
|
-
"isSigner": true
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
"name": "userBundleAccountOwner",
|
|
554
|
-
"isMut": true,
|
|
555
|
-
"isSigner": false
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
"name": "userBundleAccount",
|
|
559
|
-
"isMut": true,
|
|
560
|
-
"isSigner": false
|
|
561
|
-
},
|
|
562
|
-
{
|
|
563
|
-
"name": "bundleAccount",
|
|
564
|
-
"isMut": true,
|
|
565
|
-
"isSigner": false
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
"name": "oracleData",
|
|
569
|
-
"isMut": true,
|
|
570
|
-
"isSigner": false
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
"name": "bundleAssetAuthority",
|
|
574
|
-
"isMut": true,
|
|
575
|
-
"isSigner": false
|
|
576
|
-
}
|
|
577
|
-
],
|
|
578
|
-
"args": []
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
"name": "managerWithdraw",
|
|
582
|
-
"accounts": [
|
|
583
|
-
{
|
|
584
|
-
"name": "manager",
|
|
585
|
-
"isMut": true,
|
|
586
|
-
"isSigner": true
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
"name": "managerTokenAccount",
|
|
590
|
-
"isMut": true,
|
|
591
|
-
"isSigner": false
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
"name": "assetAddress",
|
|
595
|
-
"isMut": true,
|
|
596
|
-
"isSigner": false
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
"name": "bundleAssetAccount",
|
|
600
|
-
"isMut": true,
|
|
601
|
-
"isSigner": false
|
|
602
|
-
},
|
|
603
|
-
{
|
|
604
|
-
"name": "bundleAccount",
|
|
605
|
-
"isMut": true,
|
|
606
|
-
"isSigner": false
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
"name": "oracleData",
|
|
610
|
-
"isMut": true,
|
|
611
|
-
"isSigner": false
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
"name": "bundleAssetAuthority",
|
|
615
|
-
"isMut": true,
|
|
616
|
-
"isSigner": false
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
"name": "tokenProgram",
|
|
620
|
-
"isMut": false,
|
|
621
|
-
"isSigner": false
|
|
622
|
-
}
|
|
623
|
-
],
|
|
624
|
-
"args": []
|
|
625
|
-
},
|
|
626
|
-
{
|
|
627
|
-
"name": "netPendingTransactions",
|
|
628
|
-
"accounts": [
|
|
629
|
-
{
|
|
630
|
-
"name": "keeper",
|
|
631
|
-
"isMut": true,
|
|
632
|
-
"isSigner": true
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
"name": "bundleAccount",
|
|
636
|
-
"isMut": true,
|
|
637
|
-
"isSigner": false
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
"name": "pendingDepositTokenAccount",
|
|
641
|
-
"isMut": true,
|
|
642
|
-
"isSigner": false
|
|
643
|
-
},
|
|
644
|
-
{
|
|
645
|
-
"name": "bundleAssetAccount",
|
|
646
|
-
"isMut": true,
|
|
647
|
-
"isSigner": false
|
|
648
|
-
},
|
|
649
|
-
{
|
|
650
|
-
"name": "assetAddress",
|
|
651
|
-
"isMut": true,
|
|
652
|
-
"isSigner": false
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
"name": "pendingBundleAssetAuthority",
|
|
656
|
-
"isMut": true,
|
|
657
|
-
"isSigner": false
|
|
658
|
-
},
|
|
659
|
-
{
|
|
660
|
-
"name": "oracleData",
|
|
661
|
-
"isMut": true,
|
|
662
|
-
"isSigner": false
|
|
663
|
-
},
|
|
664
|
-
{
|
|
665
|
-
"name": "bundleTempData",
|
|
666
|
-
"isMut": true,
|
|
667
|
-
"isSigner": false
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
"name": "bundleAssetAuthority",
|
|
671
|
-
"isMut": true,
|
|
672
|
-
"isSigner": false
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
"name": "tokenProgram",
|
|
676
|
-
"isMut": false,
|
|
677
|
-
"isSigner": false
|
|
678
|
-
}
|
|
679
|
-
],
|
|
680
|
-
"args": []
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
"name": "requestDeposit",
|
|
684
|
-
"accounts": [
|
|
685
|
-
{
|
|
686
|
-
"name": "user",
|
|
687
|
-
"isMut": true,
|
|
688
|
-
"isSigner": true
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
"name": "userTokenAccount",
|
|
692
|
-
"isMut": true,
|
|
693
|
-
"isSigner": false,
|
|
694
|
-
"docs": ["user token account (source of funds)"]
|
|
695
|
-
},
|
|
696
|
-
{
|
|
697
|
-
"name": "pendingDepositTokenAccount",
|
|
698
|
-
"isMut": true,
|
|
699
|
-
"isSigner": false
|
|
700
|
-
},
|
|
701
|
-
{
|
|
702
|
-
"name": "treasuryAccount",
|
|
703
|
-
"isMut": true,
|
|
704
|
-
"isSigner": false
|
|
705
|
-
},
|
|
706
|
-
{
|
|
707
|
-
"name": "userBundleAccount",
|
|
708
|
-
"isMut": true,
|
|
709
|
-
"isSigner": false
|
|
710
|
-
},
|
|
711
|
-
{
|
|
712
|
-
"name": "assetAddress",
|
|
713
|
-
"isMut": true,
|
|
714
|
-
"isSigner": false
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
"name": "oracleData",
|
|
718
|
-
"isMut": true,
|
|
719
|
-
"isSigner": false
|
|
720
|
-
},
|
|
721
|
-
{
|
|
722
|
-
"name": "bundleTempData",
|
|
723
|
-
"isMut": true,
|
|
724
|
-
"isSigner": false
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
"name": "bundleAccount",
|
|
728
|
-
"isMut": true,
|
|
729
|
-
"isSigner": false
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
"name": "pendingBundleAssetAuthority",
|
|
733
|
-
"isMut": true,
|
|
734
|
-
"isSigner": false
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
"name": "tokenProgram",
|
|
738
|
-
"isMut": false,
|
|
739
|
-
"isSigner": false
|
|
740
|
-
},
|
|
741
|
-
{
|
|
742
|
-
"name": "systemProgram",
|
|
743
|
-
"isMut": false,
|
|
744
|
-
"isSigner": false
|
|
745
|
-
}
|
|
746
|
-
],
|
|
747
|
-
"args": [{
|
|
748
|
-
"name": "amount",
|
|
749
|
-
"type": "u64"
|
|
750
|
-
}]
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
"name": "processDeposit",
|
|
754
|
-
"accounts": [
|
|
755
|
-
{
|
|
756
|
-
"name": "keeper",
|
|
757
|
-
"isMut": true,
|
|
758
|
-
"isSigner": true
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
"name": "userBundleAccount",
|
|
762
|
-
"isMut": true,
|
|
763
|
-
"isSigner": false
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
"name": "pendingDepositTokenAccount",
|
|
767
|
-
"isMut": true,
|
|
768
|
-
"isSigner": false,
|
|
769
|
-
"docs": ["the account holding the user's deposited asset before allocation."]
|
|
770
|
-
},
|
|
771
|
-
{
|
|
772
|
-
"name": "userBundleAccountOwner",
|
|
773
|
-
"isMut": false,
|
|
774
|
-
"isSigner": false,
|
|
775
|
-
"docs": ["the owner of the pending request (for event purposes)."]
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
"name": "assetAddress",
|
|
779
|
-
"isMut": true,
|
|
780
|
-
"isSigner": false
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
"name": "bundleAssetAccount",
|
|
784
|
-
"isMut": true,
|
|
785
|
-
"isSigner": false
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
"name": "bundleAccount",
|
|
789
|
-
"isMut": true,
|
|
790
|
-
"isSigner": false
|
|
791
|
-
},
|
|
792
|
-
{
|
|
793
|
-
"name": "bundleTempData",
|
|
794
|
-
"isMut": true,
|
|
795
|
-
"isSigner": false
|
|
796
|
-
},
|
|
797
|
-
{
|
|
798
|
-
"name": "oracleData",
|
|
799
|
-
"isMut": true,
|
|
800
|
-
"isSigner": false
|
|
801
|
-
},
|
|
802
|
-
{
|
|
803
|
-
"name": "pendingBundleAssetAuthority",
|
|
804
|
-
"isMut": true,
|
|
805
|
-
"isSigner": false
|
|
806
|
-
},
|
|
807
|
-
{
|
|
808
|
-
"name": "bundleAssetAuthority",
|
|
809
|
-
"isMut": true,
|
|
810
|
-
"isSigner": false
|
|
811
|
-
},
|
|
812
|
-
{
|
|
813
|
-
"name": "tokenProgram",
|
|
814
|
-
"isMut": false,
|
|
815
|
-
"isSigner": false
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
"name": "systemProgram",
|
|
819
|
-
"isMut": false,
|
|
820
|
-
"isSigner": false
|
|
821
|
-
}
|
|
822
|
-
],
|
|
823
|
-
"args": []
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
"name": "refundDeposit",
|
|
827
|
-
"accounts": [
|
|
828
|
-
{
|
|
829
|
-
"name": "keeper",
|
|
830
|
-
"isMut": true,
|
|
831
|
-
"isSigner": true
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
"name": "userBundleAccount",
|
|
835
|
-
"isMut": true,
|
|
836
|
-
"isSigner": false
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
"name": "userBundleAccountOwner",
|
|
840
|
-
"isMut": false,
|
|
841
|
-
"isSigner": false,
|
|
842
|
-
"docs": ["the owner of the pending request (for event purposes)."]
|
|
843
|
-
},
|
|
844
|
-
{
|
|
845
|
-
"name": "userTokenAccount",
|
|
846
|
-
"isMut": true,
|
|
847
|
-
"isSigner": false
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
"name": "assetAddress",
|
|
851
|
-
"isMut": true,
|
|
852
|
-
"isSigner": false
|
|
853
|
-
},
|
|
854
|
-
{
|
|
855
|
-
"name": "bundleAssetAccount",
|
|
856
|
-
"isMut": true,
|
|
857
|
-
"isSigner": false
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
"name": "bundleAssetAuthority",
|
|
861
|
-
"isMut": true,
|
|
862
|
-
"isSigner": false
|
|
863
|
-
},
|
|
864
|
-
{
|
|
865
|
-
"name": "bundleAccount",
|
|
866
|
-
"isMut": true,
|
|
867
|
-
"isSigner": false
|
|
868
|
-
},
|
|
869
|
-
{
|
|
870
|
-
"name": "bundleTempData",
|
|
871
|
-
"isMut": true,
|
|
872
|
-
"isSigner": false
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
"name": "tokenProgram",
|
|
876
|
-
"isMut": false,
|
|
877
|
-
"isSigner": false
|
|
878
|
-
},
|
|
879
|
-
{
|
|
880
|
-
"name": "systemProgram",
|
|
881
|
-
"isMut": false,
|
|
882
|
-
"isSigner": false
|
|
883
|
-
}
|
|
884
|
-
],
|
|
885
|
-
"args": []
|
|
886
|
-
},
|
|
887
|
-
{
|
|
888
|
-
"name": "requestWithdrawal",
|
|
889
|
-
"accounts": [
|
|
890
|
-
{
|
|
891
|
-
"name": "user",
|
|
892
|
-
"isMut": true,
|
|
893
|
-
"isSigner": true
|
|
894
|
-
},
|
|
895
|
-
{
|
|
896
|
-
"name": "userBundleAccount",
|
|
897
|
-
"isMut": true,
|
|
898
|
-
"isSigner": false
|
|
899
|
-
},
|
|
900
|
-
{
|
|
901
|
-
"name": "bundleAccount",
|
|
902
|
-
"isMut": true,
|
|
903
|
-
"isSigner": false
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
"name": "oracleData",
|
|
907
|
-
"isMut": true,
|
|
908
|
-
"isSigner": false
|
|
909
|
-
},
|
|
910
|
-
{
|
|
911
|
-
"name": "bundleTempData",
|
|
912
|
-
"isMut": true,
|
|
913
|
-
"isSigner": false
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
"name": "tokenProgram",
|
|
917
|
-
"isMut": false,
|
|
918
|
-
"isSigner": false
|
|
919
|
-
},
|
|
920
|
-
{
|
|
921
|
-
"name": "systemProgram",
|
|
922
|
-
"isMut": false,
|
|
923
|
-
"isSigner": false
|
|
924
|
-
},
|
|
925
|
-
{
|
|
926
|
-
"name": "rent",
|
|
927
|
-
"isMut": false,
|
|
928
|
-
"isSigner": false
|
|
929
|
-
}
|
|
930
|
-
],
|
|
931
|
-
"args": [{
|
|
932
|
-
"name": "sharesAmount",
|
|
933
|
-
"type": "u128"
|
|
934
|
-
}]
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
"name": "processWithdrawal",
|
|
938
|
-
"accounts": [
|
|
939
|
-
{
|
|
940
|
-
"name": "keeper",
|
|
941
|
-
"isMut": true,
|
|
942
|
-
"isSigner": true
|
|
943
|
-
},
|
|
944
|
-
{
|
|
945
|
-
"name": "userBundleAccountOwner",
|
|
946
|
-
"isMut": false,
|
|
947
|
-
"isSigner": false
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
"name": "userTokenAccount",
|
|
951
|
-
"isMut": true,
|
|
952
|
-
"isSigner": false
|
|
953
|
-
},
|
|
954
|
-
{
|
|
955
|
-
"name": "assetAddress",
|
|
956
|
-
"isMut": true,
|
|
957
|
-
"isSigner": false
|
|
958
|
-
},
|
|
959
|
-
{
|
|
960
|
-
"name": "bundleAssetAccount",
|
|
961
|
-
"isMut": true,
|
|
962
|
-
"isSigner": false
|
|
963
|
-
},
|
|
964
|
-
{
|
|
965
|
-
"name": "pendingBundleAssetAuthority",
|
|
966
|
-
"isMut": true,
|
|
967
|
-
"isSigner": false
|
|
968
|
-
},
|
|
969
|
-
{
|
|
970
|
-
"name": "userBundleAccount",
|
|
971
|
-
"isMut": true,
|
|
972
|
-
"isSigner": false
|
|
973
|
-
},
|
|
974
|
-
{
|
|
975
|
-
"name": "treasuryAccount",
|
|
976
|
-
"isMut": true,
|
|
977
|
-
"isSigner": false
|
|
978
|
-
},
|
|
979
|
-
{
|
|
980
|
-
"name": "bundleAssetAuthority",
|
|
981
|
-
"isMut": true,
|
|
982
|
-
"isSigner": false
|
|
983
|
-
},
|
|
984
|
-
{
|
|
985
|
-
"name": "bundleAccount",
|
|
986
|
-
"isMut": true,
|
|
987
|
-
"isSigner": false
|
|
988
|
-
},
|
|
989
|
-
{
|
|
990
|
-
"name": "bundleTempData",
|
|
991
|
-
"isMut": true,
|
|
992
|
-
"isSigner": false
|
|
993
|
-
},
|
|
994
|
-
{
|
|
995
|
-
"name": "oracleData",
|
|
996
|
-
"isMut": true,
|
|
997
|
-
"isSigner": false
|
|
998
|
-
},
|
|
999
|
-
{
|
|
1000
|
-
"name": "tokenProgram",
|
|
1001
|
-
"isMut": false,
|
|
1002
|
-
"isSigner": false
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
"name": "systemProgram",
|
|
1006
|
-
"isMut": false,
|
|
1007
|
-
"isSigner": false
|
|
1008
|
-
}
|
|
1009
|
-
],
|
|
1010
|
-
"args": []
|
|
1011
|
-
},
|
|
1012
|
-
{
|
|
1013
|
-
"name": "pauseDepositsWithdrawals",
|
|
1014
|
-
"accounts": [
|
|
1015
|
-
{
|
|
1016
|
-
"name": "keeper",
|
|
1017
|
-
"isMut": true,
|
|
1018
|
-
"isSigner": true
|
|
1019
|
-
},
|
|
1020
|
-
{
|
|
1021
|
-
"name": "bundleAccount",
|
|
1022
|
-
"isMut": true,
|
|
1023
|
-
"isSigner": false
|
|
1024
|
-
},
|
|
1025
|
-
{
|
|
1026
|
-
"name": "bundleTempData",
|
|
1027
|
-
"isMut": true,
|
|
1028
|
-
"isSigner": false
|
|
1029
|
-
},
|
|
1030
|
-
{
|
|
1031
|
-
"name": "oracleData",
|
|
1032
|
-
"isMut": true,
|
|
1033
|
-
"isSigner": false
|
|
1034
|
-
}
|
|
1035
|
-
],
|
|
1036
|
-
"args": [{
|
|
1037
|
-
"name": "pause",
|
|
1038
|
-
"type": "bool"
|
|
1039
|
-
}]
|
|
1040
|
-
},
|
|
1041
|
-
{
|
|
1042
|
-
"name": "startDistribution",
|
|
1043
|
-
"accounts": [
|
|
1044
|
-
{
|
|
1045
|
-
"name": "keeper",
|
|
1046
|
-
"isMut": true,
|
|
1047
|
-
"isSigner": true
|
|
1048
|
-
},
|
|
1049
|
-
{
|
|
1050
|
-
"name": "bundleAccount",
|
|
1051
|
-
"isMut": true,
|
|
1052
|
-
"isSigner": false
|
|
1053
|
-
},
|
|
1054
|
-
{
|
|
1055
|
-
"name": "bundleTempData",
|
|
1056
|
-
"isMut": true,
|
|
1057
|
-
"isSigner": false
|
|
1058
|
-
},
|
|
1059
|
-
{
|
|
1060
|
-
"name": "oracleData",
|
|
1061
|
-
"isMut": true,
|
|
1062
|
-
"isSigner": false
|
|
1063
|
-
}
|
|
1064
|
-
],
|
|
1065
|
-
"args": []
|
|
1066
|
-
},
|
|
1067
|
-
{
|
|
1068
|
-
"name": "endDistribution",
|
|
1069
|
-
"accounts": [
|
|
1070
|
-
{
|
|
1071
|
-
"name": "keeper",
|
|
1072
|
-
"isMut": true,
|
|
1073
|
-
"isSigner": true
|
|
1074
|
-
},
|
|
1075
|
-
{
|
|
1076
|
-
"name": "bundleAccount",
|
|
1077
|
-
"isMut": true,
|
|
1078
|
-
"isSigner": false
|
|
1079
|
-
},
|
|
1080
|
-
{
|
|
1081
|
-
"name": "bundleTempData",
|
|
1082
|
-
"isMut": true,
|
|
1083
|
-
"isSigner": false
|
|
1084
|
-
},
|
|
1085
|
-
{
|
|
1086
|
-
"name": "oracleData",
|
|
1087
|
-
"isMut": true,
|
|
1088
|
-
"isSigner": false
|
|
1089
|
-
}
|
|
1090
|
-
],
|
|
1091
|
-
"args": []
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
"name": "performRefill",
|
|
1095
|
-
"accounts": [
|
|
1096
|
-
{
|
|
1097
|
-
"name": "receiverAddress",
|
|
1098
|
-
"isMut": true,
|
|
1099
|
-
"isSigner": true
|
|
1100
|
-
},
|
|
1101
|
-
{
|
|
1102
|
-
"name": "bundleAssetAccount",
|
|
1103
|
-
"isMut": true,
|
|
1104
|
-
"isSigner": false
|
|
1105
|
-
},
|
|
1106
|
-
{
|
|
1107
|
-
"name": "receiverAta",
|
|
1108
|
-
"isMut": true,
|
|
1109
|
-
"isSigner": false
|
|
1110
|
-
},
|
|
1111
|
-
{
|
|
1112
|
-
"name": "assetAddress",
|
|
1113
|
-
"isMut": false,
|
|
1114
|
-
"isSigner": false
|
|
1115
|
-
},
|
|
1116
|
-
{
|
|
1117
|
-
"name": "bundleAccount",
|
|
1118
|
-
"isMut": true,
|
|
1119
|
-
"isSigner": false
|
|
1120
|
-
},
|
|
1121
|
-
{
|
|
1122
|
-
"name": "strategyAccount",
|
|
1123
|
-
"isMut": true,
|
|
1124
|
-
"isSigner": false
|
|
1125
|
-
},
|
|
1126
|
-
{
|
|
1127
|
-
"name": "oracleData",
|
|
1128
|
-
"isMut": true,
|
|
1129
|
-
"isSigner": false
|
|
1130
|
-
},
|
|
1131
|
-
{
|
|
1132
|
-
"name": "bundleAssetAuthority",
|
|
1133
|
-
"isMut": true,
|
|
1134
|
-
"isSigner": false
|
|
1135
|
-
},
|
|
1136
|
-
{
|
|
1137
|
-
"name": "tokenProgram",
|
|
1138
|
-
"isMut": false,
|
|
1139
|
-
"isSigner": false
|
|
1140
|
-
}
|
|
1141
|
-
],
|
|
1142
|
-
"args": [{
|
|
1143
|
-
"name": "refillAmount",
|
|
1144
|
-
"type": "u64"
|
|
1145
|
-
}]
|
|
1146
|
-
},
|
|
1147
|
-
{
|
|
1148
|
-
"name": "distributeToReceivers",
|
|
1149
|
-
"accounts": [
|
|
1150
|
-
{
|
|
1151
|
-
"name": "keeper",
|
|
1152
|
-
"isMut": true,
|
|
1153
|
-
"isSigner": true
|
|
1154
|
-
},
|
|
1155
|
-
{
|
|
1156
|
-
"name": "receiverAddress",
|
|
1157
|
-
"isMut": true,
|
|
1158
|
-
"isSigner": false
|
|
1159
|
-
},
|
|
1160
|
-
{
|
|
1161
|
-
"name": "bundleAssetAccount",
|
|
1162
|
-
"isMut": true,
|
|
1163
|
-
"isSigner": false
|
|
1164
|
-
},
|
|
1165
|
-
{
|
|
1166
|
-
"name": "receiverAta",
|
|
1167
|
-
"isMut": true,
|
|
1168
|
-
"isSigner": false
|
|
1169
|
-
},
|
|
1170
|
-
{
|
|
1171
|
-
"name": "assetAddress",
|
|
1172
|
-
"isMut": false,
|
|
1173
|
-
"isSigner": false
|
|
1174
|
-
},
|
|
1175
|
-
{
|
|
1176
|
-
"name": "oracleData",
|
|
1177
|
-
"isMut": true,
|
|
1178
|
-
"isSigner": false
|
|
1179
|
-
},
|
|
1180
|
-
{
|
|
1181
|
-
"name": "bundleAssetAuthority",
|
|
1182
|
-
"isMut": true,
|
|
1183
|
-
"isSigner": false
|
|
1184
|
-
},
|
|
1185
|
-
{
|
|
1186
|
-
"name": "tokenProgram",
|
|
1187
|
-
"isMut": false,
|
|
1188
|
-
"isSigner": false
|
|
1189
|
-
},
|
|
1190
|
-
{
|
|
1191
|
-
"name": "bundleAccount",
|
|
1192
|
-
"isMut": true,
|
|
1193
|
-
"isSigner": false
|
|
1194
|
-
},
|
|
1195
|
-
{
|
|
1196
|
-
"name": "bundleTempData",
|
|
1197
|
-
"isMut": true,
|
|
1198
|
-
"isSigner": false
|
|
1199
|
-
},
|
|
1200
|
-
{
|
|
1201
|
-
"name": "strategyAccount",
|
|
1202
|
-
"isMut": true,
|
|
1203
|
-
"isSigner": false
|
|
1204
|
-
}
|
|
1205
|
-
],
|
|
1206
|
-
"args": []
|
|
1207
|
-
}
|
|
1208
|
-
],
|
|
1209
|
-
accounts: [
|
|
1210
|
-
{
|
|
1211
|
-
"name": "BundleMasterAccount",
|
|
1212
|
-
"type": {
|
|
1213
|
-
"kind": "struct",
|
|
1214
|
-
"fields": [{
|
|
1215
|
-
"name": "admin",
|
|
1216
|
-
"type": "publicKey"
|
|
1217
|
-
}, {
|
|
1218
|
-
"name": "padding",
|
|
1219
|
-
"type": { "array": ["u8", 96] }
|
|
1220
|
-
}]
|
|
1221
|
-
}
|
|
1222
|
-
},
|
|
1223
|
-
{
|
|
1224
|
-
"name": "BundleCreatorAccount",
|
|
1225
|
-
"type": {
|
|
1226
|
-
"kind": "struct",
|
|
1227
|
-
"fields": [{
|
|
1228
|
-
"name": "allowed",
|
|
1229
|
-
"type": "bool"
|
|
1230
|
-
}, {
|
|
1231
|
-
"name": "padding",
|
|
1232
|
-
"type": { "array": ["u8", 64] }
|
|
1233
|
-
}]
|
|
1234
|
-
}
|
|
1235
|
-
},
|
|
1236
|
-
{
|
|
1237
|
-
"name": "UserBundleAccount",
|
|
1238
|
-
"type": {
|
|
1239
|
-
"kind": "struct",
|
|
1240
|
-
"fields": [
|
|
1241
|
-
{
|
|
1242
|
-
"name": "owner",
|
|
1243
|
-
"type": "publicKey"
|
|
1244
|
-
},
|
|
1245
|
-
{
|
|
1246
|
-
"name": "lastDepositTimestamp",
|
|
1247
|
-
"type": "i64"
|
|
1248
|
-
},
|
|
1249
|
-
{
|
|
1250
|
-
"name": "shares",
|
|
1251
|
-
"type": "u128"
|
|
1252
|
-
},
|
|
1253
|
-
{
|
|
1254
|
-
"name": "pendingDeposit",
|
|
1255
|
-
"type": "u64"
|
|
1256
|
-
},
|
|
1257
|
-
{
|
|
1258
|
-
"name": "pendingShares",
|
|
1259
|
-
"type": "u128"
|
|
1260
|
-
},
|
|
1261
|
-
{
|
|
1262
|
-
"name": "estimatedPendingWithdrawalValue",
|
|
1263
|
-
"type": "u64"
|
|
1264
|
-
},
|
|
1265
|
-
{
|
|
1266
|
-
"name": "withdrawalAvailableTimestamp",
|
|
1267
|
-
"type": "i64"
|
|
1268
|
-
},
|
|
1269
|
-
{
|
|
1270
|
-
"name": "lastWithdrawalProcessTimestamp",
|
|
1271
|
-
"type": "i64"
|
|
1272
|
-
},
|
|
1273
|
-
{
|
|
1274
|
-
"name": "lastHighWaterMark",
|
|
1275
|
-
"type": "u128"
|
|
1276
|
-
},
|
|
1277
|
-
{
|
|
1278
|
-
"name": "hwmPerShare",
|
|
1279
|
-
"type": "u128"
|
|
1280
|
-
},
|
|
1281
|
-
{
|
|
1282
|
-
"name": "lastManagementFeeTimestamp",
|
|
1283
|
-
"type": "i64"
|
|
1284
|
-
},
|
|
1285
|
-
{
|
|
1286
|
-
"name": "netDeposits",
|
|
1287
|
-
"type": "i128"
|
|
1288
|
-
},
|
|
1289
|
-
{
|
|
1290
|
-
"name": "totalFeeCharged",
|
|
1291
|
-
"type": "u64"
|
|
1292
|
-
},
|
|
1293
|
-
{
|
|
1294
|
-
"name": "padding",
|
|
1295
|
-
"type": { "array": ["u8", 264] }
|
|
1296
|
-
}
|
|
1297
|
-
]
|
|
1298
|
-
}
|
|
1299
|
-
},
|
|
1300
|
-
{
|
|
1301
|
-
"name": "OracleData",
|
|
1302
|
-
"type": {
|
|
1303
|
-
"kind": "struct",
|
|
1304
|
-
"fields": [
|
|
1305
|
-
{
|
|
1306
|
-
"name": "averageExternalEquity",
|
|
1307
|
-
"type": "u64"
|
|
1308
|
-
},
|
|
1309
|
-
{
|
|
1310
|
-
"name": "lastUpdateTime",
|
|
1311
|
-
"type": "i64"
|
|
1312
|
-
},
|
|
1313
|
-
{
|
|
1314
|
-
"name": "padding",
|
|
1315
|
-
"type": { "array": ["u8", 64] }
|
|
1316
|
-
}
|
|
1317
|
-
]
|
|
1318
|
-
}
|
|
1319
|
-
},
|
|
1320
|
-
{
|
|
1321
|
-
"name": "Strategy",
|
|
1322
|
-
"type": {
|
|
1323
|
-
"kind": "struct",
|
|
1324
|
-
"fields": [
|
|
1325
|
-
{
|
|
1326
|
-
"name": "receiverAddress",
|
|
1327
|
-
"type": "publicKey"
|
|
1328
|
-
},
|
|
1329
|
-
{
|
|
1330
|
-
"name": "allocationBps",
|
|
1331
|
-
"type": "u32"
|
|
1332
|
-
},
|
|
1333
|
-
{
|
|
1334
|
-
"name": "allowed",
|
|
1335
|
-
"type": "bool"
|
|
1336
|
-
},
|
|
1337
|
-
{
|
|
1338
|
-
"name": "padding",
|
|
1339
|
-
"type": { "array": ["u8", 96] }
|
|
1340
|
-
}
|
|
1341
|
-
]
|
|
1342
|
-
}
|
|
1343
|
-
},
|
|
1344
|
-
{
|
|
1345
|
-
"name": "BundleTempData",
|
|
1346
|
-
"type": {
|
|
1347
|
-
"kind": "struct",
|
|
1348
|
-
"fields": [
|
|
1349
|
-
{
|
|
1350
|
-
"name": "cumulativePendingDeposits",
|
|
1351
|
-
"type": "u64"
|
|
1352
|
-
},
|
|
1353
|
-
{
|
|
1354
|
-
"name": "pendingDepositsCounter",
|
|
1355
|
-
"type": "u64"
|
|
1356
|
-
},
|
|
1357
|
-
{
|
|
1358
|
-
"name": "pendingWithdrawalsCounter",
|
|
1359
|
-
"type": "u64"
|
|
1360
|
-
},
|
|
1361
|
-
{
|
|
1362
|
-
"name": "pendingLockedWithdrawalsCounter",
|
|
1363
|
-
"type": "u64"
|
|
1364
|
-
},
|
|
1365
|
-
{
|
|
1366
|
-
"name": "lastTotalSharesMinted",
|
|
1367
|
-
"type": "u128"
|
|
1368
|
-
},
|
|
1369
|
-
{
|
|
1370
|
-
"name": "lastNettingTimestamp",
|
|
1371
|
-
"type": "i64"
|
|
1372
|
-
},
|
|
1373
|
-
{
|
|
1374
|
-
"name": "isNettingDone",
|
|
1375
|
-
"type": "bool"
|
|
1376
|
-
},
|
|
1377
|
-
{
|
|
1378
|
-
"name": "distributionBaseAmount",
|
|
1379
|
-
"type": "u64"
|
|
1380
|
-
},
|
|
1381
|
-
{
|
|
1382
|
-
"name": "isDistributionStarted",
|
|
1383
|
-
"type": "bool"
|
|
1384
|
-
},
|
|
1385
|
-
{
|
|
1386
|
-
"name": "pausedDepositsWithdrawals",
|
|
1387
|
-
"type": "bool"
|
|
1388
|
-
},
|
|
1389
|
-
{
|
|
1390
|
-
"name": "leftToDistribute",
|
|
1391
|
-
"type": "u64"
|
|
1392
|
-
},
|
|
1393
|
-
{
|
|
1394
|
-
"name": "padding",
|
|
1395
|
-
"type": { "array": ["u8", 184] }
|
|
1396
|
-
}
|
|
1397
|
-
]
|
|
1398
|
-
}
|
|
1399
|
-
},
|
|
1400
|
-
{
|
|
1401
|
-
"name": "Bundle",
|
|
1402
|
-
"type": {
|
|
1403
|
-
"kind": "struct",
|
|
1404
|
-
"fields": [
|
|
1405
|
-
{
|
|
1406
|
-
"name": "name",
|
|
1407
|
-
"type": { "array": ["u8", 32] }
|
|
1408
|
-
},
|
|
1409
|
-
{
|
|
1410
|
-
"name": "manager",
|
|
1411
|
-
"type": "publicKey"
|
|
1412
|
-
},
|
|
1413
|
-
{
|
|
1414
|
-
"name": "keeper",
|
|
1415
|
-
"type": "publicKey"
|
|
1416
|
-
},
|
|
1417
|
-
{
|
|
1418
|
-
"name": "treasuryAccount",
|
|
1419
|
-
"type": "publicKey"
|
|
1420
|
-
},
|
|
1421
|
-
{
|
|
1422
|
-
"name": "allocatedReceivers",
|
|
1423
|
-
"type": { "vec": "publicKey" }
|
|
1424
|
-
},
|
|
1425
|
-
{
|
|
1426
|
-
"name": "bundleUnderlyingBalance",
|
|
1427
|
-
"type": "u64"
|
|
1428
|
-
},
|
|
1429
|
-
{
|
|
1430
|
-
"name": "maxDepositAmount",
|
|
1431
|
-
"type": "u64"
|
|
1432
|
-
},
|
|
1433
|
-
{
|
|
1434
|
-
"name": "withdrawalDelay",
|
|
1435
|
-
"type": "u64"
|
|
1436
|
-
},
|
|
1437
|
-
{
|
|
1438
|
-
"name": "performanceFee",
|
|
1439
|
-
"type": "u32"
|
|
1440
|
-
},
|
|
1441
|
-
{
|
|
1442
|
-
"name": "managementFeeBps",
|
|
1443
|
-
"type": "u32"
|
|
1444
|
-
},
|
|
1445
|
-
{
|
|
1446
|
-
"name": "depositFee",
|
|
1447
|
-
"type": "u32"
|
|
1448
|
-
},
|
|
1449
|
-
{
|
|
1450
|
-
"name": "withdrawalFee",
|
|
1451
|
-
"type": "u32"
|
|
1452
|
-
},
|
|
1453
|
-
{
|
|
1454
|
-
"name": "managerPfeeShares",
|
|
1455
|
-
"type": "u128"
|
|
1456
|
-
},
|
|
1457
|
-
{
|
|
1458
|
-
"name": "currentAllocationBps",
|
|
1459
|
-
"type": "u32"
|
|
1460
|
-
},
|
|
1461
|
-
{
|
|
1462
|
-
"name": "oracleBuffer",
|
|
1463
|
-
"type": "u64"
|
|
1464
|
-
},
|
|
1465
|
-
{
|
|
1466
|
-
"name": "totalShares",
|
|
1467
|
-
"type": "u128"
|
|
1468
|
-
},
|
|
1469
|
-
{
|
|
1470
|
-
"name": "assetPrecision",
|
|
1471
|
-
"type": "u64"
|
|
1472
|
-
},
|
|
1473
|
-
{
|
|
1474
|
-
"name": "assetAddress",
|
|
1475
|
-
"type": "publicKey"
|
|
1476
|
-
},
|
|
1477
|
-
{
|
|
1478
|
-
"name": "assetDecimals",
|
|
1479
|
-
"type": "u8"
|
|
1480
|
-
},
|
|
1481
|
-
{
|
|
1482
|
-
"name": "withdrawalTMin",
|
|
1483
|
-
"type": "i64"
|
|
1484
|
-
},
|
|
1485
|
-
{
|
|
1486
|
-
"name": "withdrawalTMax",
|
|
1487
|
-
"type": "i64"
|
|
1488
|
-
},
|
|
1489
|
-
{
|
|
1490
|
-
"name": "withdrawalCurve",
|
|
1491
|
-
"type": "f32"
|
|
1492
|
-
},
|
|
1493
|
-
{
|
|
1494
|
-
"name": "permissionned",
|
|
1495
|
-
"type": "bool"
|
|
1496
|
-
},
|
|
1497
|
-
{
|
|
1498
|
-
"name": "managerMfeeShares",
|
|
1499
|
-
"type": "u128"
|
|
1500
|
-
},
|
|
1501
|
-
{
|
|
1502
|
-
"name": "padding",
|
|
1503
|
-
"type": { "array": ["u8", 255] }
|
|
1504
|
-
}
|
|
1505
|
-
]
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
],
|
|
1509
|
-
events: [
|
|
1510
|
-
{
|
|
1511
|
-
"name": "BundleDepositorInitialized",
|
|
1512
|
-
"fields": [{
|
|
1513
|
-
"name": "bundleDepositor",
|
|
1514
|
-
"type": "publicKey",
|
|
1515
|
-
"index": false
|
|
1516
|
-
}]
|
|
1517
|
-
},
|
|
1518
|
-
{
|
|
1519
|
-
"name": "BundleMasterAccountInitialized",
|
|
1520
|
-
"fields": [{
|
|
1521
|
-
"name": "admin",
|
|
1522
|
-
"type": "publicKey",
|
|
1523
|
-
"index": false
|
|
1524
|
-
}]
|
|
1525
|
-
},
|
|
1526
|
-
{
|
|
1527
|
-
"name": "BundleMasterAdminChanged",
|
|
1528
|
-
"fields": [{
|
|
1529
|
-
"name": "newAdmin",
|
|
1530
|
-
"type": "publicKey",
|
|
1531
|
-
"index": false
|
|
1532
|
-
}]
|
|
1533
|
-
},
|
|
1534
|
-
{
|
|
1535
|
-
"name": "BundleCreatorAccountChanged",
|
|
1536
|
-
"fields": [{
|
|
1537
|
-
"name": "creator",
|
|
1538
|
-
"type": "publicKey",
|
|
1539
|
-
"index": false
|
|
1540
|
-
}, {
|
|
1541
|
-
"name": "allowed",
|
|
1542
|
-
"type": "bool",
|
|
1543
|
-
"index": false
|
|
1544
|
-
}]
|
|
1545
|
-
},
|
|
1546
|
-
{
|
|
1547
|
-
"name": "NettingCompleted",
|
|
1548
|
-
"fields": [{
|
|
1549
|
-
"name": "timestamp",
|
|
1550
|
-
"type": "i64",
|
|
1551
|
-
"index": false
|
|
1552
|
-
}]
|
|
1553
|
-
},
|
|
1554
|
-
{
|
|
1555
|
-
"name": "RefundedDeposit",
|
|
1556
|
-
"fields": [
|
|
1557
|
-
{
|
|
1558
|
-
"name": "user",
|
|
1559
|
-
"type": "publicKey",
|
|
1560
|
-
"index": false
|
|
1561
|
-
},
|
|
1562
|
-
{
|
|
1563
|
-
"name": "amount",
|
|
1564
|
-
"type": "u64",
|
|
1565
|
-
"index": false
|
|
1566
|
-
},
|
|
1567
|
-
{
|
|
1568
|
-
"name": "timestamp",
|
|
1569
|
-
"type": "i64",
|
|
1570
|
-
"index": false
|
|
1571
|
-
},
|
|
1572
|
-
{
|
|
1573
|
-
"name": "bundleAccountKey",
|
|
1574
|
-
"type": "publicKey",
|
|
1575
|
-
"index": false
|
|
1576
|
-
}
|
|
1577
|
-
]
|
|
1578
|
-
},
|
|
1579
|
-
{
|
|
1580
|
-
"name": "ChargedFeesToUser",
|
|
1581
|
-
"fields": [
|
|
1582
|
-
{
|
|
1583
|
-
"name": "totalFeeShares",
|
|
1584
|
-
"type": "u128",
|
|
1585
|
-
"index": false
|
|
1586
|
-
},
|
|
1587
|
-
{
|
|
1588
|
-
"name": "totalFeeValue",
|
|
1589
|
-
"type": "u64",
|
|
1590
|
-
"index": false
|
|
1591
|
-
},
|
|
1592
|
-
{
|
|
1593
|
-
"name": "managementFeeShares",
|
|
1594
|
-
"type": "u128",
|
|
1595
|
-
"index": false
|
|
1596
|
-
},
|
|
1597
|
-
{
|
|
1598
|
-
"name": "performanceFeeShares",
|
|
1599
|
-
"type": "u128",
|
|
1600
|
-
"index": false
|
|
1601
|
-
},
|
|
1602
|
-
{
|
|
1603
|
-
"name": "sharePrice",
|
|
1604
|
-
"type": "u128",
|
|
1605
|
-
"index": false
|
|
1606
|
-
},
|
|
1607
|
-
{
|
|
1608
|
-
"name": "bundleAccountKey",
|
|
1609
|
-
"type": "publicKey",
|
|
1610
|
-
"index": false
|
|
1611
|
-
}
|
|
1612
|
-
]
|
|
1613
|
-
},
|
|
1614
|
-
{
|
|
1615
|
-
"name": "WithdrawnFromDriftVault",
|
|
1616
|
-
"fields": [
|
|
1617
|
-
{
|
|
1618
|
-
"name": "amount",
|
|
1619
|
-
"type": "u64",
|
|
1620
|
-
"index": false
|
|
1621
|
-
},
|
|
1622
|
-
{
|
|
1623
|
-
"name": "from",
|
|
1624
|
-
"type": "publicKey",
|
|
1625
|
-
"index": false
|
|
1626
|
-
},
|
|
1627
|
-
{
|
|
1628
|
-
"name": "to",
|
|
1629
|
-
"type": "publicKey",
|
|
1630
|
-
"index": false
|
|
1631
|
-
},
|
|
1632
|
-
{
|
|
1633
|
-
"name": "timestamp",
|
|
1634
|
-
"type": "i64",
|
|
1635
|
-
"index": false
|
|
1636
|
-
}
|
|
1637
|
-
]
|
|
1638
|
-
},
|
|
1639
|
-
{
|
|
1640
|
-
"name": "RequestedWithdrawalToDriftVault",
|
|
1641
|
-
"fields": [
|
|
1642
|
-
{
|
|
1643
|
-
"name": "amount",
|
|
1644
|
-
"type": "u64",
|
|
1645
|
-
"index": false
|
|
1646
|
-
},
|
|
1647
|
-
{
|
|
1648
|
-
"name": "from",
|
|
1649
|
-
"type": "publicKey",
|
|
1650
|
-
"index": false
|
|
1651
|
-
},
|
|
1652
|
-
{
|
|
1653
|
-
"name": "to",
|
|
1654
|
-
"type": "publicKey",
|
|
1655
|
-
"index": false
|
|
1656
|
-
},
|
|
1657
|
-
{
|
|
1658
|
-
"name": "timestamp",
|
|
1659
|
-
"type": "i64",
|
|
1660
|
-
"index": false
|
|
1661
|
-
}
|
|
1662
|
-
]
|
|
1663
|
-
},
|
|
1664
|
-
{
|
|
1665
|
-
"name": "DepositedToDriftVault",
|
|
1666
|
-
"fields": [
|
|
1667
|
-
{
|
|
1668
|
-
"name": "amount",
|
|
1669
|
-
"type": "u64",
|
|
1670
|
-
"index": false
|
|
1671
|
-
},
|
|
1672
|
-
{
|
|
1673
|
-
"name": "from",
|
|
1674
|
-
"type": "publicKey",
|
|
1675
|
-
"index": false
|
|
1676
|
-
},
|
|
1677
|
-
{
|
|
1678
|
-
"name": "to",
|
|
1679
|
-
"type": "publicKey",
|
|
1680
|
-
"index": false
|
|
1681
|
-
},
|
|
1682
|
-
{
|
|
1683
|
-
"name": "timestamp",
|
|
1684
|
-
"type": "i64",
|
|
1685
|
-
"index": false
|
|
1686
|
-
}
|
|
1687
|
-
]
|
|
1688
|
-
},
|
|
1689
|
-
{
|
|
1690
|
-
"name": "InitializedNewVaultDepositor",
|
|
1691
|
-
"fields": [
|
|
1692
|
-
{
|
|
1693
|
-
"name": "vault",
|
|
1694
|
-
"type": "publicKey",
|
|
1695
|
-
"index": false
|
|
1696
|
-
},
|
|
1697
|
-
{
|
|
1698
|
-
"name": "vaultDepositor",
|
|
1699
|
-
"type": "publicKey",
|
|
1700
|
-
"index": false
|
|
1701
|
-
},
|
|
1702
|
-
{
|
|
1703
|
-
"name": "keeper",
|
|
1704
|
-
"type": "publicKey",
|
|
1705
|
-
"index": false
|
|
1706
|
-
}
|
|
1707
|
-
]
|
|
1708
|
-
},
|
|
1709
|
-
{
|
|
1710
|
-
"name": "OracleUpdated",
|
|
1711
|
-
"fields": [{
|
|
1712
|
-
"name": "averageExternalEquity",
|
|
1713
|
-
"type": "u64",
|
|
1714
|
-
"index": false
|
|
1715
|
-
}]
|
|
1716
|
-
},
|
|
1717
|
-
{
|
|
1718
|
-
"name": "DistributionEnded",
|
|
1719
|
-
"fields": [{
|
|
1720
|
-
"name": "amount",
|
|
1721
|
-
"type": "u64",
|
|
1722
|
-
"index": false
|
|
1723
|
-
}, {
|
|
1724
|
-
"name": "timestamp",
|
|
1725
|
-
"type": "i64",
|
|
1726
|
-
"index": false
|
|
1727
|
-
}]
|
|
1728
|
-
},
|
|
1729
|
-
{
|
|
1730
|
-
"name": "DistributionStarted",
|
|
1731
|
-
"fields": [{
|
|
1732
|
-
"name": "amount",
|
|
1733
|
-
"type": "u64",
|
|
1734
|
-
"index": false
|
|
1735
|
-
}, {
|
|
1736
|
-
"name": "timestamp",
|
|
1737
|
-
"type": "i64",
|
|
1738
|
-
"index": false
|
|
1739
|
-
}]
|
|
1740
|
-
},
|
|
1741
|
-
{
|
|
1742
|
-
"name": "NewManagerSet",
|
|
1743
|
-
"fields": [{
|
|
1744
|
-
"name": "manager",
|
|
1745
|
-
"type": "publicKey",
|
|
1746
|
-
"index": false
|
|
1747
|
-
}]
|
|
1748
|
-
},
|
|
1749
|
-
{
|
|
1750
|
-
"name": "NewKeeperSet",
|
|
1751
|
-
"fields": [{
|
|
1752
|
-
"name": "keeper",
|
|
1753
|
-
"type": "publicKey",
|
|
1754
|
-
"index": false
|
|
1755
|
-
}]
|
|
1756
|
-
},
|
|
1757
|
-
{
|
|
1758
|
-
"name": "InitializedVault",
|
|
1759
|
-
"fields": [{
|
|
1760
|
-
"name": "manager",
|
|
1761
|
-
"type": "publicKey",
|
|
1762
|
-
"index": false
|
|
1763
|
-
}]
|
|
1764
|
-
},
|
|
1765
|
-
{
|
|
1766
|
-
"name": "InitializedReceivers",
|
|
1767
|
-
"fields": [{
|
|
1768
|
-
"name": "manager",
|
|
1769
|
-
"type": "publicKey",
|
|
1770
|
-
"index": false
|
|
1771
|
-
}]
|
|
1772
|
-
},
|
|
1773
|
-
{
|
|
1774
|
-
"name": "AuthorizedReceiverAdded",
|
|
1775
|
-
"fields": [{
|
|
1776
|
-
"name": "allowed",
|
|
1777
|
-
"type": "bool",
|
|
1778
|
-
"index": false
|
|
1779
|
-
}]
|
|
1780
|
-
},
|
|
1781
|
-
{
|
|
1782
|
-
"name": "AuthorizedReceiverRemoved",
|
|
1783
|
-
"fields": [{
|
|
1784
|
-
"name": "allowed",
|
|
1785
|
-
"type": "bool",
|
|
1786
|
-
"index": false
|
|
1787
|
-
}]
|
|
1788
|
-
},
|
|
1789
|
-
{
|
|
1790
|
-
"name": "Allocated",
|
|
1791
|
-
"fields": [
|
|
1792
|
-
{
|
|
1793
|
-
"name": "from",
|
|
1794
|
-
"type": "publicKey",
|
|
1795
|
-
"index": false
|
|
1796
|
-
},
|
|
1797
|
-
{
|
|
1798
|
-
"name": "to",
|
|
1799
|
-
"type": "publicKey",
|
|
1800
|
-
"index": false
|
|
1801
|
-
},
|
|
1802
|
-
{
|
|
1803
|
-
"name": "amount",
|
|
1804
|
-
"type": "u64",
|
|
1805
|
-
"index": false
|
|
1806
|
-
},
|
|
1807
|
-
{
|
|
1808
|
-
"name": "timestamp",
|
|
1809
|
-
"type": "i64",
|
|
1810
|
-
"index": false
|
|
1811
|
-
},
|
|
1812
|
-
{
|
|
1813
|
-
"name": "bundleAccountKey",
|
|
1814
|
-
"type": "publicKey",
|
|
1815
|
-
"index": false
|
|
1816
|
-
}
|
|
1817
|
-
]
|
|
1818
|
-
},
|
|
1819
|
-
{
|
|
1820
|
-
"name": "Redeemed",
|
|
1821
|
-
"fields": [
|
|
1822
|
-
{
|
|
1823
|
-
"name": "from",
|
|
1824
|
-
"type": "publicKey",
|
|
1825
|
-
"index": false
|
|
1826
|
-
},
|
|
1827
|
-
{
|
|
1828
|
-
"name": "to",
|
|
1829
|
-
"type": "publicKey",
|
|
1830
|
-
"index": false
|
|
1831
|
-
},
|
|
1832
|
-
{
|
|
1833
|
-
"name": "netAmount",
|
|
1834
|
-
"type": "u64",
|
|
1835
|
-
"index": false
|
|
1836
|
-
},
|
|
1837
|
-
{
|
|
1838
|
-
"name": "feeAmount",
|
|
1839
|
-
"type": "u64",
|
|
1840
|
-
"index": false
|
|
1841
|
-
},
|
|
1842
|
-
{
|
|
1843
|
-
"name": "timestamp",
|
|
1844
|
-
"type": "i64",
|
|
1845
|
-
"index": false
|
|
1846
|
-
},
|
|
1847
|
-
{
|
|
1848
|
-
"name": "bundleAccountKey",
|
|
1849
|
-
"type": "publicKey",
|
|
1850
|
-
"index": false
|
|
1851
|
-
}
|
|
1852
|
-
]
|
|
1853
|
-
},
|
|
1854
|
-
{
|
|
1855
|
-
"name": "VaultNeutralFeeIncrementerSet",
|
|
1856
|
-
"fields": [{
|
|
1857
|
-
"name": "neutralFeeIncrementer",
|
|
1858
|
-
"type": "publicKey",
|
|
1859
|
-
"index": false
|
|
1860
|
-
}]
|
|
1861
|
-
},
|
|
1862
|
-
{
|
|
1863
|
-
"name": "ChangedCoreParams",
|
|
1864
|
-
"fields": [
|
|
1865
|
-
{
|
|
1866
|
-
"name": "treasury",
|
|
1867
|
-
"type": "publicKey",
|
|
1868
|
-
"index": false
|
|
1869
|
-
},
|
|
1870
|
-
{
|
|
1871
|
-
"name": "depositFee",
|
|
1872
|
-
"type": "u32",
|
|
1873
|
-
"index": false
|
|
1874
|
-
},
|
|
1875
|
-
{
|
|
1876
|
-
"name": "withdrawalFee",
|
|
1877
|
-
"type": "u32",
|
|
1878
|
-
"index": false
|
|
1879
|
-
},
|
|
1880
|
-
{
|
|
1881
|
-
"name": "performanceFee",
|
|
1882
|
-
"type": "u32",
|
|
1883
|
-
"index": false
|
|
1884
|
-
},
|
|
1885
|
-
{
|
|
1886
|
-
"name": "managementFeeBps",
|
|
1887
|
-
"type": "u32",
|
|
1888
|
-
"index": false
|
|
1889
|
-
}
|
|
1890
|
-
]
|
|
1891
|
-
},
|
|
1892
|
-
{
|
|
1893
|
-
"name": "AssignedProfitShare",
|
|
1894
|
-
"fields": [{
|
|
1895
|
-
"name": "amount",
|
|
1896
|
-
"type": "u128",
|
|
1897
|
-
"index": false
|
|
1898
|
-
}]
|
|
1899
|
-
},
|
|
1900
|
-
{
|
|
1901
|
-
"name": "StrategyRemoved",
|
|
1902
|
-
"fields": [{
|
|
1903
|
-
"name": "receiverAddress",
|
|
1904
|
-
"type": "publicKey",
|
|
1905
|
-
"index": false
|
|
1906
|
-
}]
|
|
1907
|
-
},
|
|
1908
|
-
{
|
|
1909
|
-
"name": "StrategyEnabled",
|
|
1910
|
-
"fields": [{
|
|
1911
|
-
"name": "receiverAddress",
|
|
1912
|
-
"type": "publicKey",
|
|
1913
|
-
"index": false
|
|
1914
|
-
}]
|
|
1915
|
-
},
|
|
1916
|
-
{
|
|
1917
|
-
"name": "DistributedToReceivers",
|
|
1918
|
-
"fields": [
|
|
1919
|
-
{
|
|
1920
|
-
"name": "amount",
|
|
1921
|
-
"type": "u64",
|
|
1922
|
-
"index": false
|
|
1923
|
-
},
|
|
1924
|
-
{
|
|
1925
|
-
"name": "from",
|
|
1926
|
-
"type": "publicKey",
|
|
1927
|
-
"index": false
|
|
1928
|
-
},
|
|
1929
|
-
{
|
|
1930
|
-
"name": "receiver",
|
|
1931
|
-
"type": "publicKey",
|
|
1932
|
-
"index": false
|
|
1933
|
-
},
|
|
1934
|
-
{
|
|
1935
|
-
"name": "timestamp",
|
|
1936
|
-
"type": "i64",
|
|
1937
|
-
"index": false
|
|
1938
|
-
}
|
|
1939
|
-
]
|
|
1940
|
-
},
|
|
1941
|
-
{
|
|
1942
|
-
"name": "StrategyAdded",
|
|
1943
|
-
"fields": [{
|
|
1944
|
-
"name": "receiverAddress",
|
|
1945
|
-
"type": "publicKey",
|
|
1946
|
-
"index": false
|
|
1947
|
-
}, {
|
|
1948
|
-
"name": "allocationBps",
|
|
1949
|
-
"type": "u32",
|
|
1950
|
-
"index": false
|
|
1951
|
-
}]
|
|
1952
|
-
},
|
|
1953
|
-
{
|
|
1954
|
-
"name": "AllocationsUpdated",
|
|
1955
|
-
"fields": [{
|
|
1956
|
-
"name": "receiverAddress",
|
|
1957
|
-
"type": "publicKey",
|
|
1958
|
-
"index": false
|
|
1959
|
-
}, {
|
|
1960
|
-
"name": "allocationBps",
|
|
1961
|
-
"type": "u32",
|
|
1962
|
-
"index": false
|
|
1963
|
-
}]
|
|
1964
|
-
},
|
|
1965
|
-
{
|
|
1966
|
-
"name": "Refilled",
|
|
1967
|
-
"fields": [
|
|
1968
|
-
{
|
|
1969
|
-
"name": "from",
|
|
1970
|
-
"type": "publicKey",
|
|
1971
|
-
"index": false
|
|
1972
|
-
},
|
|
1973
|
-
{
|
|
1974
|
-
"name": "refillValue",
|
|
1975
|
-
"type": "u64",
|
|
1976
|
-
"index": false
|
|
1977
|
-
},
|
|
1978
|
-
{
|
|
1979
|
-
"name": "timestamp",
|
|
1980
|
-
"type": "i64",
|
|
1981
|
-
"index": false
|
|
1982
|
-
}
|
|
1983
|
-
]
|
|
1984
|
-
},
|
|
1985
|
-
{
|
|
1986
|
-
"name": "DepositRequested",
|
|
1987
|
-
"fields": [
|
|
1988
|
-
{
|
|
1989
|
-
"name": "user",
|
|
1990
|
-
"type": "publicKey",
|
|
1991
|
-
"index": false
|
|
1992
|
-
},
|
|
1993
|
-
{
|
|
1994
|
-
"name": "amount",
|
|
1995
|
-
"type": "u64",
|
|
1996
|
-
"index": false
|
|
1997
|
-
},
|
|
1998
|
-
{
|
|
1999
|
-
"name": "timestamp",
|
|
2000
|
-
"type": "i64",
|
|
2001
|
-
"index": false
|
|
2002
|
-
},
|
|
2003
|
-
{
|
|
2004
|
-
"name": "bundleAccountKey",
|
|
2005
|
-
"type": "publicKey",
|
|
2006
|
-
"index": false
|
|
2007
|
-
},
|
|
2008
|
-
{
|
|
2009
|
-
"name": "toppingUp",
|
|
2010
|
-
"type": "bool",
|
|
2011
|
-
"index": false
|
|
2012
|
-
}
|
|
2013
|
-
]
|
|
2014
|
-
},
|
|
2015
|
-
{
|
|
2016
|
-
"name": "WithdrawalRequested",
|
|
2017
|
-
"fields": [
|
|
2018
|
-
{
|
|
2019
|
-
"name": "user",
|
|
2020
|
-
"type": "publicKey",
|
|
2021
|
-
"index": false
|
|
2022
|
-
},
|
|
2023
|
-
{
|
|
2024
|
-
"name": "amount",
|
|
2025
|
-
"type": "u128",
|
|
2026
|
-
"index": false
|
|
2027
|
-
},
|
|
2028
|
-
{
|
|
2029
|
-
"name": "timestamp",
|
|
2030
|
-
"type": "i64",
|
|
2031
|
-
"index": false
|
|
2032
|
-
},
|
|
2033
|
-
{
|
|
2034
|
-
"name": "cooldownPeriod",
|
|
2035
|
-
"type": "i64",
|
|
2036
|
-
"index": false
|
|
2037
|
-
},
|
|
2038
|
-
{
|
|
2039
|
-
"name": "estimatedPendingWithdrawalValue",
|
|
2040
|
-
"type": "u64",
|
|
2041
|
-
"index": false
|
|
2042
|
-
},
|
|
2043
|
-
{
|
|
2044
|
-
"name": "bundleAccountKey",
|
|
2045
|
-
"type": "publicKey",
|
|
2046
|
-
"index": false
|
|
2047
|
-
}
|
|
2048
|
-
]
|
|
2049
|
-
},
|
|
2050
|
-
{
|
|
2051
|
-
"name": "OracleBufferSet",
|
|
2052
|
-
"fields": [{
|
|
2053
|
-
"name": "oracleBuffer",
|
|
2054
|
-
"type": "u64",
|
|
2055
|
-
"index": false
|
|
2056
|
-
}]
|
|
2057
|
-
},
|
|
2058
|
-
{
|
|
2059
|
-
"name": "DelaysSet",
|
|
2060
|
-
"fields": [
|
|
2061
|
-
{
|
|
2062
|
-
"name": "withdrawalDelay",
|
|
2063
|
-
"type": "u64",
|
|
2064
|
-
"index": false
|
|
2065
|
-
},
|
|
2066
|
-
{
|
|
2067
|
-
"name": "withdrawalTMin",
|
|
2068
|
-
"type": "i64",
|
|
2069
|
-
"index": false
|
|
2070
|
-
},
|
|
2071
|
-
{
|
|
2072
|
-
"name": "withdrawalTMax",
|
|
2073
|
-
"type": "i64",
|
|
2074
|
-
"index": false
|
|
2075
|
-
},
|
|
2076
|
-
{
|
|
2077
|
-
"name": "withdrawalCurve",
|
|
2078
|
-
"type": "f32",
|
|
2079
|
-
"index": false
|
|
2080
|
-
}
|
|
2081
|
-
]
|
|
2082
|
-
},
|
|
2083
|
-
{
|
|
2084
|
-
"name": "MaxDepositAmountSet",
|
|
2085
|
-
"fields": [{
|
|
2086
|
-
"name": "maxDepositAmount",
|
|
2087
|
-
"type": "u64",
|
|
2088
|
-
"index": false
|
|
2089
|
-
}]
|
|
2090
|
-
},
|
|
2091
|
-
{
|
|
2092
|
-
"name": "ManagerWithdrawal",
|
|
2093
|
-
"fields": [{
|
|
2094
|
-
"name": "managerShares",
|
|
2095
|
-
"type": "u128",
|
|
2096
|
-
"index": false
|
|
2097
|
-
}, {
|
|
2098
|
-
"name": "redemptionAmount",
|
|
2099
|
-
"type": "u64",
|
|
2100
|
-
"index": false
|
|
2101
|
-
}]
|
|
2102
|
-
},
|
|
2103
|
-
{
|
|
2104
|
-
"name": "PausedDepositsWithdrawals",
|
|
2105
|
-
"fields": [{
|
|
2106
|
-
"name": "paused",
|
|
2107
|
-
"type": "bool",
|
|
2108
|
-
"index": false
|
|
2109
|
-
}, {
|
|
2110
|
-
"name": "bundleAccountKey",
|
|
2111
|
-
"type": "publicKey",
|
|
2112
|
-
"index": false
|
|
2113
|
-
}]
|
|
2114
|
-
}
|
|
2115
|
-
],
|
|
2116
|
-
errors: [
|
|
2117
|
-
{
|
|
2118
|
-
"code": 6e3,
|
|
2119
|
-
"name": "InsufficientFunds",
|
|
2120
|
-
"msg": "Insufficient funds to process withdrawal"
|
|
2121
|
-
},
|
|
2122
|
-
{
|
|
2123
|
-
"code": 6001,
|
|
2124
|
-
"name": "AllocationAmountZero",
|
|
2125
|
-
"msg": "Allocation amount must be > 0"
|
|
2126
|
-
},
|
|
2127
|
-
{
|
|
2128
|
-
"code": 6002,
|
|
2129
|
-
"name": "RedemptionAmountExceeded",
|
|
2130
|
-
"msg": "Redemption exceeds bundle balance"
|
|
2131
|
-
},
|
|
2132
|
-
{
|
|
2133
|
-
"code": 6003,
|
|
2134
|
-
"name": "RefillAmountInvalid",
|
|
2135
|
-
"msg": "Refill amount must be > 0"
|
|
2136
|
-
},
|
|
2137
|
-
{
|
|
2138
|
-
"code": 6004,
|
|
2139
|
-
"name": "UnauthorizedKeeperAction",
|
|
2140
|
-
"msg": "Not bundle keeper"
|
|
2141
|
-
},
|
|
2142
|
-
{
|
|
2143
|
-
"code": 6005,
|
|
2144
|
-
"name": "UnauthorizedManagerAction",
|
|
2145
|
-
"msg": "Not bundle manager"
|
|
2146
|
-
},
|
|
2147
|
-
{
|
|
2148
|
-
"code": 6006,
|
|
2149
|
-
"name": "UnauthorizedAdminAction",
|
|
2150
|
-
"msg": "Not bundle admin"
|
|
2151
|
-
},
|
|
2152
|
-
{
|
|
2153
|
-
"code": 6007,
|
|
2154
|
-
"name": "UnauthorizedBundleCreator",
|
|
2155
|
-
"msg": "Not whitelisted bundle creator"
|
|
2156
|
-
},
|
|
2157
|
-
{
|
|
2158
|
-
"code": 6008,
|
|
2159
|
-
"name": "CallerNotNeutralFeeIncrementer",
|
|
2160
|
-
"msg": "Not neutral fee incrementer"
|
|
2161
|
-
},
|
|
2162
|
-
{
|
|
2163
|
-
"code": 6009,
|
|
2164
|
-
"name": "AmountMustBeBelowMax",
|
|
2165
|
-
"msg": "Amount above max limit"
|
|
2166
|
-
},
|
|
2167
|
-
{
|
|
2168
|
-
"code": 6010,
|
|
2169
|
-
"name": "InvalidNeutralFeeIncrementer",
|
|
2170
|
-
"msg": "Invalid fee incrementer"
|
|
2171
|
-
},
|
|
2172
|
-
{
|
|
2173
|
-
"code": 6011,
|
|
2174
|
-
"name": "InvalidReceiver",
|
|
2175
|
-
"msg": "Invalid receiver address"
|
|
2176
|
-
},
|
|
2177
|
-
{
|
|
2178
|
-
"code": 6012,
|
|
2179
|
-
"name": "MathError",
|
|
2180
|
-
"msg": "Math error"
|
|
2181
|
-
},
|
|
2182
|
-
{
|
|
2183
|
-
"code": 6013,
|
|
2184
|
-
"name": "InvalidAllocations",
|
|
2185
|
-
"msg": "Invalid allocations"
|
|
2186
|
-
},
|
|
2187
|
-
{
|
|
2188
|
-
"code": 6014,
|
|
2189
|
-
"name": "MustBeInWhitelist",
|
|
2190
|
-
"msg": "Not in whitelist"
|
|
2191
|
-
},
|
|
2192
|
-
{
|
|
2193
|
-
"code": 6015,
|
|
2194
|
-
"name": "DistributionAlreadyStarted",
|
|
2195
|
-
"msg": "Distribution already started"
|
|
2196
|
-
},
|
|
2197
|
-
{
|
|
2198
|
-
"code": 6016,
|
|
2199
|
-
"name": "DistributionNotStarted",
|
|
2200
|
-
"msg": "Distribution not started"
|
|
2201
|
-
},
|
|
2202
|
-
{
|
|
2203
|
-
"code": 6017,
|
|
2204
|
-
"name": "LeftToDistributeNotZero",
|
|
2205
|
-
"msg": "Distribution amount not zero"
|
|
2206
|
-
},
|
|
2207
|
-
{
|
|
2208
|
-
"code": 6018,
|
|
2209
|
-
"name": "ReceiverAlreadyAllocated",
|
|
2210
|
-
"msg": "Receiver already allocated"
|
|
2211
|
-
},
|
|
2212
|
-
{
|
|
2213
|
-
"code": 6019,
|
|
2214
|
-
"name": "RawTransferReceiver",
|
|
2215
|
-
"msg": "Not a raw transfer receiver"
|
|
2216
|
-
},
|
|
2217
|
-
{
|
|
2218
|
-
"code": 6020,
|
|
2219
|
-
"name": "InvalidTwapPeriod",
|
|
2220
|
-
"msg": "Invalid twap period"
|
|
2221
|
-
},
|
|
2222
|
-
{
|
|
2223
|
-
"code": 6021,
|
|
2224
|
-
"name": "RefillAmountExceeded",
|
|
2225
|
-
"msg": "Refill amount exceeded"
|
|
2226
|
-
},
|
|
2227
|
-
{
|
|
2228
|
-
"code": 6022,
|
|
2229
|
-
"name": "PodTokenTotalSupplyZero",
|
|
2230
|
-
"msg": "Pod token total supply is zero"
|
|
2231
|
-
},
|
|
2232
|
-
{
|
|
2233
|
-
"code": 6023,
|
|
2234
|
-
"name": "AllocationBpsGreaterThanGlobalAllocationBps",
|
|
2235
|
-
"msg": "Allocation bps greater than global allocation bps"
|
|
2236
|
-
},
|
|
2237
|
-
{
|
|
2238
|
-
"code": 6024,
|
|
2239
|
-
"name": "EquityOutOfBufferBound",
|
|
2240
|
-
"msg": "Equity out of buffer bound"
|
|
2241
|
-
},
|
|
2242
|
-
{
|
|
2243
|
-
"code": 6025,
|
|
2244
|
-
"name": "RedemptionAmountZero",
|
|
2245
|
-
"msg": "Redemption amount must be > 0"
|
|
2246
|
-
},
|
|
2247
|
-
{
|
|
2248
|
-
"code": 6026,
|
|
2249
|
-
"name": "PendingDepositExists",
|
|
2250
|
-
"msg": "Pending deposit exists"
|
|
2251
|
-
},
|
|
2252
|
-
{
|
|
2253
|
-
"code": 6027,
|
|
2254
|
-
"name": "InsufficientSharesBalance",
|
|
2255
|
-
"msg": "Insufficient Shares balance"
|
|
2256
|
-
},
|
|
2257
|
-
{
|
|
2258
|
-
"code": 6028,
|
|
2259
|
-
"name": "PendingWithdrawalExists",
|
|
2260
|
-
"msg": "Pending withdrawal exists"
|
|
2261
|
-
},
|
|
2262
|
-
{
|
|
2263
|
-
"code": 6029,
|
|
2264
|
-
"name": "PendingDepositOrWithdrawalExists",
|
|
2265
|
-
"msg": "Pending deposit or withdrawal exists"
|
|
2266
|
-
},
|
|
2267
|
-
{
|
|
2268
|
-
"code": 6030,
|
|
2269
|
-
"name": "NoPendingWithdrawal",
|
|
2270
|
-
"msg": "No pending withdrawal"
|
|
2271
|
-
},
|
|
2272
|
-
{
|
|
2273
|
-
"code": 6031,
|
|
2274
|
-
"name": "WithdrawalAlreadyProcessed",
|
|
2275
|
-
"msg": "Withdrawal already processed"
|
|
2276
|
-
},
|
|
2277
|
-
{
|
|
2278
|
-
"code": 6032,
|
|
2279
|
-
"name": "PendingDepositAmountZero",
|
|
2280
|
-
"msg": "Pending deposit amount is zero"
|
|
2281
|
-
},
|
|
2282
|
-
{
|
|
2283
|
-
"code": 6033,
|
|
2284
|
-
"name": "InsufficientBundleBalance",
|
|
2285
|
-
"msg": "Insufficient bundle balance"
|
|
2286
|
-
},
|
|
2287
|
-
{
|
|
2288
|
-
"code": 6034,
|
|
2289
|
-
"name": "NoPendingTransactions",
|
|
2290
|
-
"msg": "No pending transactions"
|
|
2291
|
-
},
|
|
2292
|
-
{
|
|
2293
|
-
"code": 6035,
|
|
2294
|
-
"name": "DepositsExtraInPendingsNotZero",
|
|
2295
|
-
"msg": "Deposits extra in pendings not zero"
|
|
2296
|
-
},
|
|
2297
|
-
{
|
|
2298
|
-
"code": 6036,
|
|
2299
|
-
"name": "PendingTransactionsExist",
|
|
2300
|
-
"msg": "Pending transactions exist"
|
|
2301
|
-
},
|
|
2302
|
-
{
|
|
2303
|
-
"code": 6037,
|
|
2304
|
-
"name": "ManagerSharesZero",
|
|
2305
|
-
"msg": "Manager shares is zero"
|
|
2306
|
-
},
|
|
2307
|
-
{
|
|
2308
|
-
"code": 6038,
|
|
2309
|
-
"name": "PausedDepositsWithdrawals",
|
|
2310
|
-
"msg": "Paused deposits withdrawals"
|
|
2311
|
-
},
|
|
2312
|
-
{
|
|
2313
|
-
"code": 6039,
|
|
2314
|
-
"name": "UnpausedDepositsWithdrawals",
|
|
2315
|
-
"msg": "Unpaused deposits withdrawals"
|
|
2316
|
-
},
|
|
2317
|
-
{
|
|
2318
|
-
"code": 6040,
|
|
2319
|
-
"name": "NettingNotDone",
|
|
2320
|
-
"msg": "Netting not done"
|
|
2321
|
-
},
|
|
2322
|
-
{
|
|
2323
|
-
"code": 6041,
|
|
2324
|
-
"name": "NettingAlreadyDone",
|
|
2325
|
-
"msg": "Netting already done"
|
|
2326
|
-
},
|
|
2327
|
-
{
|
|
2328
|
-
"code": 6042,
|
|
2329
|
-
"name": "OracleNotUpdated",
|
|
2330
|
-
"msg": "Oracle not updated"
|
|
2331
|
-
},
|
|
2332
|
-
{
|
|
2333
|
-
"code": 6043,
|
|
2334
|
-
"name": "MaxDepositAmountExceeded",
|
|
2335
|
-
"msg": "Max deposit amount exceeded"
|
|
2336
|
-
},
|
|
2337
|
-
{
|
|
2338
|
-
"code": 6044,
|
|
2339
|
-
"name": "TotalAssetExceedNewMaxDepositAmount",
|
|
2340
|
-
"msg": "Total asset exceed new max deposit amount"
|
|
2341
|
-
},
|
|
2342
|
-
{
|
|
2343
|
-
"code": 6045,
|
|
2344
|
-
"name": "AllocationBpsIsZero",
|
|
2345
|
-
"msg": "Allocation bps is zero"
|
|
2346
|
-
},
|
|
2347
|
-
{
|
|
2348
|
-
"code": 6046,
|
|
2349
|
-
"name": "DepositAmountZero",
|
|
2350
|
-
"msg": "Deposit amount is zero"
|
|
2351
|
-
},
|
|
2352
|
-
{
|
|
2353
|
-
"code": 6047,
|
|
2354
|
-
"name": "InvalidWithdrawalDelay",
|
|
2355
|
-
"msg": "Invalid withdrawal delay"
|
|
2356
|
-
},
|
|
2357
|
-
{
|
|
2358
|
-
"code": 6048,
|
|
2359
|
-
"name": "InvalidWithdrawalCooldownPeriod",
|
|
2360
|
-
"msg": "Invalid withdrawal cooldown period"
|
|
2361
|
-
},
|
|
2362
|
-
{
|
|
2363
|
-
"code": 6049,
|
|
2364
|
-
"name": "InvalidOracleBuffer",
|
|
2365
|
-
"msg": "Invalid oracle buffer"
|
|
2366
|
-
},
|
|
2367
|
-
{
|
|
2368
|
-
"code": 6050,
|
|
2369
|
-
"name": "ExcessivePerformanceFee",
|
|
2370
|
-
"msg": "Excessive performance fee"
|
|
2371
|
-
},
|
|
2372
|
-
{
|
|
2373
|
-
"code": 6051,
|
|
2374
|
-
"name": "ExcessiveManagementFee",
|
|
2375
|
-
"msg": "Excessive management fee"
|
|
2376
|
-
},
|
|
2377
|
-
{
|
|
2378
|
-
"code": 6052,
|
|
2379
|
-
"name": "ExcessiveDepositFee",
|
|
2380
|
-
"msg": "Excessive deposit fee"
|
|
2381
|
-
},
|
|
2382
|
-
{
|
|
2383
|
-
"code": 6053,
|
|
2384
|
-
"name": "ExcessiveWithdrawFee",
|
|
2385
|
-
"msg": "Excessive withdraw fee"
|
|
2386
|
-
},
|
|
2387
|
-
{
|
|
2388
|
-
"code": 6054,
|
|
2389
|
-
"name": "WithdrawalDelayNotMet",
|
|
2390
|
-
"msg": "Withdrawal delay not met"
|
|
2391
|
-
},
|
|
2392
|
-
{
|
|
2393
|
-
"code": 6055,
|
|
2394
|
-
"name": "InvalidAssetPrecision",
|
|
2395
|
-
"msg": "Invalid asset precision"
|
|
2396
|
-
},
|
|
2397
|
-
{
|
|
2398
|
-
"code": 6056,
|
|
2399
|
-
"name": "InvalidAssetAddress",
|
|
2400
|
-
"msg": "Invalid asset address"
|
|
2401
|
-
},
|
|
2402
|
-
{
|
|
2403
|
-
"code": 6057,
|
|
2404
|
-
"name": "InvalidPermissionnedDepositor",
|
|
2405
|
-
"msg": "Invalid permissionned depositor"
|
|
2406
|
-
},
|
|
2407
|
-
{
|
|
2408
|
-
"code": 6058,
|
|
2409
|
-
"name": "PayerNotAuthority",
|
|
2410
|
-
"msg": "Payer is not the authority"
|
|
2411
|
-
},
|
|
2412
|
-
{
|
|
2413
|
-
"code": 6059,
|
|
2414
|
-
"name": "StrategyAlreadyEnabled",
|
|
2415
|
-
"msg": "Strategy is already enabled"
|
|
2416
|
-
},
|
|
2417
|
-
{
|
|
2418
|
-
"code": 6060,
|
|
2419
|
-
"name": "StrategyDisabled",
|
|
2420
|
-
"msg": "Strategy is disabled"
|
|
2421
|
-
}
|
|
2422
|
-
]
|
|
2423
|
-
};
|
|
2424
27
|
|
|
2425
28
|
//#endregion
|
|
2426
|
-
//#region src/idl/
|
|
2427
|
-
var
|
|
2428
|
-
address: "
|
|
29
|
+
//#region src/idl/ntbundle.json
|
|
30
|
+
var ntbundle_default = {
|
|
31
|
+
address: "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU",
|
|
2429
32
|
metadata: {
|
|
2430
33
|
"name": "ntbundle",
|
|
2431
34
|
"version": "0.1.0",
|
|
@@ -3274,6 +877,18 @@ var bundle_v2_default = {
|
|
|
3274
877
|
"name": "oracle_update_time_limit",
|
|
3275
878
|
"type": "i64"
|
|
3276
879
|
},
|
|
880
|
+
{
|
|
881
|
+
"name": "withdrawal_redemption_request_cutoff_ts",
|
|
882
|
+
"type": "i64"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
"name": "withdrawal_redemption_unlock_current_cycle_ts",
|
|
886
|
+
"type": "i64"
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"name": "withdrawal_redemption_unlock_next_cycle_ts",
|
|
890
|
+
"type": "i64"
|
|
891
|
+
},
|
|
3277
892
|
{
|
|
3278
893
|
"name": "permissionned",
|
|
3279
894
|
"type": "bool"
|
|
@@ -5883,6 +3498,41 @@ var bundle_v2_default = {
|
|
|
5883
3498
|
"type": "i64"
|
|
5884
3499
|
}]
|
|
5885
3500
|
},
|
|
3501
|
+
{
|
|
3502
|
+
"name": "set_withdrawal_redemption_schedule",
|
|
3503
|
+
"discriminator": [
|
|
3504
|
+
134,
|
|
3505
|
+
108,
|
|
3506
|
+
237,
|
|
3507
|
+
103,
|
|
3508
|
+
185,
|
|
3509
|
+
13,
|
|
3510
|
+
177,
|
|
3511
|
+
105
|
|
3512
|
+
],
|
|
3513
|
+
"accounts": [{
|
|
3514
|
+
"name": "manager",
|
|
3515
|
+
"writable": true,
|
|
3516
|
+
"signer": true
|
|
3517
|
+
}, {
|
|
3518
|
+
"name": "bundle_account",
|
|
3519
|
+
"writable": true
|
|
3520
|
+
}],
|
|
3521
|
+
"args": [
|
|
3522
|
+
{
|
|
3523
|
+
"name": "withdrawal_redemption_request_cutoff_ts",
|
|
3524
|
+
"type": "i64"
|
|
3525
|
+
},
|
|
3526
|
+
{
|
|
3527
|
+
"name": "withdrawal_redemption_unlock_current_cycle_ts",
|
|
3528
|
+
"type": "i64"
|
|
3529
|
+
},
|
|
3530
|
+
{
|
|
3531
|
+
"name": "withdrawal_redemption_unlock_next_cycle_ts",
|
|
3532
|
+
"type": "i64"
|
|
3533
|
+
}
|
|
3534
|
+
]
|
|
3535
|
+
},
|
|
5886
3536
|
{
|
|
5887
3537
|
"name": "start_distribution",
|
|
5888
3538
|
"discriminator": [
|
|
@@ -6715,6 +4365,19 @@ var bundle_v2_default = {
|
|
|
6715
4365
|
207
|
|
6716
4366
|
]
|
|
6717
4367
|
},
|
|
4368
|
+
{
|
|
4369
|
+
"name": "WithdrawalRedemptionScheduleSet",
|
|
4370
|
+
"discriminator": [
|
|
4371
|
+
245,
|
|
4372
|
+
195,
|
|
4373
|
+
40,
|
|
4374
|
+
76,
|
|
4375
|
+
237,
|
|
4376
|
+
247,
|
|
4377
|
+
150,
|
|
4378
|
+
107
|
|
4379
|
+
]
|
|
4380
|
+
},
|
|
6718
4381
|
{
|
|
6719
4382
|
"name": "WithdrawalRequested",
|
|
6720
4383
|
"discriminator": [
|
|
@@ -7092,6 +4755,11 @@ var bundle_v2_default = {
|
|
|
7092
4755
|
"code": 6069,
|
|
7093
4756
|
"name": "InvalidOracleUpdateTimeLimit",
|
|
7094
4757
|
"msg": "Invalid oracle update time limit"
|
|
4758
|
+
},
|
|
4759
|
+
{
|
|
4760
|
+
"code": 6070,
|
|
4761
|
+
"name": "InvalidWithdrawalRedemptionSchedule",
|
|
4762
|
+
"msg": "Invalid withdrawal redemption schedule"
|
|
7095
4763
|
}
|
|
7096
4764
|
],
|
|
7097
4765
|
types: [
|
|
@@ -7119,6 +4787,26 @@ var bundle_v2_default = {
|
|
|
7119
4787
|
{
|
|
7120
4788
|
"name": "bundle_account_key",
|
|
7121
4789
|
"type": "pubkey"
|
|
4790
|
+
},
|
|
4791
|
+
{
|
|
4792
|
+
"name": "net_amount",
|
|
4793
|
+
"type": "u64"
|
|
4794
|
+
},
|
|
4795
|
+
{
|
|
4796
|
+
"name": "share_price",
|
|
4797
|
+
"type": "u128"
|
|
4798
|
+
},
|
|
4799
|
+
{
|
|
4800
|
+
"name": "user_shares_before",
|
|
4801
|
+
"type": "u128"
|
|
4802
|
+
},
|
|
4803
|
+
{
|
|
4804
|
+
"name": "user_shares_after",
|
|
4805
|
+
"type": "u128"
|
|
4806
|
+
},
|
|
4807
|
+
{
|
|
4808
|
+
"name": "total_shares",
|
|
4809
|
+
"type": "u128"
|
|
7122
4810
|
}
|
|
7123
4811
|
]
|
|
7124
4812
|
}
|
|
@@ -7199,10 +4887,6 @@ var bundle_v2_default = {
|
|
|
7199
4887
|
"name": "max_deposit_amount",
|
|
7200
4888
|
"type": "u64"
|
|
7201
4889
|
},
|
|
7202
|
-
{
|
|
7203
|
-
"name": "min_deposit_amount",
|
|
7204
|
-
"type": "u64"
|
|
7205
|
-
},
|
|
7206
4890
|
{
|
|
7207
4891
|
"name": "withdrawal_delay",
|
|
7208
4892
|
"type": "u64"
|
|
@@ -7235,14 +4919,6 @@ var bundle_v2_default = {
|
|
|
7235
4919
|
"name": "oracle_buffer",
|
|
7236
4920
|
"type": "u64"
|
|
7237
4921
|
},
|
|
7238
|
-
{
|
|
7239
|
-
"name": "oracle_update_time_limit",
|
|
7240
|
-
"type": "i64"
|
|
7241
|
-
},
|
|
7242
|
-
{
|
|
7243
|
-
"name": "oracle_max_age",
|
|
7244
|
-
"type": "i64"
|
|
7245
|
-
},
|
|
7246
4922
|
{
|
|
7247
4923
|
"name": "total_shares",
|
|
7248
4924
|
"type": "u128"
|
|
@@ -7279,9 +4955,33 @@ var bundle_v2_default = {
|
|
|
7279
4955
|
"name": "manager_mfee_shares",
|
|
7280
4956
|
"type": "u128"
|
|
7281
4957
|
},
|
|
4958
|
+
{
|
|
4959
|
+
"name": "min_deposit_amount",
|
|
4960
|
+
"type": "u64"
|
|
4961
|
+
},
|
|
4962
|
+
{
|
|
4963
|
+
"name": "oracle_update_time_limit",
|
|
4964
|
+
"type": "i64"
|
|
4965
|
+
},
|
|
4966
|
+
{
|
|
4967
|
+
"name": "oracle_max_age",
|
|
4968
|
+
"type": "i64"
|
|
4969
|
+
},
|
|
4970
|
+
{
|
|
4971
|
+
"name": "withdrawal_redemption_request_cutoff_ts",
|
|
4972
|
+
"type": "i64"
|
|
4973
|
+
},
|
|
4974
|
+
{
|
|
4975
|
+
"name": "withdrawal_redemption_unlock_current_cycle_ts",
|
|
4976
|
+
"type": "i64"
|
|
4977
|
+
},
|
|
4978
|
+
{
|
|
4979
|
+
"name": "withdrawal_redemption_unlock_next_cycle_ts",
|
|
4980
|
+
"type": "i64"
|
|
4981
|
+
},
|
|
7282
4982
|
{
|
|
7283
4983
|
"name": "padding",
|
|
7284
|
-
"type": { "array": ["u8",
|
|
4984
|
+
"type": { "array": ["u8", 207] }
|
|
7285
4985
|
}
|
|
7286
4986
|
]
|
|
7287
4987
|
}
|
|
@@ -7523,6 +5223,22 @@ var bundle_v2_default = {
|
|
|
7523
5223
|
{
|
|
7524
5224
|
"name": "topping_up",
|
|
7525
5225
|
"type": "bool"
|
|
5226
|
+
},
|
|
5227
|
+
{
|
|
5228
|
+
"name": "gross_amount",
|
|
5229
|
+
"type": "u64"
|
|
5230
|
+
},
|
|
5231
|
+
{
|
|
5232
|
+
"name": "fee_amount",
|
|
5233
|
+
"type": "u64"
|
|
5234
|
+
},
|
|
5235
|
+
{
|
|
5236
|
+
"name": "net_amount",
|
|
5237
|
+
"type": "u64"
|
|
5238
|
+
},
|
|
5239
|
+
{
|
|
5240
|
+
"name": "asset_mint",
|
|
5241
|
+
"type": "pubkey"
|
|
7526
5242
|
}
|
|
7527
5243
|
]
|
|
7528
5244
|
}
|
|
@@ -7828,6 +5544,30 @@ var bundle_v2_default = {
|
|
|
7828
5544
|
{
|
|
7829
5545
|
"name": "bundle_account_key",
|
|
7830
5546
|
"type": "pubkey"
|
|
5547
|
+
},
|
|
5548
|
+
{
|
|
5549
|
+
"name": "gross_amount",
|
|
5550
|
+
"type": "u64"
|
|
5551
|
+
},
|
|
5552
|
+
{
|
|
5553
|
+
"name": "share_price",
|
|
5554
|
+
"type": "u128"
|
|
5555
|
+
},
|
|
5556
|
+
{
|
|
5557
|
+
"name": "user_shares_before",
|
|
5558
|
+
"type": "u128"
|
|
5559
|
+
},
|
|
5560
|
+
{
|
|
5561
|
+
"name": "user_shares_after",
|
|
5562
|
+
"type": "u128"
|
|
5563
|
+
},
|
|
5564
|
+
{
|
|
5565
|
+
"name": "total_shares_before",
|
|
5566
|
+
"type": "u128"
|
|
5567
|
+
},
|
|
5568
|
+
{
|
|
5569
|
+
"name": "total_shares_after",
|
|
5570
|
+
"type": "u128"
|
|
7831
5571
|
}
|
|
7832
5572
|
]
|
|
7833
5573
|
}
|
|
@@ -8051,6 +5791,26 @@ var bundle_v2_default = {
|
|
|
8051
5791
|
}]
|
|
8052
5792
|
}
|
|
8053
5793
|
},
|
|
5794
|
+
{
|
|
5795
|
+
"name": "WithdrawalRedemptionScheduleSet",
|
|
5796
|
+
"type": {
|
|
5797
|
+
"kind": "struct",
|
|
5798
|
+
"fields": [
|
|
5799
|
+
{
|
|
5800
|
+
"name": "withdrawal_redemption_request_cutoff_ts",
|
|
5801
|
+
"type": "i64"
|
|
5802
|
+
},
|
|
5803
|
+
{
|
|
5804
|
+
"name": "withdrawal_redemption_unlock_current_cycle_ts",
|
|
5805
|
+
"type": "i64"
|
|
5806
|
+
},
|
|
5807
|
+
{
|
|
5808
|
+
"name": "withdrawal_redemption_unlock_next_cycle_ts",
|
|
5809
|
+
"type": "i64"
|
|
5810
|
+
}
|
|
5811
|
+
]
|
|
5812
|
+
}
|
|
5813
|
+
},
|
|
8054
5814
|
{
|
|
8055
5815
|
"name": "WithdrawalRequested",
|
|
8056
5816
|
"type": {
|
|
@@ -8079,6 +5839,14 @@ var bundle_v2_default = {
|
|
|
8079
5839
|
{
|
|
8080
5840
|
"name": "bundle_account_key",
|
|
8081
5841
|
"type": "pubkey"
|
|
5842
|
+
},
|
|
5843
|
+
{
|
|
5844
|
+
"name": "cooldown_end_timestamp",
|
|
5845
|
+
"type": "i64"
|
|
5846
|
+
},
|
|
5847
|
+
{
|
|
5848
|
+
"name": "estimated_net_amount",
|
|
5849
|
+
"type": "u64"
|
|
8082
5850
|
}
|
|
8083
5851
|
]
|
|
8084
5852
|
}
|
|
@@ -8112,31 +5880,31 @@ var bundle_v2_default = {
|
|
|
8112
5880
|
|
|
8113
5881
|
//#endregion
|
|
8114
5882
|
//#region src/constants/programs.ts
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
* Create Bundle Program instances for a given provider
|
|
8122
|
-
*/
|
|
8123
|
-
function createBundleProgramV1(provider) {
|
|
8124
|
-
return new Program(bundle_v1_default, new PublicKey(BundleProgramId.V1), provider);
|
|
5883
|
+
function toCustomProgramPublicKey(programId) {
|
|
5884
|
+
try {
|
|
5885
|
+
return new PublicKey(programId);
|
|
5886
|
+
} catch {
|
|
5887
|
+
throw new Error(`Invalid custom bundle program id: ${programId}`);
|
|
5888
|
+
}
|
|
8125
5889
|
}
|
|
8126
|
-
|
|
8127
|
-
|
|
5890
|
+
const DEFAULT_BUNDLE_PROGRAM_ID_MAINNET = "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU";
|
|
5891
|
+
const DEFAULT_BUNDLE_PROGRAM_ID_DEVNET = "7trSyt7d1ZRnvfGh9JaQZwZMWtfAXMvMwN3UxgMzVFbv";
|
|
5892
|
+
const DEFAULT_BUNDLE_PROGRAM_IDS_BY_CLUSTER = {
|
|
5893
|
+
mainnet: DEFAULT_BUNDLE_PROGRAM_ID_MAINNET,
|
|
5894
|
+
devnet: DEFAULT_BUNDLE_PROGRAM_ID_DEVNET
|
|
5895
|
+
};
|
|
5896
|
+
function getDefaultBundleProgramIdByCluster(cluster = "mainnet") {
|
|
5897
|
+
return DEFAULT_BUNDLE_PROGRAM_IDS_BY_CLUSTER[cluster];
|
|
8128
5898
|
}
|
|
8129
5899
|
/**
|
|
8130
|
-
* Create
|
|
8131
|
-
* Use bundleProgramV1 for V1 vaults, bundleProgramV2 for V2 vaults (e.g. vault 69).
|
|
5900
|
+
* Create Bundle Program client for a specific program id.
|
|
8132
5901
|
*/
|
|
8133
|
-
function
|
|
8134
|
-
const
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
};
|
|
5902
|
+
function createBundleProgramById(provider, programId) {
|
|
5903
|
+
const resolved = toCustomProgramPublicKey(programId).toBase58();
|
|
5904
|
+
return new Program({
|
|
5905
|
+
...ntbundle_default,
|
|
5906
|
+
address: resolved
|
|
5907
|
+
}, provider);
|
|
8140
5908
|
}
|
|
8141
5909
|
|
|
8142
5910
|
//#endregion
|
|
@@ -9296,17 +7064,14 @@ const VaultRegistryArraySchema = z.array(VaultRegistryEntrySchema).superRefine((
|
|
|
9296
7064
|
|
|
9297
7065
|
//#endregion
|
|
9298
7066
|
//#region src/constants/vaults.ts
|
|
9299
|
-
const VAULT_PROGRAM_ID = new PublicKey("vAuLTsyrvSfZRuRB3XgvkPwNGgYSs9YRYymVebLKoxR");
|
|
9300
7067
|
/**
|
|
9301
7068
|
* Get Bundle Program ID for a vault config
|
|
9302
|
-
* Uses registry value if present, otherwise
|
|
7069
|
+
* Uses registry value if present, otherwise falls back to cluster default.
|
|
9303
7070
|
*/
|
|
9304
|
-
function getBundleProgramId(vault) {
|
|
7071
|
+
function getBundleProgramId(vault, cluster = "mainnet") {
|
|
9305
7072
|
if (vault.type !== VaultType.Bundle) return;
|
|
9306
|
-
if (vault.bundleProgramId)
|
|
9307
|
-
|
|
9308
|
-
}
|
|
9309
|
-
return BundleProgramId.V1;
|
|
7073
|
+
if (vault.bundleProgramId) return vault.bundleProgramId;
|
|
7074
|
+
return getDefaultBundleProgramIdByCluster(cluster);
|
|
9310
7075
|
}
|
|
9311
7076
|
/**
|
|
9312
7077
|
* Get Drift Program ID for a vault config as PublicKey
|
|
@@ -9315,7 +7080,7 @@ function getBundleProgramId(vault) {
|
|
|
9315
7080
|
function getDriftProgramId(vault) {
|
|
9316
7081
|
if (vault.type !== VaultType.Drift) return;
|
|
9317
7082
|
if (vault.driftProgramId) return vault.driftProgramId;
|
|
9318
|
-
return
|
|
7083
|
+
return "vAuLTsyrvSfZRuRB3XgvkPwNGgYSs9YRYymVebLKoxR";
|
|
9319
7084
|
}
|
|
9320
7085
|
/**
|
|
9321
7086
|
* Transform a registry entry to VaultConfig with program IDs
|
|
@@ -9326,7 +7091,7 @@ function toVaultConfig(entry) {
|
|
|
9326
7091
|
return {
|
|
9327
7092
|
...entry,
|
|
9328
7093
|
driftProgramId: getDriftProgramId(entry),
|
|
9329
|
-
bundleProgramId:
|
|
7094
|
+
bundleProgramId: entry.bundleProgramId
|
|
9330
7095
|
};
|
|
9331
7096
|
}
|
|
9332
7097
|
/**
|
|
@@ -9393,9 +7158,9 @@ function derivePendingAuthPDA(bundlePDA, programId) {
|
|
|
9393
7158
|
function getVaultDepositorAddressSync(programId, vault, authority) {
|
|
9394
7159
|
let _vault = vault;
|
|
9395
7160
|
if (vault.toBase58() === "3Nkctq19AW7gs5hkxixUDjS9UVjmCwcNCo7rqPpub87c") {
|
|
9396
|
-
const name
|
|
9397
|
-
name
|
|
9398
|
-
_vault = PublicKey.findProgramAddressSync([encoder.encode("vault"), name
|
|
7161
|
+
const name = new Uint8Array(32);
|
|
7162
|
+
name.set(encoder.encode("Neutral Trade"));
|
|
7163
|
+
_vault = PublicKey.findProgramAddressSync([encoder.encode("vault"), name], programId)[0];
|
|
9399
7164
|
}
|
|
9400
7165
|
return PublicKey.findProgramAddressSync([
|
|
9401
7166
|
encoder.encode("vault_depositor"),
|
|
@@ -9493,68 +7258,41 @@ function calculateBundleUserBalance({ oracleData, bundleData, userBundle, assetD
|
|
|
9493
7258
|
asset
|
|
9494
7259
|
};
|
|
9495
7260
|
}
|
|
9496
|
-
async function getBundleBalances({ vaultIds, userAddress, vaults: vaults$1,
|
|
7261
|
+
async function getBundleBalances({ vaultIds, userAddress, vaults: vaults$1, bundlePrograms, bundleCluster = "mainnet", priceMap }) {
|
|
9497
7262
|
const result = {};
|
|
9498
7263
|
const userPublicKey = new PublicKey(userAddress);
|
|
9499
|
-
const
|
|
9500
|
-
const v2Vaults = [];
|
|
7264
|
+
const matchingVaultsByProgram = {};
|
|
9501
7265
|
for (const vaultId of vaultIds) {
|
|
9502
7266
|
const config = vaults$1[vaultId];
|
|
9503
7267
|
if (!config) continue;
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
7268
|
+
const expectedProgramId = getBundleProgramId(config, bundleCluster);
|
|
7269
|
+
if (!expectedProgramId) continue;
|
|
7270
|
+
if (!bundlePrograms[expectedProgramId]) {
|
|
7271
|
+
result[vaultId] = null;
|
|
7272
|
+
continue;
|
|
7273
|
+
}
|
|
7274
|
+
if (!matchingVaultsByProgram[expectedProgramId]) matchingVaultsByProgram[expectedProgramId] = [];
|
|
7275
|
+
matchingVaultsByProgram[expectedProgramId].push({
|
|
9509
7276
|
vaultId,
|
|
9510
7277
|
config
|
|
9511
7278
|
});
|
|
9512
7279
|
}
|
|
9513
|
-
|
|
9514
|
-
const
|
|
9515
|
-
|
|
9516
|
-
const
|
|
9517
|
-
const
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
const { vaultId, config } = v1Vaults[i];
|
|
9524
|
-
const bundle = v1Bundles[i];
|
|
9525
|
-
const oracle = v1Oracles[i];
|
|
9526
|
-
const userBundle = v1Users[i];
|
|
9527
|
-
if (!bundle || !oracle || !userBundle) {
|
|
9528
|
-
result[vaultId] = null;
|
|
9529
|
-
continue;
|
|
9530
|
-
}
|
|
9531
|
-
const assetDecimals = tokens[config.depositToken]?.onChain?.Solana?.decimals || 6;
|
|
9532
|
-
const spotPrice = priceMap.get(config.depositToken);
|
|
9533
|
-
if (spotPrice === void 0) throw new Error(`Price not found for token ${config.depositToken}. This should not happen as prices are initialized during creation.`);
|
|
9534
|
-
result[vaultId] = calculateBundleUserBalance({
|
|
9535
|
-
oracleData: oracle,
|
|
9536
|
-
bundleData: bundle,
|
|
9537
|
-
userBundle,
|
|
9538
|
-
assetDecimals,
|
|
9539
|
-
spotPrice,
|
|
9540
|
-
asset: config.depositToken
|
|
9541
|
-
});
|
|
9542
|
-
}
|
|
9543
|
-
}
|
|
9544
|
-
if (v2Vaults.length > 0) {
|
|
9545
|
-
const v2BundlePDAs = v2Vaults.map(({ config }) => new PublicKey(config.vaultAddress));
|
|
9546
|
-
const v2OraclePDAs = v2BundlePDAs.map((bundlePDA) => deriveOraclePDA(bundlePDA, bundleProgramV2.programId));
|
|
9547
|
-
const v2UserPDAs = v2BundlePDAs.map((bundlePDA) => deriveUserPDA(userPublicKey, bundlePDA, bundleProgramV2.programId));
|
|
9548
|
-
const [v2Bundles, v2Oracles, v2Users] = await Promise.all([
|
|
9549
|
-
bundleProgramV2.account.bundle.fetchMultiple(v2BundlePDAs),
|
|
9550
|
-
bundleProgramV2.account.oracleData.fetchMultiple(v2OraclePDAs),
|
|
9551
|
-
bundleProgramV2.account.userBundleAccount.fetchMultiple(v2UserPDAs)
|
|
7280
|
+
for (const [programId, matchingVaults] of Object.entries(matchingVaultsByProgram)) {
|
|
7281
|
+
const bundleProgram = bundlePrograms[programId];
|
|
7282
|
+
if (!bundleProgram) continue;
|
|
7283
|
+
const bundlePDAs = matchingVaults.map(({ config }) => new PublicKey(config.vaultAddress));
|
|
7284
|
+
const oraclePDAs = bundlePDAs.map((bundlePDA) => deriveOraclePDA(bundlePDA, bundleProgram.programId));
|
|
7285
|
+
const userPDAs = bundlePDAs.map((bundlePDA) => deriveUserPDA(userPublicKey, bundlePDA, bundleProgram.programId));
|
|
7286
|
+
const [bundles, oracles, users] = await Promise.all([
|
|
7287
|
+
bundleProgram.account.bundle.fetchMultiple(bundlePDAs),
|
|
7288
|
+
bundleProgram.account.oracleData.fetchMultiple(oraclePDAs),
|
|
7289
|
+
bundleProgram.account.userBundleAccount.fetchMultiple(userPDAs)
|
|
9552
7290
|
]);
|
|
9553
|
-
for (let i = 0; i <
|
|
9554
|
-
const { vaultId, config } =
|
|
9555
|
-
const bundle =
|
|
9556
|
-
const oracle =
|
|
9557
|
-
const userBundle =
|
|
7291
|
+
for (let i = 0; i < matchingVaults.length; i++) {
|
|
7292
|
+
const { vaultId, config } = matchingVaults[i];
|
|
7293
|
+
const bundle = bundles[i];
|
|
7294
|
+
const oracle = oracles[i];
|
|
7295
|
+
const userBundle = users[i];
|
|
9558
7296
|
if (!bundle || !oracle || !userBundle) {
|
|
9559
7297
|
result[vaultId] = null;
|
|
9560
7298
|
continue;
|
|
@@ -9587,58 +7325,40 @@ function computeRequestWithdrawalSharesAmount({ amount, userVaultBalance, pps, a
|
|
|
9587
7325
|
function assertBundleVault(vault) {
|
|
9588
7326
|
if (vault.type !== VaultType.Bundle) throw new Error(`Vault ${vault.vaultId} is not a Bundle vault`);
|
|
9589
7327
|
}
|
|
9590
|
-
function bundleProgramIdForVault(vault) {
|
|
9591
|
-
const id = getBundleProgramId(vault);
|
|
7328
|
+
function bundleProgramIdForVault(vault, bundleCluster = "mainnet") {
|
|
7329
|
+
const id = getBundleProgramId(vault, bundleCluster);
|
|
9592
7330
|
if (!id) throw new Error(`Vault ${vault.vaultId} has no Bundle program id`);
|
|
9593
7331
|
return id;
|
|
9594
7332
|
}
|
|
9595
7333
|
/**
|
|
9596
7334
|
* Optional `initializeBundleDepositor` + `requestDeposit`. Fetches bundle account internally.
|
|
9597
7335
|
*/
|
|
9598
|
-
async function buildBundleDepositInstructions({
|
|
7336
|
+
async function buildBundleDepositInstructions({ bundleProgram, bundleCluster = "mainnet", vault, user, amount, needsInit = false }) {
|
|
9599
7337
|
assertBundleVault(vault);
|
|
9600
7338
|
const bundlePDA = new PublicKey(vault.vaultAddress);
|
|
9601
|
-
const
|
|
9602
|
-
|
|
7339
|
+
const programId = bundleProgramIdForVault(vault, bundleCluster);
|
|
7340
|
+
if (programId !== bundleProgram.programId.toBase58()) throw new Error(`Vault ${vault.vaultId} program id mismatch: vault=${programId}, client=${bundleProgram.programId.toBase58()}`);
|
|
7341
|
+
const bundleInfo = await bundleProgram.account.bundle.fetch(bundlePDA);
|
|
9603
7342
|
const depositAmountBN = new BN(Math.floor(amount * 10 ** bundleInfo.assetDecimals));
|
|
9604
|
-
const programPk =
|
|
7343
|
+
const programPk = bundleProgram.programId;
|
|
9605
7344
|
const oraclePDA = deriveOraclePDA(bundlePDA, programPk);
|
|
9606
7345
|
const userPDA = deriveUserPDA(user, bundlePDA, programPk);
|
|
9607
7346
|
const tempDataPDA = deriveTempDataPDA(bundlePDA, programPk);
|
|
9608
7347
|
const pendingAuthPDA = derivePendingAuthPDA(bundlePDA, programPk);
|
|
9609
7348
|
const userTokenAcct = getAssociatedTokenAddressSync(bundleInfo.assetAddress, user, true);
|
|
9610
7349
|
const pendingTokenAcct = getAssociatedTokenAddressSync(bundleInfo.assetAddress, pendingAuthPDA, true);
|
|
9611
|
-
const instructions$
|
|
7350
|
+
const instructions$1 = [];
|
|
9612
7351
|
if (needsInit) {
|
|
9613
|
-
const initIx =
|
|
9614
|
-
payer: user,
|
|
9615
|
-
authority: user,
|
|
9616
|
-
systemProgram: SystemProgram.programId,
|
|
9617
|
-
bundleAccount: bundlePDA,
|
|
9618
|
-
userBundleAccount: userPDA
|
|
9619
|
-
}).instruction() : await bundleProgramV1.methods.initializeBundleDepositor().accounts({
|
|
7352
|
+
const initIx = await bundleProgram.methods.initializeBundleDepositor().accounts({
|
|
9620
7353
|
payer: user,
|
|
9621
7354
|
authority: user,
|
|
9622
7355
|
systemProgram: SystemProgram.programId,
|
|
9623
7356
|
bundleAccount: bundlePDA,
|
|
9624
7357
|
userBundleAccount: userPDA
|
|
9625
7358
|
}).instruction();
|
|
9626
|
-
instructions$
|
|
7359
|
+
instructions$1.push(initIx);
|
|
9627
7360
|
}
|
|
9628
|
-
const depositIx =
|
|
9629
|
-
user,
|
|
9630
|
-
userTokenAccount: userTokenAcct,
|
|
9631
|
-
pendingDepositTokenAccount: pendingTokenAcct,
|
|
9632
|
-
treasuryAccount: bundleInfo.treasuryAccount,
|
|
9633
|
-
userBundleAccount: userPDA,
|
|
9634
|
-
assetAddress: bundleInfo.assetAddress,
|
|
9635
|
-
oracleData: oraclePDA,
|
|
9636
|
-
bundleTempData: tempDataPDA,
|
|
9637
|
-
bundleAccount: bundlePDA,
|
|
9638
|
-
pendingBundleAssetAuthority: pendingAuthPDA,
|
|
9639
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
9640
|
-
systemProgram: SystemProgram.programId
|
|
9641
|
-
}).instruction() : await bundleProgramV1.methods.requestDeposit(depositAmountBN).accounts({
|
|
7361
|
+
const depositIx = await bundleProgram.methods.requestDeposit(depositAmountBN).accounts({
|
|
9642
7362
|
user,
|
|
9643
7363
|
userTokenAccount: userTokenAcct,
|
|
9644
7364
|
pendingDepositTokenAccount: pendingTokenAcct,
|
|
@@ -9652,24 +7372,25 @@ async function buildBundleDepositInstructions({ bundleProgramV1, bundleProgramV2
|
|
|
9652
7372
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
9653
7373
|
systemProgram: SystemProgram.programId
|
|
9654
7374
|
}).instruction();
|
|
9655
|
-
instructions$
|
|
9656
|
-
return instructions$
|
|
7375
|
+
instructions$1.push(depositIx);
|
|
7376
|
+
return instructions$1;
|
|
9657
7377
|
}
|
|
9658
7378
|
/**
|
|
9659
7379
|
* `requestWithdrawal` only. Fetches bundle, oracle, and user bundle internally.
|
|
9660
7380
|
*/
|
|
9661
|
-
async function buildBundleRequestWithdrawInstruction({
|
|
7381
|
+
async function buildBundleRequestWithdrawInstruction({ bundleProgram, bundleCluster = "mainnet", vault, user, amount }) {
|
|
9662
7382
|
assertBundleVault(vault);
|
|
9663
7383
|
const bundlePDA = new PublicKey(vault.vaultAddress);
|
|
9664
|
-
const
|
|
9665
|
-
|
|
7384
|
+
const programId = bundleProgramIdForVault(vault, bundleCluster);
|
|
7385
|
+
if (programId !== bundleProgram.programId.toBase58()) throw new Error(`Vault ${vault.vaultId} program id mismatch: vault=${programId}, client=${bundleProgram.programId.toBase58()}`);
|
|
7386
|
+
const programPk = bundleProgram.programId;
|
|
9666
7387
|
const oraclePDA = deriveOraclePDA(bundlePDA, programPk);
|
|
9667
7388
|
const userPDA = deriveUserPDA(user, bundlePDA, programPk);
|
|
9668
7389
|
const tempDataPDA = deriveTempDataPDA(bundlePDA, programPk);
|
|
9669
7390
|
const [bundleAccount, oracleData, userBundle] = await Promise.all([
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
7391
|
+
bundleProgram.account.bundle.fetch(bundlePDA),
|
|
7392
|
+
bundleProgram.account.oracleData.fetch(oraclePDA),
|
|
7393
|
+
bundleProgram.account.userBundleAccount.fetch(userPDA)
|
|
9673
7394
|
]);
|
|
9674
7395
|
const pps = calculateOnChainPps({
|
|
9675
7396
|
oracleAverageExternalEquity: BigInt(oracleData.averageExternalEquity.toString()),
|
|
@@ -9685,16 +7406,7 @@ async function buildBundleRequestWithdrawInstruction({ bundleProgramV1, bundlePr
|
|
|
9685
7406
|
assetDecimals: bundleAccount.assetDecimals,
|
|
9686
7407
|
userShares: new BN(userBundle.shares.toString())
|
|
9687
7408
|
});
|
|
9688
|
-
return
|
|
9689
|
-
user,
|
|
9690
|
-
userBundleAccount: userPDA,
|
|
9691
|
-
bundleAccount: bundlePDA,
|
|
9692
|
-
oracleData: oraclePDA,
|
|
9693
|
-
bundleTempData: tempDataPDA,
|
|
9694
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
9695
|
-
systemProgram: SystemProgram.programId,
|
|
9696
|
-
rent: SYSVAR_RENT_PUBKEY
|
|
9697
|
-
}).instruction() : await bundleProgramV1.methods.requestWithdrawal(sharesAmount).accounts({
|
|
7409
|
+
return await bundleProgram.methods.requestWithdrawal(sharesAmount).accounts({
|
|
9698
7410
|
user,
|
|
9699
7411
|
userBundleAccount: userPDA,
|
|
9700
7412
|
bundleAccount: bundlePDA,
|
|
@@ -9775,49 +7487,73 @@ async function initializePrices(fallbackPrices) {
|
|
|
9775
7487
|
//#region src/NeutralTrade.ts
|
|
9776
7488
|
var NeutralTrade = class NeutralTrade {
|
|
9777
7489
|
connection;
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
/** Vault configurations
|
|
7490
|
+
bundlePrograms;
|
|
7491
|
+
bundleCluster;
|
|
7492
|
+
/** Vault configurations after merge order: built-in < local registry < registryUrl */
|
|
9781
7493
|
vaults;
|
|
9782
7494
|
/** Price map for deposit tokens */
|
|
9783
7495
|
priceMap;
|
|
9784
|
-
constructor(connection,
|
|
7496
|
+
constructor(connection, bundlePrograms, bundleCluster, vaults$1, priceMap) {
|
|
9785
7497
|
this.connection = connection;
|
|
9786
|
-
this.
|
|
9787
|
-
this.
|
|
7498
|
+
this.bundlePrograms = bundlePrograms;
|
|
7499
|
+
this.bundleCluster = bundleCluster;
|
|
9788
7500
|
this.vaults = vaults$1;
|
|
9789
7501
|
this.priceMap = priceMap;
|
|
9790
7502
|
}
|
|
9791
7503
|
/**
|
|
9792
7504
|
* Create a new NeutralTrade instance
|
|
9793
|
-
*
|
|
7505
|
+
* Merge order: built-in (when allowed) < local registry < registryUrl
|
|
7506
|
+
* @throws Error if registry or registryUrl validation fails (or fetch fails for registryUrl)
|
|
9794
7507
|
*/
|
|
9795
7508
|
static async initCore(config) {
|
|
9796
7509
|
const connection = createConnection(config.rpcUrl);
|
|
9797
|
-
const
|
|
9798
|
-
const
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
7510
|
+
const provider = createAnchorProvider(connection);
|
|
7511
|
+
const cluster = config.bundleCluster ?? "mainnet";
|
|
7512
|
+
let vaults$1 = config.includeBuiltInVaults !== false ? { ...vaults } : {};
|
|
7513
|
+
if (config.registry) {
|
|
7514
|
+
const localVaults = NeutralTrade.parseVaultRegistryEntries(config.registry, "registry");
|
|
7515
|
+
vaults$1 = {
|
|
7516
|
+
...vaults$1,
|
|
7517
|
+
...localVaults
|
|
7518
|
+
};
|
|
7519
|
+
}
|
|
9802
7520
|
if (config.registryUrl) {
|
|
9803
7521
|
const remoteVaults = await NeutralTrade.fetchVaultsFromRegistry(config.registryUrl);
|
|
9804
7522
|
vaults$1 = {
|
|
9805
|
-
...vaults,
|
|
7523
|
+
...vaults$1,
|
|
9806
7524
|
...remoteVaults
|
|
9807
7525
|
};
|
|
9808
7526
|
}
|
|
7527
|
+
const programIds = /* @__PURE__ */ new Set();
|
|
7528
|
+
for (const vault of Object.values(vaults$1)) {
|
|
7529
|
+
const programId = getBundleProgramId(vault, cluster);
|
|
7530
|
+
if (programId) programIds.add(programId);
|
|
7531
|
+
}
|
|
7532
|
+
const bundlePrograms = {};
|
|
7533
|
+
for (const programId of programIds) bundlePrograms[programId] = createBundleProgramById(provider, programId);
|
|
9809
7534
|
const priceMap = await initializePrices(config.fallbackPrices);
|
|
9810
7535
|
return {
|
|
9811
7536
|
connection,
|
|
9812
|
-
|
|
9813
|
-
bundleProgramV2,
|
|
7537
|
+
bundlePrograms,
|
|
9814
7538
|
vaults: vaults$1,
|
|
9815
7539
|
priceMap
|
|
9816
7540
|
};
|
|
9817
7541
|
}
|
|
9818
7542
|
static async create(config) {
|
|
9819
7543
|
const core = await this.initCore(config);
|
|
9820
|
-
return new NeutralTrade(core.connection, core.
|
|
7544
|
+
return new NeutralTrade(core.connection, core.bundlePrograms, config.bundleCluster ?? "mainnet", core.vaults, core.priceMap);
|
|
7545
|
+
}
|
|
7546
|
+
getBundleProgramForVault(vault) {
|
|
7547
|
+
const programId = getBundleProgramId(vault, this.bundleCluster);
|
|
7548
|
+
if (!programId) throw new Error(`Vault ${vault.vaultId} has no Bundle program id`);
|
|
7549
|
+
const bundleProgram = this.bundlePrograms[programId];
|
|
7550
|
+
if (!bundleProgram) throw new Error(`Bundle program client not initialized for vault ${vault.vaultId}: ${programId}. Please add it to bundlePrograms config or registry.`);
|
|
7551
|
+
return bundleProgram;
|
|
7552
|
+
}
|
|
7553
|
+
static parseVaultRegistryEntries(entries, sourceLabel) {
|
|
7554
|
+
const parseResult = VaultRegistryArraySchema.safeParse(entries);
|
|
7555
|
+
if (!parseResult.success) throw new Error(`Invalid ${sourceLabel} data: ${parseResult.error.message}`);
|
|
7556
|
+
return toVaultRegistry(parseResult.data);
|
|
9821
7557
|
}
|
|
9822
7558
|
/**
|
|
9823
7559
|
* Fetch vault configurations from a remote registry URL
|
|
@@ -9828,9 +7564,7 @@ var NeutralTrade = class NeutralTrade {
|
|
|
9828
7564
|
const response = await fetch(registryUrl);
|
|
9829
7565
|
if (!response.ok) throw new Error(`Failed to fetch vaults from registry: ${response.status} ${response.statusText}`);
|
|
9830
7566
|
const data = await response.json();
|
|
9831
|
-
|
|
9832
|
-
if (!parseResult.success) throw new Error(`Invalid vault registry data: ${parseResult.error.message}`);
|
|
9833
|
-
return toVaultRegistry(parseResult.data);
|
|
7567
|
+
return NeutralTrade.parseVaultRegistryEntries(data, "vault registry");
|
|
9834
7568
|
}
|
|
9835
7569
|
/**
|
|
9836
7570
|
* Get user balance for Bundle vaults only.
|
|
@@ -9846,8 +7580,8 @@ var NeutralTrade = class NeutralTrade {
|
|
|
9846
7580
|
vaultIds: bundleVaultIds,
|
|
9847
7581
|
userAddress,
|
|
9848
7582
|
vaults: this.vaults,
|
|
9849
|
-
|
|
9850
|
-
|
|
7583
|
+
bundlePrograms: this.bundlePrograms,
|
|
7584
|
+
bundleCluster: this.bundleCluster,
|
|
9851
7585
|
priceMap: this.priceMap
|
|
9852
7586
|
});
|
|
9853
7587
|
}
|
|
@@ -9858,8 +7592,8 @@ var NeutralTrade = class NeutralTrade {
|
|
|
9858
7592
|
const vault = this.vaults[vaultId];
|
|
9859
7593
|
if (!vault) throw new Error(`Vault config not found for vaultId ${vaultId}`);
|
|
9860
7594
|
return buildBundleDepositInstructions({
|
|
9861
|
-
|
|
9862
|
-
|
|
7595
|
+
bundleProgram: this.getBundleProgramForVault(vault),
|
|
7596
|
+
bundleCluster: this.bundleCluster,
|
|
9863
7597
|
vault,
|
|
9864
7598
|
user: new PublicKey(userAddress),
|
|
9865
7599
|
amount,
|
|
@@ -9873,8 +7607,8 @@ var NeutralTrade = class NeutralTrade {
|
|
|
9873
7607
|
const vault = this.vaults[vaultId];
|
|
9874
7608
|
if (!vault) throw new Error(`Vault config not found for vaultId ${vaultId}`);
|
|
9875
7609
|
return buildBundleRequestWithdrawInstruction({
|
|
9876
|
-
|
|
9877
|
-
|
|
7610
|
+
bundleProgram: this.getBundleProgramForVault(vault),
|
|
7611
|
+
bundleCluster: this.bundleCluster,
|
|
9878
7612
|
vault,
|
|
9879
7613
|
user: new PublicKey(userAddress),
|
|
9880
7614
|
amount
|
|
@@ -9883,4 +7617,4 @@ var NeutralTrade = class NeutralTrade {
|
|
|
9883
7617
|
};
|
|
9884
7618
|
|
|
9885
7619
|
//#endregion
|
|
9886
|
-
export {
|
|
7620
|
+
export { DEFAULT_BUNDLE_PROGRAM_ID_DEVNET, DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, NeutralTrade, SupportedChain, SupportedToken, VaultCategory, VaultId, VaultType, buildBundleDepositInstructions, buildBundleRequestWithdrawInstruction, createDummyWallet, deriveOraclePDA, deriveUserPDA, getBundleProgramId, getDefaultBundleProgramIdByCluster, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, isValidVaultAddress, tokens, vaults };
|