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