@meteora-ag/zap-sdk 1.3.1 → 2.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _solana_web3_js from '@solana/web3.js';
2
- import { PublicKey, TransactionInstruction, Transaction, AccountMeta, Connection } from '@solana/web3.js';
3
- import { Program, IdlTypes } from '@coral-xyz/anchor';
2
+ import { PublicKey, TransactionInstruction, AddressLookupTableAccount, AccountMeta, Connection } from '@solana/web3.js';
3
+ import { Program, IdlTypes } from '@anchor-lang/core';
4
4
  import BN from 'bn.js';
5
5
  import Decimal from 'decimal.js';
6
6
  import { StrategyType, SwapQuote, LbPair, BinArrayBitmapExtension, RemainingAccountInfo } from '@meteora-ag/dlmm';
@@ -13,762 +13,889 @@ import { PoolState } from '@meteora-ag/cp-amm-sdk';
13
13
  * IDL can be found at `target/idl/zap.json`.
14
14
  */
15
15
  type Zap$1 = {
16
- address: "zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz";
17
- metadata: {
18
- name: "zap";
19
- version: "0.2.2";
20
- spec: "0.1.0";
21
- description: "Created with Anchor";
16
+ "address": "zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz";
17
+ "metadata": {
18
+ "name": "zap";
19
+ "version": "0.2.3";
20
+ "spec": "0.1.0";
21
+ "description": "Created with Anchor";
22
22
  };
23
- instructions: [
23
+ "instructions": [
24
24
  {
25
- name: "closeLedgerAccount";
26
- discriminator: [189, 122, 172, 13, 122, 54, 54, 51];
27
- accounts: [
25
+ "name": "closeLedgerAccount";
26
+ "discriminator": [
27
+ 189,
28
+ 122,
29
+ 172,
30
+ 13,
31
+ 122,
32
+ 54,
33
+ 54,
34
+ 51
35
+ ];
36
+ "accounts": [
28
37
  {
29
- name: "ledger";
30
- writable: true;
38
+ "name": "ledger";
39
+ "writable": true;
31
40
  },
32
41
  {
33
- name: "owner";
34
- signer: true;
35
- relations: ["ledger"];
42
+ "name": "owner";
43
+ "signer": true;
44
+ "relations": [
45
+ "ledger"
46
+ ];
36
47
  },
37
48
  {
38
- name: "rentReceiver";
39
- writable: true;
40
- signer: true;
49
+ "name": "rentReceiver";
50
+ "writable": true;
51
+ "signer": true;
41
52
  }
42
53
  ];
43
- args: [];
54
+ "args": [];
44
55
  },
45
56
  {
46
- name: "initializeLedgerAccount";
47
- discriminator: [120, 69, 30, 74, 76, 242, 153, 162];
48
- accounts: [
57
+ "name": "initializeLedgerAccount";
58
+ "discriminator": [
59
+ 120,
60
+ 69,
61
+ 30,
62
+ 74,
63
+ 76,
64
+ 242,
65
+ 153,
66
+ 162
67
+ ];
68
+ "accounts": [
49
69
  {
50
- name: "ledger";
51
- writable: true;
52
- pda: {
53
- seeds: [
70
+ "name": "ledger";
71
+ "writable": true;
72
+ "pda": {
73
+ "seeds": [
54
74
  {
55
- kind: "const";
56
- value: [117, 115, 101, 114, 95, 108, 101, 100, 103, 101, 114];
75
+ "kind": "const";
76
+ "value": [
77
+ 117,
78
+ 115,
79
+ 101,
80
+ 114,
81
+ 95,
82
+ 108,
83
+ 101,
84
+ 100,
85
+ 103,
86
+ 101,
87
+ 114
88
+ ];
57
89
  },
58
90
  {
59
- kind: "account";
60
- path: "owner";
91
+ "kind": "account";
92
+ "path": "owner";
61
93
  }
62
94
  ];
63
95
  };
64
96
  },
65
97
  {
66
- name: "owner";
67
- signer: true;
98
+ "name": "owner";
99
+ "signer": true;
68
100
  },
69
101
  {
70
- name: "payer";
71
- writable: true;
72
- signer: true;
102
+ "name": "payer";
103
+ "writable": true;
104
+ "signer": true;
73
105
  },
74
106
  {
75
- name: "systemProgram";
76
- address: "11111111111111111111111111111111";
107
+ "name": "systemProgram";
108
+ "address": "11111111111111111111111111111111";
77
109
  }
78
110
  ];
79
- args: [];
111
+ "args": [];
80
112
  },
81
113
  {
82
- name: "setLedgerBalance";
83
- discriminator: [131, 49, 240, 17, 228, 248, 156, 54];
84
- accounts: [
114
+ "name": "setLedgerBalance";
115
+ "discriminator": [
116
+ 131,
117
+ 49,
118
+ 240,
119
+ 17,
120
+ 228,
121
+ 248,
122
+ 156,
123
+ 54
124
+ ];
125
+ "accounts": [
85
126
  {
86
- name: "ledger";
87
- writable: true;
127
+ "name": "ledger";
128
+ "writable": true;
88
129
  },
89
130
  {
90
- name: "owner";
91
- signer: true;
92
- relations: ["ledger"];
131
+ "name": "owner";
132
+ "signer": true;
133
+ "relations": [
134
+ "ledger"
135
+ ];
93
136
  }
94
137
  ];
95
- args: [
138
+ "args": [
96
139
  {
97
- name: "amount";
98
- type: "u64";
140
+ "name": "amount";
141
+ "type": "u64";
99
142
  },
100
143
  {
101
- name: "isTokenA";
102
- type: "bool";
144
+ "name": "isTokenA";
145
+ "type": "bool";
103
146
  }
104
147
  ];
105
148
  },
106
149
  {
107
- name: "updateLedgerBalanceAfterSwap";
108
- discriminator: [59, 206, 173, 232, 94, 57, 174, 202];
109
- accounts: [
150
+ "name": "updateLedgerBalanceAfterSwap";
151
+ "discriminator": [
152
+ 59,
153
+ 206,
154
+ 173,
155
+ 232,
156
+ 94,
157
+ 57,
158
+ 174,
159
+ 202
160
+ ];
161
+ "accounts": [
110
162
  {
111
- name: "ledger";
112
- writable: true;
163
+ "name": "ledger";
164
+ "writable": true;
113
165
  },
114
166
  {
115
- name: "tokenAccount";
167
+ "name": "tokenAccount";
116
168
  },
117
169
  {
118
- name: "owner";
119
- signer: true;
120
- relations: ["ledger"];
170
+ "name": "owner";
171
+ "signer": true;
172
+ "relations": [
173
+ "ledger"
174
+ ];
121
175
  }
122
176
  ];
123
- args: [
177
+ "args": [
124
178
  {
125
- name: "preSourceTokenBalance";
126
- type: "u64";
179
+ "name": "preSourceTokenBalance";
180
+ "type": "u64";
127
181
  },
128
182
  {
129
- name: "maxTransferAmount";
130
- type: "u64";
183
+ "name": "maxTransferAmount";
184
+ "type": "u64";
131
185
  },
132
186
  {
133
- name: "isTokenA";
134
- type: "bool";
187
+ "name": "isTokenA";
188
+ "type": "bool";
135
189
  }
136
190
  ];
137
191
  },
138
192
  {
139
- name: "zapInDammV2";
140
- discriminator: [243, 243, 119, 52, 199, 44, 154, 186];
141
- accounts: [
193
+ "name": "zapInDammV2";
194
+ "discriminator": [
195
+ 243,
196
+ 243,
197
+ 119,
198
+ 52,
199
+ 199,
200
+ 44,
201
+ 154,
202
+ 186
203
+ ];
204
+ "accounts": [
142
205
  {
143
- name: "ledger";
144
- writable: true;
206
+ "name": "ledger";
207
+ "writable": true;
145
208
  },
146
209
  {
147
- name: "pool";
148
- writable: true;
210
+ "name": "pool";
211
+ "writable": true;
149
212
  },
150
213
  {
151
- name: "poolAuthority";
214
+ "name": "poolAuthority";
152
215
  },
153
216
  {
154
- name: "position";
155
- writable: true;
217
+ "name": "position";
218
+ "writable": true;
156
219
  },
157
220
  {
158
- name: "tokenAAccount";
159
- writable: true;
221
+ "name": "tokenAAccount";
222
+ "writable": true;
160
223
  },
161
224
  {
162
- name: "tokenBAccount";
163
- writable: true;
225
+ "name": "tokenBAccount";
226
+ "writable": true;
164
227
  },
165
228
  {
166
- name: "tokenAVault";
167
- writable: true;
229
+ "name": "tokenAVault";
230
+ "writable": true;
168
231
  },
169
232
  {
170
- name: "tokenBVault";
171
- writable: true;
233
+ "name": "tokenBVault";
234
+ "writable": true;
172
235
  },
173
236
  {
174
- name: "tokenAMint";
237
+ "name": "tokenAMint";
175
238
  },
176
239
  {
177
- name: "tokenBMint";
240
+ "name": "tokenBMint";
178
241
  },
179
242
  {
180
- name: "positionNftAccount";
243
+ "name": "positionNftAccount";
181
244
  },
182
245
  {
183
- name: "owner";
184
- docs: ["owner of position"];
185
- signer: true;
186
- relations: ["ledger"];
246
+ "name": "owner";
247
+ "docs": [
248
+ "owner of position"
249
+ ];
250
+ "signer": true;
251
+ "relations": [
252
+ "ledger"
253
+ ];
187
254
  },
188
255
  {
189
- name: "tokenAProgram";
256
+ "name": "tokenAProgram";
190
257
  },
191
258
  {
192
- name: "tokenBProgram";
259
+ "name": "tokenBProgram";
193
260
  },
194
261
  {
195
- name: "dammProgram";
196
- address: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
262
+ "name": "dammProgram";
263
+ "address": "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
197
264
  },
198
265
  {
199
- name: "dammEventAuthority";
266
+ "name": "dammEventAuthority";
200
267
  }
201
268
  ];
202
- args: [
269
+ "args": [
203
270
  {
204
- name: "preSqrtPrice";
205
- type: "u128";
271
+ "name": "preSqrtPrice";
272
+ "type": "u128";
206
273
  },
207
274
  {
208
- name: "maxSqrtPriceChangeBps";
209
- type: "u32";
275
+ "name": "maxSqrtPriceChangeBps";
276
+ "type": "u32";
210
277
  }
211
278
  ];
212
279
  },
213
280
  {
214
- name: "zapInDlmmForInitializedPosition";
215
- discriminator: [184, 71, 198, 231, 129, 110, 193, 67];
216
- accounts: [
281
+ "name": "zapInDlmmForInitializedPosition";
282
+ "discriminator": [
283
+ 184,
284
+ 71,
285
+ 198,
286
+ 231,
287
+ 129,
288
+ 110,
289
+ 193,
290
+ 67
291
+ ];
292
+ "accounts": [
217
293
  {
218
- name: "ledger";
219
- writable: true;
294
+ "name": "ledger";
295
+ "writable": true;
220
296
  },
221
297
  {
222
- name: "lbPair";
223
- docs: ["lb pair"];
224
- writable: true;
298
+ "name": "lbPair";
299
+ "docs": [
300
+ "lb pair"
301
+ ];
302
+ "writable": true;
225
303
  },
226
304
  {
227
- name: "position";
228
- writable: true;
305
+ "name": "position";
306
+ "writable": true;
229
307
  },
230
308
  {
231
- name: "binArrayBitmapExtension";
232
- writable: true;
233
- optional: true;
309
+ "name": "binArrayBitmapExtension";
310
+ "writable": true;
311
+ "optional": true;
234
312
  },
235
313
  {
236
- name: "userTokenX";
237
- writable: true;
314
+ "name": "userTokenX";
315
+ "writable": true;
238
316
  },
239
317
  {
240
- name: "userTokenY";
241
- writable: true;
318
+ "name": "userTokenY";
319
+ "writable": true;
242
320
  },
243
321
  {
244
- name: "reserveX";
245
- writable: true;
322
+ "name": "reserveX";
323
+ "writable": true;
246
324
  },
247
325
  {
248
- name: "reserveY";
249
- writable: true;
326
+ "name": "reserveY";
327
+ "writable": true;
250
328
  },
251
329
  {
252
- name: "tokenXMint";
330
+ "name": "tokenXMint";
253
331
  },
254
332
  {
255
- name: "tokenYMint";
333
+ "name": "tokenYMint";
256
334
  },
257
335
  {
258
- name: "dlmmProgram";
259
- address: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
336
+ "name": "dlmmProgram";
337
+ "address": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
260
338
  },
261
339
  {
262
- name: "owner";
263
- docs: ["owner of position"];
264
- signer: true;
265
- relations: ["ledger"];
340
+ "name": "owner";
341
+ "docs": [
342
+ "owner of position"
343
+ ];
344
+ "signer": true;
345
+ "relations": [
346
+ "ledger"
347
+ ];
266
348
  },
267
349
  {
268
- name: "rentPayer";
269
- writable: true;
270
- signer: true;
350
+ "name": "rentPayer";
351
+ "writable": true;
352
+ "signer": true;
271
353
  },
272
354
  {
273
- name: "tokenXProgram";
355
+ "name": "tokenXProgram";
274
356
  },
275
357
  {
276
- name: "tokenYProgram";
358
+ "name": "tokenYProgram";
277
359
  },
278
360
  {
279
- name: "memoProgram";
361
+ "name": "memoProgram";
280
362
  },
281
363
  {
282
- name: "systemProgram";
364
+ "name": "systemProgram";
283
365
  },
284
366
  {
285
- name: "dlmmEventAuthority";
367
+ "name": "dlmmEventAuthority";
286
368
  }
287
369
  ];
288
- args: [
370
+ "args": [
289
371
  {
290
- name: "activeId";
291
- type: "i32";
372
+ "name": "activeId";
373
+ "type": "i32";
292
374
  },
293
375
  {
294
- name: "minDeltaId";
295
- type: "i32";
376
+ "name": "minDeltaId";
377
+ "type": "i32";
296
378
  },
297
379
  {
298
- name: "maxDeltaId";
299
- type: "i32";
380
+ "name": "maxDeltaId";
381
+ "type": "i32";
300
382
  },
301
383
  {
302
- name: "maxActiveBinSlippage";
303
- type: "u16";
384
+ "name": "maxActiveBinSlippage";
385
+ "type": "u16";
304
386
  },
305
387
  {
306
- name: "favorXInActiveId";
307
- type: "bool";
388
+ "name": "favorXInActiveId";
389
+ "type": "bool";
308
390
  },
309
391
  {
310
- name: "strategy";
311
- type: {
312
- defined: {
313
- name: "strategyType";
392
+ "name": "strategy";
393
+ "type": {
394
+ "defined": {
395
+ "name": "strategyType";
314
396
  };
315
397
  };
316
398
  },
317
399
  {
318
- name: "remainingAccountsInfo";
319
- type: {
320
- defined: {
321
- name: "remainingAccountsInfo";
400
+ "name": "remainingAccountsInfo";
401
+ "type": {
402
+ "defined": {
403
+ "name": "remainingAccountsInfo";
322
404
  };
323
405
  };
324
406
  }
325
407
  ];
326
408
  },
327
409
  {
328
- name: "zapInDlmmForUninitializedPosition";
329
- discriminator: [59, 220, 182, 27, 254, 253, 2, 232];
330
- accounts: [
410
+ "name": "zapInDlmmForUninitializedPosition";
411
+ "discriminator": [
412
+ 59,
413
+ 220,
414
+ 182,
415
+ 27,
416
+ 254,
417
+ 253,
418
+ 2,
419
+ 232
420
+ ];
421
+ "accounts": [
331
422
  {
332
- name: "ledger";
333
- writable: true;
423
+ "name": "ledger";
424
+ "writable": true;
334
425
  },
335
426
  {
336
- name: "lbPair";
337
- docs: ["lb pair"];
338
- writable: true;
427
+ "name": "lbPair";
428
+ "docs": [
429
+ "lb pair"
430
+ ];
431
+ "writable": true;
339
432
  },
340
433
  {
341
- name: "position";
342
- docs: [
434
+ "name": "position";
435
+ "docs": [
343
436
  "user position",
344
437
  "Check it is different from owner to avoid user to pass owner address wrongly"
345
438
  ];
346
- writable: true;
347
- signer: true;
439
+ "writable": true;
440
+ "signer": true;
348
441
  },
349
442
  {
350
- name: "binArrayBitmapExtension";
351
- writable: true;
352
- optional: true;
443
+ "name": "binArrayBitmapExtension";
444
+ "writable": true;
445
+ "optional": true;
353
446
  },
354
447
  {
355
- name: "userTokenX";
356
- writable: true;
448
+ "name": "userTokenX";
449
+ "writable": true;
357
450
  },
358
451
  {
359
- name: "userTokenY";
360
- writable: true;
452
+ "name": "userTokenY";
453
+ "writable": true;
361
454
  },
362
455
  {
363
- name: "reserveX";
364
- writable: true;
456
+ "name": "reserveX";
457
+ "writable": true;
365
458
  },
366
459
  {
367
- name: "reserveY";
368
- writable: true;
460
+ "name": "reserveY";
461
+ "writable": true;
369
462
  },
370
463
  {
371
- name: "tokenXMint";
464
+ "name": "tokenXMint";
372
465
  },
373
466
  {
374
- name: "tokenYMint";
467
+ "name": "tokenYMint";
375
468
  },
376
469
  {
377
- name: "dlmmProgram";
378
- address: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
470
+ "name": "dlmmProgram";
471
+ "address": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
379
472
  },
380
473
  {
381
- name: "owner";
382
- docs: ["owner of position"];
383
- signer: true;
384
- relations: ["ledger"];
474
+ "name": "owner";
475
+ "docs": [
476
+ "owner of position"
477
+ ];
478
+ "signer": true;
479
+ "relations": [
480
+ "ledger"
481
+ ];
385
482
  },
386
483
  {
387
- name: "rentPayer";
388
- writable: true;
389
- signer: true;
484
+ "name": "rentPayer";
485
+ "writable": true;
486
+ "signer": true;
390
487
  },
391
488
  {
392
- name: "tokenXProgram";
489
+ "name": "tokenXProgram";
393
490
  },
394
491
  {
395
- name: "tokenYProgram";
492
+ "name": "tokenYProgram";
396
493
  },
397
494
  {
398
- name: "memoProgram";
495
+ "name": "memoProgram";
399
496
  },
400
497
  {
401
- name: "systemProgram";
498
+ "name": "systemProgram";
402
499
  },
403
500
  {
404
- name: "dlmmEventAuthority";
501
+ "name": "dlmmEventAuthority";
405
502
  }
406
503
  ];
407
- args: [
504
+ "args": [
408
505
  {
409
- name: "minDeltaId";
410
- type: "i32";
506
+ "name": "minDeltaId";
507
+ "type": "i32";
411
508
  },
412
509
  {
413
- name: "maxDeltaId";
414
- type: "i32";
510
+ "name": "maxDeltaId";
511
+ "type": "i32";
415
512
  },
416
513
  {
417
- name: "activeId";
418
- type: "i32";
514
+ "name": "activeId";
515
+ "type": "i32";
419
516
  },
420
517
  {
421
- name: "maxActiveBinSlippage";
422
- type: "u16";
518
+ "name": "maxActiveBinSlippage";
519
+ "type": "u16";
423
520
  },
424
521
  {
425
- name: "favorXInActiveId";
426
- type: "bool";
522
+ "name": "favorXInActiveId";
523
+ "type": "bool";
427
524
  },
428
525
  {
429
- name: "strategy";
430
- type: {
431
- defined: {
432
- name: "strategyType";
526
+ "name": "strategy";
527
+ "type": {
528
+ "defined": {
529
+ "name": "strategyType";
433
530
  };
434
531
  };
435
532
  },
436
533
  {
437
- name: "remainingAccountsInfo";
438
- type: {
439
- defined: {
440
- name: "remainingAccountsInfo";
534
+ "name": "remainingAccountsInfo";
535
+ "type": {
536
+ "defined": {
537
+ "name": "remainingAccountsInfo";
441
538
  };
442
539
  };
443
540
  }
444
541
  ];
445
542
  },
446
543
  {
447
- name: "zapOut";
448
- discriminator: [155, 108, 185, 112, 104, 210, 161, 64];
449
- accounts: [
544
+ "name": "zapOut";
545
+ "discriminator": [
546
+ 155,
547
+ 108,
548
+ 185,
549
+ 112,
550
+ 104,
551
+ 210,
552
+ 161,
553
+ 64
554
+ ];
555
+ "accounts": [
450
556
  {
451
- name: "userTokenInAccount";
452
- writable: true;
557
+ "name": "userTokenInAccount";
558
+ "writable": true;
453
559
  },
454
560
  {
455
- name: "ammProgram";
561
+ "name": "ammProgram";
456
562
  }
457
563
  ];
458
- args: [
564
+ "args": [
459
565
  {
460
- name: "params";
461
- type: {
462
- defined: {
463
- name: "zapOutParameters";
566
+ "name": "params";
567
+ "type": {
568
+ "defined": {
569
+ "name": "zapOutParameters";
464
570
  };
465
571
  };
466
572
  }
467
573
  ];
468
574
  }
469
575
  ];
470
- accounts: [
471
- {
472
- name: "lbPair";
473
- discriminator: [33, 11, 49, 98, 181, 101, 177, 13];
474
- },
576
+ "accounts": [
475
577
  {
476
- name: "pool";
477
- discriminator: [241, 154, 109, 4, 17, 177, 109, 188];
478
- },
479
- {
480
- name: "userLedger";
481
- discriminator: [185, 84, 101, 128, 8, 6, 160, 83];
578
+ "name": "userLedger";
579
+ "discriminator": [
580
+ 185,
581
+ 84,
582
+ 101,
583
+ 128,
584
+ 8,
585
+ 6,
586
+ 160,
587
+ 83
588
+ ];
482
589
  }
483
590
  ];
484
- errors: [
591
+ "errors": [
485
592
  {
486
- code: 6000;
487
- name: "mathOverflow";
488
- msg: "Math operation overflow";
593
+ "code": 6000;
594
+ "name": "mathOverflow";
595
+ "msg": "Math operation overflow";
489
596
  },
490
597
  {
491
- code: 6001;
492
- name: "invalidOffset";
493
- msg: "Invalid offset";
598
+ "code": 6001;
599
+ "name": "invalidOffset";
600
+ "msg": "Invalid offset";
494
601
  },
495
602
  {
496
- code: 6002;
497
- name: "invalidZapOutParameters";
498
- msg: "Invalid zapout parameters";
603
+ "code": 6002;
604
+ "name": "invalidZapOutParameters";
605
+ "msg": "Invalid zapout parameters";
499
606
  },
500
607
  {
501
- code: 6003;
502
- name: "typeCastFailed";
503
- msg: "Type cast error";
608
+ "code": 6003;
609
+ "name": "typeCastFailed";
610
+ "msg": "Type cast error";
504
611
  },
505
612
  {
506
- code: 6004;
507
- name: "ammIsNotSupported";
508
- msg: "Amm program is not supported";
613
+ "code": 6004;
614
+ "name": "ammIsNotSupported";
615
+ "msg": "Amm program is not supported";
509
616
  },
510
617
  {
511
- code: 6005;
512
- name: "invalidPosition";
513
- msg: "Position is not empty";
618
+ "code": 6005;
619
+ "name": "invalidPosition";
620
+ "msg": "Position is not empty";
514
621
  },
515
622
  {
516
- code: 6006;
517
- name: "exceededSlippage";
518
- msg: "Exceeded slippage tolerance";
623
+ "code": 6006;
624
+ "name": "exceededSlippage";
625
+ "msg": "Exceeded slippage tolerance";
519
626
  },
520
627
  {
521
- code: 6007;
522
- name: "invalidDlmmZapInParameters";
523
- msg: "Invalid dlmm zap in parameters";
628
+ "code": 6007;
629
+ "name": "invalidDlmmZapInParameters";
630
+ "msg": "Invalid dlmm zap in parameters";
524
631
  },
525
632
  {
526
- code: 6008;
527
- name: "unsupportedFeeMode";
528
- msg: "Unsupported fee mode";
633
+ "code": 6008;
634
+ "name": "unsupportedFeeMode";
635
+ "msg": "Unsupported fee mode";
529
636
  }
530
637
  ];
531
- types: [
638
+ "types": [
532
639
  {
533
- name: "accountsType";
534
- type: {
535
- kind: "enum";
536
- variants: [
640
+ "name": "accountsType";
641
+ "type": {
642
+ "kind": "enum";
643
+ "variants": [
537
644
  {
538
- name: "transferHookX";
645
+ "name": "transferHookX";
539
646
  },
540
647
  {
541
- name: "transferHookY";
648
+ "name": "transferHookY";
542
649
  },
543
650
  {
544
- name: "transferHookReward";
651
+ "name": "transferHookReward";
545
652
  },
546
653
  {
547
- name: "transferHookMultiReward";
548
- fields: ["u8"];
654
+ "name": "transferHookMultiReward";
655
+ "fields": [
656
+ "u8"
657
+ ];
549
658
  },
550
659
  {
551
- name: "transferHookReferral";
660
+ "name": "transferHookReferral";
552
661
  }
553
662
  ];
554
663
  };
555
664
  },
556
665
  {
557
- name: "baseFeeInfo";
558
- serialization: "bytemuck";
559
- repr: {
560
- kind: "c";
666
+ "name": "baseFeeInfo";
667
+ "serialization": "bytemuck";
668
+ "repr": {
669
+ "kind": "c";
561
670
  };
562
- type: {
563
- kind: "struct";
564
- fields: [
565
- {
566
- name: "data";
567
- type: {
568
- array: ["u8", 32];
671
+ "type": {
672
+ "kind": "struct";
673
+ "fields": [
674
+ {
675
+ "name": "data";
676
+ "type": {
677
+ "array": [
678
+ "u8",
679
+ 32
680
+ ];
569
681
  };
570
682
  }
571
683
  ];
572
684
  };
573
685
  },
574
686
  {
575
- name: "baseFeeStruct";
576
- serialization: "bytemuck";
577
- repr: {
578
- kind: "c";
687
+ "name": "baseFeeStruct";
688
+ "serialization": "bytemuck";
689
+ "repr": {
690
+ "kind": "c";
579
691
  };
580
- type: {
581
- kind: "struct";
582
- fields: [
583
- {
584
- name: "baseFeeInfo";
585
- type: {
586
- defined: {
587
- name: "baseFeeInfo";
692
+ "type": {
693
+ "kind": "struct";
694
+ "fields": [
695
+ {
696
+ "name": "baseFeeInfo";
697
+ "type": {
698
+ "defined": {
699
+ "name": "baseFeeInfo";
588
700
  };
589
701
  };
590
702
  },
591
703
  {
592
- name: "padding1";
593
- type: "u64";
704
+ "name": "padding1";
705
+ "type": "u64";
594
706
  }
595
707
  ];
596
708
  };
597
709
  },
598
710
  {
599
- name: "dynamicFeeStruct";
600
- serialization: "bytemuck";
601
- repr: {
602
- kind: "c";
711
+ "name": "dynamicFeeStruct";
712
+ "serialization": "bytemuck";
713
+ "repr": {
714
+ "kind": "c";
603
715
  };
604
- type: {
605
- kind: "struct";
606
- fields: [
716
+ "type": {
717
+ "kind": "struct";
718
+ "fields": [
607
719
  {
608
- name: "initialized";
609
- type: "u8";
720
+ "name": "initialized";
721
+ "type": "u8";
610
722
  },
611
723
  {
612
- name: "padding";
613
- type: {
614
- array: ["u8", 7];
724
+ "name": "padding";
725
+ "type": {
726
+ "array": [
727
+ "u8",
728
+ 7
729
+ ];
615
730
  };
616
731
  },
617
732
  {
618
- name: "maxVolatilityAccumulator";
619
- type: "u32";
733
+ "name": "maxVolatilityAccumulator";
734
+ "type": "u32";
620
735
  },
621
736
  {
622
- name: "variableFeeControl";
623
- type: "u32";
737
+ "name": "variableFeeControl";
738
+ "type": "u32";
624
739
  },
625
740
  {
626
- name: "binStep";
627
- type: "u16";
741
+ "name": "binStep";
742
+ "type": "u16";
628
743
  },
629
744
  {
630
- name: "filterPeriod";
631
- type: "u16";
745
+ "name": "filterPeriod";
746
+ "type": "u16";
632
747
  },
633
748
  {
634
- name: "decayPeriod";
635
- type: "u16";
749
+ "name": "decayPeriod";
750
+ "type": "u16";
636
751
  },
637
752
  {
638
- name: "reductionFactor";
639
- type: "u16";
753
+ "name": "reductionFactor";
754
+ "type": "u16";
640
755
  },
641
756
  {
642
- name: "lastUpdateTimestamp";
643
- type: "u64";
757
+ "name": "lastUpdateTimestamp";
758
+ "type": "u64";
644
759
  },
645
760
  {
646
- name: "binStepU128";
647
- type: "u128";
761
+ "name": "binStepU128";
762
+ "type": "u128";
648
763
  },
649
764
  {
650
- name: "sqrtPriceReference";
651
- type: "u128";
765
+ "name": "sqrtPriceReference";
766
+ "type": "u128";
652
767
  },
653
768
  {
654
- name: "volatilityAccumulator";
655
- type: "u128";
769
+ "name": "volatilityAccumulator";
770
+ "type": "u128";
656
771
  },
657
772
  {
658
- name: "volatilityReference";
659
- type: "u128";
773
+ "name": "volatilityReference";
774
+ "type": "u128";
660
775
  }
661
776
  ];
662
777
  };
663
778
  },
664
779
  {
665
- name: "lbPair";
666
- serialization: "bytemuck";
667
- repr: {
668
- kind: "c";
780
+ "name": "lbPair";
781
+ "serialization": "bytemuck";
782
+ "repr": {
783
+ "kind": "c";
669
784
  };
670
- type: {
671
- kind: "struct";
672
- fields: [
673
- {
674
- name: "parameters";
675
- type: {
676
- defined: {
677
- name: "staticParameters";
785
+ "type": {
786
+ "kind": "struct";
787
+ "fields": [
788
+ {
789
+ "name": "parameters";
790
+ "type": {
791
+ "defined": {
792
+ "name": "staticParameters";
678
793
  };
679
794
  };
680
795
  },
681
796
  {
682
- name: "vParameters";
683
- type: {
684
- defined: {
685
- name: "variableParameters";
797
+ "name": "vParameters";
798
+ "type": {
799
+ "defined": {
800
+ "name": "variableParameters";
686
801
  };
687
802
  };
688
803
  },
689
804
  {
690
- name: "bumpSeed";
691
- type: {
692
- array: ["u8", 1];
805
+ "name": "bumpSeed";
806
+ "type": {
807
+ "array": [
808
+ "u8",
809
+ 1
810
+ ];
693
811
  };
694
812
  },
695
813
  {
696
- name: "binStepSeed";
697
- type: {
698
- array: ["u8", 2];
814
+ "name": "binStepSeed";
815
+ "type": {
816
+ "array": [
817
+ "u8",
818
+ 2
819
+ ];
699
820
  };
700
821
  },
701
822
  {
702
- name: "pairType";
703
- type: "u8";
823
+ "name": "pairType";
824
+ "type": "u8";
704
825
  },
705
826
  {
706
- name: "activeId";
707
- type: "i32";
827
+ "name": "activeId";
828
+ "type": "i32";
708
829
  },
709
830
  {
710
- name: "binStep";
711
- type: "u16";
831
+ "name": "binStep";
832
+ "type": "u16";
712
833
  },
713
834
  {
714
- name: "status";
715
- type: "u8";
835
+ "name": "status";
836
+ "type": "u8";
716
837
  },
717
838
  {
718
- name: "requireBaseFactorSeed";
719
- type: "u8";
839
+ "name": "requireBaseFactorSeed";
840
+ "type": "u8";
720
841
  },
721
842
  {
722
- name: "baseFactorSeed";
723
- type: {
724
- array: ["u8", 2];
843
+ "name": "baseFactorSeed";
844
+ "type": {
845
+ "array": [
846
+ "u8",
847
+ 2
848
+ ];
725
849
  };
726
850
  },
727
851
  {
728
- name: "activationType";
729
- type: "u8";
852
+ "name": "activationType";
853
+ "type": "u8";
730
854
  },
731
855
  {
732
- name: "creatorPoolOnOffControl";
733
- type: "u8";
856
+ "name": "creatorPoolOnOffControl";
857
+ "type": "u8";
734
858
  },
735
859
  {
736
- name: "tokenXMint";
737
- type: "pubkey";
860
+ "name": "tokenXMint";
861
+ "type": "pubkey";
738
862
  },
739
863
  {
740
- name: "tokenYMint";
741
- type: "pubkey";
864
+ "name": "tokenYMint";
865
+ "type": "pubkey";
742
866
  },
743
867
  {
744
- name: "reserveX";
745
- type: "pubkey";
868
+ "name": "reserveX";
869
+ "type": "pubkey";
746
870
  },
747
871
  {
748
- name: "reserveY";
749
- type: "pubkey";
872
+ "name": "reserveY";
873
+ "type": "pubkey";
750
874
  },
751
875
  {
752
- name: "protocolFee";
753
- type: {
754
- defined: {
755
- name: "protocolFee";
876
+ "name": "protocolFee";
877
+ "type": {
878
+ "defined": {
879
+ "name": "protocolFee";
756
880
  };
757
881
  };
758
882
  },
759
883
  {
760
- name: "padding1";
761
- type: {
762
- array: ["u8", 32];
884
+ "name": "padding1";
885
+ "type": {
886
+ "array": [
887
+ "u8",
888
+ 32
889
+ ];
763
890
  };
764
891
  },
765
892
  {
766
- name: "rewardInfos";
767
- type: {
768
- array: [
893
+ "name": "rewardInfos";
894
+ "type": {
895
+ "array": [
769
896
  {
770
- defined: {
771
- name: "dlmm::dlmm::types::RewardInfo";
897
+ "defined": {
898
+ "name": "dlmm::dlmm::types::RewardInfo";
772
899
  };
773
900
  },
774
901
  2
@@ -776,287 +903,372 @@ type Zap$1 = {
776
903
  };
777
904
  },
778
905
  {
779
- name: "oracle";
780
- type: "pubkey";
906
+ "name": "oracle";
907
+ "type": "pubkey";
781
908
  },
782
909
  {
783
- name: "binArrayBitmap";
784
- type: {
785
- array: ["u64", 16];
910
+ "name": "binArrayBitmap";
911
+ "type": {
912
+ "array": [
913
+ "u64",
914
+ 16
915
+ ];
786
916
  };
787
917
  },
788
918
  {
789
- name: "lastUpdatedAt";
790
- type: "i64";
919
+ "name": "lastUpdatedAt";
920
+ "type": "i64";
791
921
  },
792
922
  {
793
- name: "padding2";
794
- type: {
795
- array: ["u8", 32];
923
+ "name": "padding2";
924
+ "type": {
925
+ "array": [
926
+ "u8",
927
+ 32
928
+ ];
796
929
  };
797
930
  },
798
931
  {
799
- name: "preActivationSwapAddress";
800
- type: "pubkey";
932
+ "name": "preActivationSwapAddress";
933
+ "type": "pubkey";
801
934
  },
802
935
  {
803
- name: "baseKey";
804
- type: "pubkey";
936
+ "name": "baseKey";
937
+ "type": "pubkey";
805
938
  },
806
939
  {
807
- name: "activationPoint";
808
- type: "u64";
940
+ "name": "activationPoint";
941
+ "type": "u64";
809
942
  },
810
943
  {
811
- name: "preActivationDuration";
812
- type: "u64";
944
+ "name": "preActivationDuration";
945
+ "type": "u64";
813
946
  },
814
947
  {
815
- name: "padding3";
816
- type: {
817
- array: ["u8", 8];
948
+ "name": "padding3";
949
+ "type": {
950
+ "array": [
951
+ "u8",
952
+ 8
953
+ ];
818
954
  };
819
955
  },
820
956
  {
821
- name: "padding4";
822
- type: "u64";
957
+ "name": "padding4";
958
+ "type": "u64";
823
959
  },
824
960
  {
825
- name: "creator";
826
- type: "pubkey";
961
+ "name": "creator";
962
+ "type": "pubkey";
827
963
  },
828
964
  {
829
- name: "tokenMintXProgramFlag";
830
- type: "u8";
965
+ "name": "tokenMintXProgramFlag";
966
+ "type": "u8";
831
967
  },
832
968
  {
833
- name: "tokenMintYProgramFlag";
834
- type: "u8";
969
+ "name": "tokenMintYProgramFlag";
970
+ "type": "u8";
835
971
  },
836
972
  {
837
- name: "reserved";
838
- type: {
839
- array: ["u8", 22];
973
+ "name": "version";
974
+ "type": "u8";
975
+ },
976
+ {
977
+ "name": "reserved";
978
+ "type": {
979
+ "array": [
980
+ "u8",
981
+ 21
982
+ ];
840
983
  };
841
984
  }
842
985
  ];
843
986
  };
844
987
  },
845
988
  {
846
- name: "pool";
847
- serialization: "bytemuck";
848
- repr: {
849
- kind: "c";
989
+ "name": "pool";
990
+ "serialization": "bytemuck";
991
+ "repr": {
992
+ "kind": "c";
850
993
  };
851
- type: {
852
- kind: "struct";
853
- fields: [
854
- {
855
- name: "poolFees";
856
- docs: ["Pool fee"];
857
- type: {
858
- defined: {
859
- name: "poolFeesStruct";
994
+ "type": {
995
+ "kind": "struct";
996
+ "fields": [
997
+ {
998
+ "name": "poolFees";
999
+ "docs": [
1000
+ "Pool fee"
1001
+ ];
1002
+ "type": {
1003
+ "defined": {
1004
+ "name": "poolFeesStruct";
860
1005
  };
861
1006
  };
862
1007
  },
863
1008
  {
864
- name: "tokenAMint";
865
- docs: ["token a mint"];
866
- type: "pubkey";
1009
+ "name": "tokenAMint";
1010
+ "docs": [
1011
+ "token a mint"
1012
+ ];
1013
+ "type": "pubkey";
867
1014
  },
868
1015
  {
869
- name: "tokenBMint";
870
- docs: ["token b mint"];
871
- type: "pubkey";
1016
+ "name": "tokenBMint";
1017
+ "docs": [
1018
+ "token b mint"
1019
+ ];
1020
+ "type": "pubkey";
872
1021
  },
873
1022
  {
874
- name: "tokenAVault";
875
- docs: ["token a vault"];
876
- type: "pubkey";
1023
+ "name": "tokenAVault";
1024
+ "docs": [
1025
+ "token a vault"
1026
+ ];
1027
+ "type": "pubkey";
877
1028
  },
878
1029
  {
879
- name: "tokenBVault";
880
- docs: ["token b vault"];
881
- type: "pubkey";
1030
+ "name": "tokenBVault";
1031
+ "docs": [
1032
+ "token b vault"
1033
+ ];
1034
+ "type": "pubkey";
882
1035
  },
883
1036
  {
884
- name: "whitelistedVault";
885
- docs: [
1037
+ "name": "whitelistedVault";
1038
+ "docs": [
886
1039
  "Whitelisted vault to be able to buy pool before activation_point"
887
1040
  ];
888
- type: "pubkey";
1041
+ "type": "pubkey";
889
1042
  },
890
1043
  {
891
- name: "padding0";
892
- docs: [
1044
+ "name": "padding0";
1045
+ "docs": [
893
1046
  "padding, previously partner pubkey, be careful when using this field"
894
1047
  ];
895
- type: {
896
- array: ["u8", 32];
1048
+ "type": {
1049
+ "array": [
1050
+ "u8",
1051
+ 32
1052
+ ];
897
1053
  };
898
1054
  },
899
1055
  {
900
- name: "liquidity";
901
- docs: ["liquidity share"];
902
- type: "u128";
1056
+ "name": "liquidity";
1057
+ "docs": [
1058
+ "liquidity share"
1059
+ ];
1060
+ "type": "u128";
903
1061
  },
904
1062
  {
905
- name: "padding1";
906
- docs: [
1063
+ "name": "padding1";
1064
+ "docs": [
907
1065
  "padding, previous reserve amount, be careful to use that field"
908
1066
  ];
909
- type: "u128";
1067
+ "type": "u128";
910
1068
  },
911
1069
  {
912
- name: "protocolAFee";
913
- docs: ["protocol a fee"];
914
- type: "u64";
1070
+ "name": "protocolAFee";
1071
+ "docs": [
1072
+ "protocol a fee"
1073
+ ];
1074
+ "type": "u64";
915
1075
  },
916
1076
  {
917
- name: "protocolBFee";
918
- docs: ["protocol b fee"];
919
- type: "u64";
1077
+ "name": "protocolBFee";
1078
+ "docs": [
1079
+ "protocol b fee"
1080
+ ];
1081
+ "type": "u64";
920
1082
  },
921
1083
  {
922
- name: "padding2";
923
- type: "u128";
1084
+ "name": "padding2";
1085
+ "type": "u128";
924
1086
  },
925
1087
  {
926
- name: "sqrtMinPrice";
927
- docs: ["min price"];
928
- type: "u128";
1088
+ "name": "sqrtMinPrice";
1089
+ "docs": [
1090
+ "min price"
1091
+ ];
1092
+ "type": "u128";
929
1093
  },
930
1094
  {
931
- name: "sqrtMaxPrice";
932
- docs: ["max price"];
933
- type: "u128";
1095
+ "name": "sqrtMaxPrice";
1096
+ "docs": [
1097
+ "max price"
1098
+ ];
1099
+ "type": "u128";
934
1100
  },
935
1101
  {
936
- name: "sqrtPrice";
937
- docs: ["current price"];
938
- type: "u128";
1102
+ "name": "sqrtPrice";
1103
+ "docs": [
1104
+ "current price"
1105
+ ];
1106
+ "type": "u128";
939
1107
  },
940
1108
  {
941
- name: "activationPoint";
942
- docs: ["Activation point, can be slot or timestamp"];
943
- type: "u64";
1109
+ "name": "activationPoint";
1110
+ "docs": [
1111
+ "Activation point, can be slot or timestamp"
1112
+ ];
1113
+ "type": "u64";
944
1114
  },
945
1115
  {
946
- name: "activationType";
947
- docs: ["Activation type, 0 means by slot, 1 means by timestamp"];
948
- type: "u8";
1116
+ "name": "activationType";
1117
+ "docs": [
1118
+ "Activation type, 0 means by slot, 1 means by timestamp"
1119
+ ];
1120
+ "type": "u8";
949
1121
  },
950
1122
  {
951
- name: "poolStatus";
952
- docs: ["pool status, 0: enable, 1 disable"];
953
- type: "u8";
1123
+ "name": "poolStatus";
1124
+ "docs": [
1125
+ "pool status, 0: enable, 1 disable"
1126
+ ];
1127
+ "type": "u8";
954
1128
  },
955
1129
  {
956
- name: "tokenAFlag";
957
- docs: ["token a flag"];
958
- type: "u8";
1130
+ "name": "tokenAFlag";
1131
+ "docs": [
1132
+ "token a flag"
1133
+ ];
1134
+ "type": "u8";
959
1135
  },
960
1136
  {
961
- name: "tokenBFlag";
962
- docs: ["token b flag"];
963
- type: "u8";
1137
+ "name": "tokenBFlag";
1138
+ "docs": [
1139
+ "token b flag"
1140
+ ];
1141
+ "type": "u8";
964
1142
  },
965
1143
  {
966
- name: "collectFeeMode";
967
- docs: [
1144
+ "name": "collectFeeMode";
1145
+ "docs": [
968
1146
  "0 is collect fee in both token, 1 only collect fee only in token b"
969
1147
  ];
970
- type: "u8";
1148
+ "type": "u8";
971
1149
  },
972
1150
  {
973
- name: "poolType";
974
- docs: ["pool type"];
975
- type: "u8";
1151
+ "name": "poolType";
1152
+ "docs": [
1153
+ "pool type"
1154
+ ];
1155
+ "type": "u8";
976
1156
  },
977
1157
  {
978
- name: "feeVersion";
979
- docs: [
1158
+ "name": "feeVersion";
1159
+ "docs": [
980
1160
  "pool fee version, 0: max_fee is still capped at 50%, 1: max_fee is capped at 99%"
981
1161
  ];
982
- type: "u8";
1162
+ "type": "u8";
983
1163
  },
984
1164
  {
985
- name: "padding3";
986
- docs: ["padding"];
987
- type: "u8";
1165
+ "name": "padding3";
1166
+ "docs": [
1167
+ "padding"
1168
+ ];
1169
+ "type": "u8";
988
1170
  },
989
1171
  {
990
- name: "feeAPerLiquidity";
991
- docs: ["cumulative"];
992
- type: {
993
- array: ["u8", 32];
1172
+ "name": "feeAPerLiquidity";
1173
+ "docs": [
1174
+ "cumulative"
1175
+ ];
1176
+ "type": {
1177
+ "array": [
1178
+ "u8",
1179
+ 32
1180
+ ];
994
1181
  };
995
1182
  },
996
1183
  {
997
- name: "feeBPerLiquidity";
998
- docs: ["cumulative"];
999
- type: {
1000
- array: ["u8", 32];
1184
+ "name": "feeBPerLiquidity";
1185
+ "docs": [
1186
+ "cumulative"
1187
+ ];
1188
+ "type": {
1189
+ "array": [
1190
+ "u8",
1191
+ 32
1192
+ ];
1001
1193
  };
1002
1194
  },
1003
1195
  {
1004
- name: "permanentLockLiquidity";
1005
- type: "u128";
1196
+ "name": "permanentLockLiquidity";
1197
+ "type": "u128";
1006
1198
  },
1007
1199
  {
1008
- name: "metrics";
1009
- docs: ["metrics"];
1010
- type: {
1011
- defined: {
1012
- name: "poolMetrics";
1200
+ "name": "metrics";
1201
+ "docs": [
1202
+ "metrics"
1203
+ ];
1204
+ "type": {
1205
+ "defined": {
1206
+ "name": "poolMetrics";
1013
1207
  };
1014
1208
  };
1015
1209
  },
1016
1210
  {
1017
- name: "creator";
1018
- docs: ["pool creator"];
1019
- type: "pubkey";
1211
+ "name": "creator";
1212
+ "docs": [
1213
+ "pool creator"
1214
+ ];
1215
+ "type": "pubkey";
1020
1216
  },
1021
1217
  {
1022
- name: "tokenAAmount";
1023
- docs: ["token a amount"];
1024
- type: "u64";
1218
+ "name": "tokenAAmount";
1219
+ "docs": [
1220
+ "token a amount"
1221
+ ];
1222
+ "type": "u64";
1025
1223
  },
1026
1224
  {
1027
- name: "tokenBAmount";
1028
- docs: ["token b amount"];
1029
- type: "u64";
1225
+ "name": "tokenBAmount";
1226
+ "docs": [
1227
+ "token b amount"
1228
+ ];
1229
+ "type": "u64";
1030
1230
  },
1031
1231
  {
1032
- name: "layoutVersion";
1033
- docs: [
1232
+ "name": "layoutVersion";
1233
+ "docs": [
1034
1234
  "layout version: version 0: haven't track token_a_amount and token_b_amount, version 1: track token_a_amount and token_b_amount"
1035
1235
  ];
1036
- type: "u8";
1236
+ "type": "u8";
1037
1237
  },
1038
1238
  {
1039
- name: "padding4";
1040
- docs: ["Padding for further use"];
1041
- type: {
1042
- array: ["u8", 7];
1239
+ "name": "padding4";
1240
+ "docs": [
1241
+ "Padding for further use"
1242
+ ];
1243
+ "type": {
1244
+ "array": [
1245
+ "u8",
1246
+ 7
1247
+ ];
1043
1248
  };
1044
1249
  },
1045
1250
  {
1046
- name: "padding5";
1047
- docs: ["Padding for further use"];
1048
- type: {
1049
- array: ["u64", 3];
1251
+ "name": "padding5";
1252
+ "docs": [
1253
+ "Padding for further use"
1254
+ ];
1255
+ "type": {
1256
+ "array": [
1257
+ "u64",
1258
+ 3
1259
+ ];
1050
1260
  };
1051
1261
  },
1052
1262
  {
1053
- name: "rewardInfos";
1054
- docs: ["Farming reward information"];
1055
- type: {
1056
- array: [
1263
+ "name": "rewardInfos";
1264
+ "docs": [
1265
+ "Farming reward information"
1266
+ ];
1267
+ "type": {
1268
+ "array": [
1057
1269
  {
1058
- defined: {
1059
- name: "cp_amm::state::pool::RewardInfo";
1270
+ "defined": {
1271
+ "name": "cp_amm::state::pool::RewardInfo";
1060
1272
  };
1061
1273
  },
1062
1274
  2
@@ -1067,156 +1279,170 @@ type Zap$1 = {
1067
1279
  };
1068
1280
  },
1069
1281
  {
1070
- name: "poolFeesStruct";
1071
- docs: [
1282
+ "name": "poolFeesStruct";
1283
+ "docs": [
1072
1284
  "Information regarding fee charges",
1073
1285
  "trading_fee = amount * trade_fee_numerator / denominator",
1074
1286
  "protocol_fee = trading_fee * protocol_fee_percentage / 100",
1075
1287
  "referral_fee = protocol_fee * referral_percentage / 100"
1076
1288
  ];
1077
- serialization: "bytemuck";
1078
- repr: {
1079
- kind: "c";
1289
+ "serialization": "bytemuck";
1290
+ "repr": {
1291
+ "kind": "c";
1080
1292
  };
1081
- type: {
1082
- kind: "struct";
1083
- fields: [
1293
+ "type": {
1294
+ "kind": "struct";
1295
+ "fields": [
1084
1296
  {
1085
- name: "baseFee";
1086
- docs: [
1297
+ "name": "baseFee";
1298
+ "docs": [
1087
1299
  "Trade fees are extra token amounts that are held inside the token",
1088
1300
  "accounts during a trade, making the value of liquidity tokens rise.",
1089
1301
  "Trade fee numerator"
1090
1302
  ];
1091
- type: {
1092
- defined: {
1093
- name: "baseFeeStruct";
1303
+ "type": {
1304
+ "defined": {
1305
+ "name": "baseFeeStruct";
1094
1306
  };
1095
1307
  };
1096
1308
  },
1097
1309
  {
1098
- name: "protocolFeePercent";
1099
- docs: [
1310
+ "name": "protocolFeePercent";
1311
+ "docs": [
1100
1312
  "Protocol trading fees are extra token amounts that are held inside the token",
1101
1313
  "accounts during a trade, with the equivalent in pool tokens minted to",
1102
1314
  "the protocol of the program.",
1103
1315
  "Protocol trade fee numerator"
1104
1316
  ];
1105
- type: "u8";
1317
+ "type": "u8";
1106
1318
  },
1107
1319
  {
1108
- name: "padding0";
1109
- docs: ["padding for future use"];
1110
- type: "u8";
1320
+ "name": "padding0";
1321
+ "docs": [
1322
+ "padding for future use"
1323
+ ];
1324
+ "type": "u8";
1111
1325
  },
1112
1326
  {
1113
- name: "referralFeePercent";
1114
- docs: ["referral fee"];
1115
- type: "u8";
1327
+ "name": "referralFeePercent";
1328
+ "docs": [
1329
+ "referral fee"
1330
+ ];
1331
+ "type": "u8";
1116
1332
  },
1117
1333
  {
1118
- name: "padding1";
1119
- docs: ["padding"];
1120
- type: {
1121
- array: ["u8", 3];
1334
+ "name": "padding1";
1335
+ "docs": [
1336
+ "padding"
1337
+ ];
1338
+ "type": {
1339
+ "array": [
1340
+ "u8",
1341
+ 3
1342
+ ];
1122
1343
  };
1123
1344
  },
1124
1345
  {
1125
- name: "compoundingFeeBps";
1126
- docs: [
1346
+ "name": "compoundingFeeBps";
1347
+ "docs": [
1127
1348
  "compounding fee bps, only non-zero in CollectFeeMode::Compounding"
1128
1349
  ];
1129
- type: "u16";
1350
+ "type": "u16";
1130
1351
  },
1131
1352
  {
1132
- name: "dynamicFee";
1133
- docs: ["dynamic fee"];
1134
- type: {
1135
- defined: {
1136
- name: "dynamicFeeStruct";
1353
+ "name": "dynamicFee";
1354
+ "docs": [
1355
+ "dynamic fee"
1356
+ ];
1357
+ "type": {
1358
+ "defined": {
1359
+ "name": "dynamicFeeStruct";
1137
1360
  };
1138
1361
  };
1139
1362
  },
1140
1363
  {
1141
- name: "initSqrtPrice";
1142
- type: "u128";
1364
+ "name": "initSqrtPrice";
1365
+ "type": "u128";
1143
1366
  }
1144
1367
  ];
1145
1368
  };
1146
1369
  },
1147
1370
  {
1148
- name: "poolMetrics";
1149
- serialization: "bytemuck";
1150
- repr: {
1151
- kind: "c";
1371
+ "name": "poolMetrics";
1372
+ "serialization": "bytemuck";
1373
+ "repr": {
1374
+ "kind": "c";
1152
1375
  };
1153
- type: {
1154
- kind: "struct";
1155
- fields: [
1376
+ "type": {
1377
+ "kind": "struct";
1378
+ "fields": [
1156
1379
  {
1157
- name: "totalLpAFee";
1158
- type: "u128";
1380
+ "name": "totalLpAFee";
1381
+ "type": "u128";
1159
1382
  },
1160
1383
  {
1161
- name: "totalLpBFee";
1162
- type: "u128";
1384
+ "name": "totalLpBFee";
1385
+ "type": "u128";
1163
1386
  },
1164
1387
  {
1165
- name: "totalProtocolAFee";
1166
- type: "u64";
1388
+ "name": "totalProtocolAFee";
1389
+ "type": "u64";
1167
1390
  },
1168
1391
  {
1169
- name: "totalProtocolBFee";
1170
- type: "u64";
1392
+ "name": "totalProtocolBFee";
1393
+ "type": "u64";
1171
1394
  },
1172
1395
  {
1173
- name: "padding0";
1174
- type: {
1175
- array: ["u64", 2];
1396
+ "name": "padding0";
1397
+ "type": {
1398
+ "array": [
1399
+ "u64",
1400
+ 2
1401
+ ];
1176
1402
  };
1177
1403
  },
1178
1404
  {
1179
- name: "totalPosition";
1180
- type: "u64";
1405
+ "name": "totalPosition";
1406
+ "type": "u64";
1181
1407
  },
1182
1408
  {
1183
- name: "padding";
1184
- type: "u64";
1409
+ "name": "padding";
1410
+ "type": "u64";
1185
1411
  }
1186
1412
  ];
1187
1413
  };
1188
1414
  },
1189
1415
  {
1190
- name: "protocolFee";
1191
- serialization: "bytemuck";
1192
- repr: {
1193
- kind: "c";
1416
+ "name": "protocolFee";
1417
+ "serialization": "bytemuck";
1418
+ "repr": {
1419
+ "kind": "c";
1194
1420
  };
1195
- type: {
1196
- kind: "struct";
1197
- fields: [
1421
+ "type": {
1422
+ "kind": "struct";
1423
+ "fields": [
1198
1424
  {
1199
- name: "amountX";
1200
- type: "u64";
1425
+ "name": "amountX";
1426
+ "type": "u64";
1201
1427
  },
1202
1428
  {
1203
- name: "amountY";
1204
- type: "u64";
1429
+ "name": "amountY";
1430
+ "type": "u64";
1205
1431
  }
1206
1432
  ];
1207
1433
  };
1208
1434
  },
1209
1435
  {
1210
- name: "remainingAccountsInfo";
1211
- type: {
1212
- kind: "struct";
1213
- fields: [
1214
- {
1215
- name: "slices";
1216
- type: {
1217
- vec: {
1218
- defined: {
1219
- name: "remainingAccountsSlice";
1436
+ "name": "remainingAccountsInfo";
1437
+ "type": {
1438
+ "kind": "struct";
1439
+ "fields": [
1440
+ {
1441
+ "name": "slices";
1442
+ "type": {
1443
+ "vec": {
1444
+ "defined": {
1445
+ "name": "remainingAccountsSlice";
1220
1446
  };
1221
1447
  };
1222
1448
  };
@@ -1225,345 +1451,407 @@ type Zap$1 = {
1225
1451
  };
1226
1452
  },
1227
1453
  {
1228
- name: "remainingAccountsSlice";
1229
- type: {
1230
- kind: "struct";
1231
- fields: [
1232
- {
1233
- name: "accountsType";
1234
- type: {
1235
- defined: {
1236
- name: "accountsType";
1454
+ "name": "remainingAccountsSlice";
1455
+ "type": {
1456
+ "kind": "struct";
1457
+ "fields": [
1458
+ {
1459
+ "name": "accountsType";
1460
+ "type": {
1461
+ "defined": {
1462
+ "name": "accountsType";
1237
1463
  };
1238
1464
  };
1239
1465
  },
1240
1466
  {
1241
- name: "length";
1242
- type: "u8";
1467
+ "name": "length";
1468
+ "type": "u8";
1243
1469
  }
1244
1470
  ];
1245
1471
  };
1246
1472
  },
1247
1473
  {
1248
- name: "staticParameters";
1249
- docs: ["Parameter that set by the protocol"];
1250
- serialization: "bytemuck";
1251
- repr: {
1252
- kind: "c";
1474
+ "name": "staticParameters";
1475
+ "docs": [
1476
+ "Parameter that set by the protocol"
1477
+ ];
1478
+ "serialization": "bytemuck";
1479
+ "repr": {
1480
+ "kind": "c";
1253
1481
  };
1254
- type: {
1255
- kind: "struct";
1256
- fields: [
1482
+ "type": {
1483
+ "kind": "struct";
1484
+ "fields": [
1485
+ {
1486
+ "name": "baseFactor";
1487
+ "type": "u16";
1488
+ },
1257
1489
  {
1258
- name: "baseFactor";
1259
- type: "u16";
1490
+ "name": "filterPeriod";
1491
+ "type": "u16";
1260
1492
  },
1261
1493
  {
1262
- name: "filterPeriod";
1263
- type: "u16";
1494
+ "name": "decayPeriod";
1495
+ "type": "u16";
1264
1496
  },
1265
1497
  {
1266
- name: "decayPeriod";
1267
- type: "u16";
1498
+ "name": "reductionFactor";
1499
+ "type": "u16";
1268
1500
  },
1269
1501
  {
1270
- name: "reductionFactor";
1271
- type: "u16";
1502
+ "name": "variableFeeControl";
1503
+ "type": "u32";
1272
1504
  },
1273
1505
  {
1274
- name: "variableFeeControl";
1275
- type: "u32";
1506
+ "name": "maxVolatilityAccumulator";
1507
+ "type": "u32";
1276
1508
  },
1277
1509
  {
1278
- name: "maxVolatilityAccumulator";
1279
- type: "u32";
1510
+ "name": "minBinId";
1511
+ "type": "i32";
1280
1512
  },
1281
1513
  {
1282
- name: "minBinId";
1283
- type: "i32";
1514
+ "name": "maxBinId";
1515
+ "type": "i32";
1284
1516
  },
1285
1517
  {
1286
- name: "maxBinId";
1287
- type: "i32";
1518
+ "name": "protocolShare";
1519
+ "type": "u16";
1288
1520
  },
1289
1521
  {
1290
- name: "protocolShare";
1291
- type: "u16";
1522
+ "name": "baseFeePowerFactor";
1523
+ "type": "u8";
1292
1524
  },
1293
1525
  {
1294
- name: "baseFeePowerFactor";
1295
- type: "u8";
1526
+ "name": "functionType";
1527
+ "type": "u8";
1296
1528
  },
1297
1529
  {
1298
- name: "padding";
1299
- type: {
1300
- array: ["u8", 5];
1530
+ "name": "collectFeeMode";
1531
+ "type": "u8";
1532
+ },
1533
+ {
1534
+ "name": "padding";
1535
+ "type": {
1536
+ "array": [
1537
+ "u8",
1538
+ 3
1539
+ ];
1301
1540
  };
1302
1541
  }
1303
1542
  ];
1304
1543
  };
1305
1544
  },
1306
1545
  {
1307
- name: "strategyType";
1308
- type: {
1309
- kind: "enum";
1310
- variants: [
1546
+ "name": "strategyType";
1547
+ "type": {
1548
+ "kind": "enum";
1549
+ "variants": [
1311
1550
  {
1312
- name: "spot";
1551
+ "name": "spot";
1313
1552
  },
1314
1553
  {
1315
- name: "curve";
1554
+ "name": "curve";
1316
1555
  },
1317
1556
  {
1318
- name: "bidAsk";
1557
+ "name": "bidAsk";
1319
1558
  }
1320
1559
  ];
1321
1560
  };
1322
1561
  },
1323
1562
  {
1324
- name: "userLedger";
1325
- serialization: "bytemuck";
1326
- repr: {
1327
- kind: "c";
1563
+ "name": "userLedger";
1564
+ "serialization": "bytemuck";
1565
+ "repr": {
1566
+ "kind": "c";
1328
1567
  };
1329
- type: {
1330
- kind: "struct";
1331
- fields: [
1568
+ "type": {
1569
+ "kind": "struct";
1570
+ "fields": [
1332
1571
  {
1333
- name: "owner";
1334
- type: "pubkey";
1572
+ "name": "owner";
1573
+ "type": "pubkey";
1335
1574
  },
1336
1575
  {
1337
- name: "amountA";
1338
- type: "u64";
1576
+ "name": "amountA";
1577
+ "type": "u64";
1339
1578
  },
1340
1579
  {
1341
- name: "amountB";
1342
- type: "u64";
1580
+ "name": "amountB";
1581
+ "type": "u64";
1343
1582
  }
1344
1583
  ];
1345
1584
  };
1346
1585
  },
1347
1586
  {
1348
- name: "variableParameters";
1349
- docs: ["Parameters that changes based on dynamic of the market"];
1350
- serialization: "bytemuck";
1351
- repr: {
1352
- kind: "c";
1587
+ "name": "variableParameters";
1588
+ "docs": [
1589
+ "Parameters that changes based on dynamic of the market"
1590
+ ];
1591
+ "serialization": "bytemuck";
1592
+ "repr": {
1593
+ "kind": "c";
1353
1594
  };
1354
- type: {
1355
- kind: "struct";
1356
- fields: [
1595
+ "type": {
1596
+ "kind": "struct";
1597
+ "fields": [
1357
1598
  {
1358
- name: "volatilityAccumulator";
1359
- type: "u32";
1599
+ "name": "volatilityAccumulator";
1600
+ "type": "u32";
1360
1601
  },
1361
1602
  {
1362
- name: "volatilityReference";
1363
- type: "u32";
1603
+ "name": "volatilityReference";
1604
+ "type": "u32";
1364
1605
  },
1365
1606
  {
1366
- name: "indexReference";
1367
- type: "i32";
1607
+ "name": "indexReference";
1608
+ "type": "i32";
1368
1609
  },
1369
1610
  {
1370
- name: "padding";
1371
- type: {
1372
- array: ["u8", 4];
1611
+ "name": "padding";
1612
+ "type": {
1613
+ "array": [
1614
+ "u8",
1615
+ 4
1616
+ ];
1373
1617
  };
1374
1618
  },
1375
1619
  {
1376
- name: "lastUpdateTimestamp";
1377
- type: "i64";
1620
+ "name": "lastUpdateTimestamp";
1621
+ "type": "i64";
1378
1622
  },
1379
1623
  {
1380
- name: "padding1";
1381
- type: {
1382
- array: ["u8", 8];
1624
+ "name": "padding1";
1625
+ "type": {
1626
+ "array": [
1627
+ "u8",
1628
+ 8
1629
+ ];
1383
1630
  };
1384
1631
  }
1385
1632
  ];
1386
1633
  };
1387
1634
  },
1388
1635
  {
1389
- name: "zapOutParameters";
1390
- type: {
1391
- kind: "struct";
1392
- fields: [
1636
+ "name": "zapOutParameters";
1637
+ "type": {
1638
+ "kind": "struct";
1639
+ "fields": [
1393
1640
  {
1394
- name: "percentage";
1395
- type: "u8";
1641
+ "name": "percentage";
1642
+ "type": "u8";
1396
1643
  },
1397
1644
  {
1398
- name: "offsetAmountIn";
1399
- type: "u16";
1645
+ "name": "offsetAmountIn";
1646
+ "type": "u16";
1400
1647
  },
1401
1648
  {
1402
- name: "preUserTokenBalance";
1403
- type: "u64";
1649
+ "name": "preUserTokenBalance";
1650
+ "type": "u64";
1404
1651
  },
1405
1652
  {
1406
- name: "maxSwapAmount";
1407
- type: "u64";
1653
+ "name": "maxSwapAmount";
1654
+ "type": "u64";
1408
1655
  },
1409
1656
  {
1410
- name: "payloadData";
1411
- type: "bytes";
1657
+ "name": "payloadData";
1658
+ "type": "bytes";
1412
1659
  }
1413
1660
  ];
1414
1661
  };
1415
1662
  },
1416
1663
  {
1417
- name: "cp_amm::state::pool::RewardInfo";
1418
- docs: ["Stores the state relevant for tracking liquidity mining rewards"];
1419
- serialization: "bytemuck";
1420
- repr: {
1421
- kind: "c";
1664
+ "name": "cp_amm::state::pool::RewardInfo";
1665
+ "docs": [
1666
+ "Stores the state relevant for tracking liquidity mining rewards"
1667
+ ];
1668
+ "serialization": "bytemuck";
1669
+ "repr": {
1670
+ "kind": "c";
1422
1671
  };
1423
- type: {
1424
- kind: "struct";
1425
- fields: [
1672
+ "type": {
1673
+ "kind": "struct";
1674
+ "fields": [
1426
1675
  {
1427
- name: "initialized";
1428
- docs: ["Indicates if the reward has been initialized"];
1429
- type: "u8";
1676
+ "name": "initialized";
1677
+ "docs": [
1678
+ "Indicates if the reward has been initialized"
1679
+ ];
1680
+ "type": "u8";
1430
1681
  },
1431
1682
  {
1432
- name: "rewardTokenFlag";
1433
- docs: ["reward token flag"];
1434
- type: "u8";
1683
+ "name": "rewardTokenFlag";
1684
+ "docs": [
1685
+ "reward token flag"
1686
+ ];
1687
+ "type": "u8";
1435
1688
  },
1436
1689
  {
1437
- name: "padding0";
1438
- docs: ["padding"];
1439
- type: {
1440
- array: ["u8", 6];
1690
+ "name": "padding0";
1691
+ "docs": [
1692
+ "padding"
1693
+ ];
1694
+ "type": {
1695
+ "array": [
1696
+ "u8",
1697
+ 6
1698
+ ];
1441
1699
  };
1442
1700
  },
1443
1701
  {
1444
- name: "padding1";
1445
- docs: ["Padding to ensure `reward_rate: u128` is 16-byte aligned"];
1446
- type: {
1447
- array: ["u8", 8];
1448
- };
1702
+ "name": "deadLiquidityRewardCheckpoint";
1703
+ "docs": [
1704
+ "Cumulative dead-liquidity reward (Compounding Pool only)"
1705
+ ];
1706
+ "type": "u64";
1449
1707
  },
1450
1708
  {
1451
- name: "mint";
1452
- docs: ["Reward token mint."];
1453
- type: "pubkey";
1709
+ "name": "mint";
1710
+ "docs": [
1711
+ "Reward token mint."
1712
+ ];
1713
+ "type": "pubkey";
1454
1714
  },
1455
1715
  {
1456
- name: "vault";
1457
- docs: ["Reward vault token account."];
1458
- type: "pubkey";
1716
+ "name": "vault";
1717
+ "docs": [
1718
+ "Reward vault token account."
1719
+ ];
1720
+ "type": "pubkey";
1459
1721
  },
1460
1722
  {
1461
- name: "funder";
1462
- docs: ["Authority account that allows to fund rewards"];
1463
- type: "pubkey";
1723
+ "name": "funder";
1724
+ "docs": [
1725
+ "Authority account that allows to fund rewards"
1726
+ ];
1727
+ "type": "pubkey";
1464
1728
  },
1465
1729
  {
1466
- name: "rewardDuration";
1467
- docs: ["reward duration"];
1468
- type: "u64";
1730
+ "name": "rewardDuration";
1731
+ "docs": [
1732
+ "reward duration"
1733
+ ];
1734
+ "type": "u64";
1469
1735
  },
1470
1736
  {
1471
- name: "rewardDurationEnd";
1472
- docs: ["reward duration end"];
1473
- type: "u64";
1737
+ "name": "rewardDurationEnd";
1738
+ "docs": [
1739
+ "reward duration end"
1740
+ ];
1741
+ "type": "u64";
1474
1742
  },
1475
1743
  {
1476
- name: "rewardRate";
1477
- docs: ["reward rate"];
1478
- type: "u128";
1744
+ "name": "rewardRate";
1745
+ "docs": [
1746
+ "reward rate"
1747
+ ];
1748
+ "type": "u128";
1479
1749
  },
1480
1750
  {
1481
- name: "rewardPerTokenStored";
1482
- docs: ["Reward per token stored"];
1483
- type: {
1484
- array: ["u8", 32];
1751
+ "name": "rewardPerTokenStored";
1752
+ "docs": [
1753
+ "Reward per token stored"
1754
+ ];
1755
+ "type": {
1756
+ "array": [
1757
+ "u8",
1758
+ 32
1759
+ ];
1485
1760
  };
1486
1761
  },
1487
1762
  {
1488
- name: "lastUpdateTime";
1489
- docs: ["The last time reward states were updated."];
1490
- type: "u64";
1763
+ "name": "lastUpdateTime";
1764
+ "docs": [
1765
+ "The last time reward states were updated."
1766
+ ];
1767
+ "type": "u64";
1491
1768
  },
1492
1769
  {
1493
- name: "cumulativeSecondsWithEmptyLiquidityReward";
1494
- docs: [
1770
+ "name": "cumulativeSecondsWithEmptyLiquidityReward";
1771
+ "docs": [
1495
1772
  "Accumulated seconds when the farm distributed rewards but the bin was empty.",
1496
1773
  "These rewards will be carried over to the next reward time window."
1497
1774
  ];
1498
- type: "u64";
1775
+ "type": "u64";
1499
1776
  }
1500
1777
  ];
1501
1778
  };
1502
1779
  },
1503
1780
  {
1504
- name: "dlmm::dlmm::types::RewardInfo";
1505
- docs: ["Stores the state relevant for tracking liquidity mining rewards"];
1506
- serialization: "bytemuck";
1507
- repr: {
1508
- kind: "c";
1781
+ "name": "dlmm::dlmm::types::RewardInfo";
1782
+ "docs": [
1783
+ "Stores the state relevant for tracking liquidity mining rewards"
1784
+ ];
1785
+ "serialization": "bytemuck";
1786
+ "repr": {
1787
+ "kind": "c";
1509
1788
  };
1510
- type: {
1511
- kind: "struct";
1512
- fields: [
1789
+ "type": {
1790
+ "kind": "struct";
1791
+ "fields": [
1513
1792
  {
1514
- name: "mint";
1515
- type: "pubkey";
1793
+ "name": "mint";
1794
+ "type": "pubkey";
1516
1795
  },
1517
1796
  {
1518
- name: "vault";
1519
- type: "pubkey";
1797
+ "name": "vault";
1798
+ "type": "pubkey";
1520
1799
  },
1521
1800
  {
1522
- name: "funder";
1523
- type: "pubkey";
1801
+ "name": "funder";
1802
+ "type": "pubkey";
1524
1803
  },
1525
1804
  {
1526
- name: "rewardDuration";
1527
- type: "u64";
1805
+ "name": "rewardDuration";
1806
+ "type": "u64";
1528
1807
  },
1529
1808
  {
1530
- name: "rewardDurationEnd";
1531
- type: "u64";
1809
+ "name": "rewardDurationEnd";
1810
+ "type": "u64";
1532
1811
  },
1533
1812
  {
1534
- name: "rewardRate";
1535
- type: "u128";
1813
+ "name": "rewardRate";
1814
+ "type": "u128";
1536
1815
  },
1537
1816
  {
1538
- name: "lastUpdateTime";
1539
- type: "u64";
1817
+ "name": "lastUpdateTime";
1818
+ "type": "u64";
1540
1819
  },
1541
1820
  {
1542
- name: "cumulativeSecondsWithEmptyLiquidityReward";
1543
- type: "u64";
1821
+ "name": "cumulativeSecondsWithEmptyLiquidityReward";
1822
+ "type": "u64";
1544
1823
  }
1545
1824
  ];
1546
1825
  };
1547
1826
  }
1548
1827
  ];
1549
- constants: [
1828
+ "constants": [
1550
1829
  {
1551
- name: "maxBasisPoint";
1552
- type: "u16";
1553
- value: "10000";
1830
+ "name": "maxBasisPoint";
1831
+ "type": "u16";
1832
+ "value": "10000";
1554
1833
  },
1555
1834
  {
1556
- name: "userLedgerPrefix";
1557
- type: "bytes";
1558
- value: "[117, 115, 101, 114, 95, 108, 101, 100, 103, 101, 114]";
1835
+ "name": "userLedgerPrefix";
1836
+ "type": "bytes";
1837
+ "value": "[117, 115, 101, 114, 95, 108, 101, 100, 103, 101, 114]";
1559
1838
  }
1560
1839
  ];
1561
1840
  };
1562
1841
 
1563
1842
  type ZapProgram = Program<Zap$1>;
1843
+ /** Jupiter Swap API version used for quotes and swap instructions. */
1844
+ declare enum JupiterApiVersion {
1845
+ /** @deprecated `GET /swap/v1/quote` + `POST /swap/v1/swap-instructions`. Use V2; v1 will be removed in a future major version. */
1846
+ V1 = "v1",
1847
+ /** `GET /swap/v2/build` (default) */
1848
+ V2 = "v2"
1849
+ }
1564
1850
  type ZapConfig = {
1565
1851
  jupiterApiUrl?: string;
1566
1852
  jupiterApiKey?: string;
1853
+ /** Defaults to `JupiterApiVersion.V2`. */
1854
+ jupiterApiVersion?: JupiterApiVersion;
1567
1855
  };
1568
1856
  type ZapOutParameters = IdlTypes<Zap$1>["zapOutParameters"];
1569
1857
  type ZapOutParams = {
@@ -1604,10 +1892,51 @@ interface ZapOutThroughJupiterParams {
1604
1892
  outputMint: PublicKey;
1605
1893
  inputTokenProgram: PublicKey;
1606
1894
  outputTokenProgram: PublicKey;
1607
- jupiterSwapResponse: JupiterSwapInstructionResponse;
1895
+ jupiterSwapResponse: Pick<JupiterSwapInstructionResponse, "swapInstruction"> & JupiterAddressLookupTableFields;
1608
1896
  maxSwapAmount: BN;
1609
1897
  percentageToZapOut: number;
1610
1898
  }
1899
+ type GetJupiterQuoteParams = {
1900
+ inputMint: PublicKey;
1901
+ outputMint: PublicKey;
1902
+ amount: BN;
1903
+ /** Wallet the swap is built for. Sent as `taker` under v2, unused under v1. */
1904
+ user: PublicKey;
1905
+ maxAccounts: number;
1906
+ slippageBps: number;
1907
+ dynamicSlippage?: boolean;
1908
+ onlyDirectRoutes?: boolean;
1909
+ restrictIntermediateTokens?: boolean;
1910
+ forJitoBundle?: boolean;
1911
+ additionalQueryParams?: Record<string, string>;
1912
+ };
1913
+ /**
1914
+ * Jupiter options for the quote request. The SDK forwards them to Jupiter as-is and does not decide
1915
+ * which ones Jupiter honours, because Jupiter also accepts options it does not document.
1916
+ * Jupiter's API docs are the source of truth for what each option does:
1917
+ * - v1 `GET /swap/v1/quote`: https://developers.jup.ag/docs/api-reference/swap/v1/quote
1918
+ * - v2 `GET /swap/v2/build`: https://developers.jup.ag/docs/api-reference/swap/build
1919
+ *
1920
+ * `dynamicSlippage`, `onlyDirectRoutes`, `restrictIntermediateTokens` and `forJitoBundle` fall back to
1921
+ * `DEFAULT_JUPITER_QUOTE_OPTIONS` when omitted.
1922
+ * `additionalQueryParams` holds any other Jupiter query parameter, as a name to string value map. It is
1923
+ * added last, so it overrides parameters the SDK sets, except `taker` under v2.
1924
+ */
1925
+ type JupiterQuoteOptions = Pick<GetJupiterQuoteParams, "dynamicSlippage" | "onlyDirectRoutes" | "restrictIntermediateTokens" | "forJitoBundle" | "additionalQueryParams">;
1926
+ type GetJupAndDammV2QuotesParams = {
1927
+ connection: Connection;
1928
+ user: PublicKey;
1929
+ inputTokenMint: PublicKey;
1930
+ poolState: PoolState;
1931
+ tokenADecimal: number;
1932
+ tokenBDecimal: number;
1933
+ dammV2SlippageBps: number;
1934
+ jupSlippageBps: number;
1935
+ maxAccounts: number;
1936
+ jupiterQuoteOptions?: JupiterQuoteOptions;
1937
+ config?: ZapConfig;
1938
+ };
1939
+ /** Quote fields shared by v1 `/quote` and v2 `/build` responses. */
1611
1940
  interface JupiterQuoteResponse {
1612
1941
  inputMint: string;
1613
1942
  inAmount: string;
@@ -1616,19 +1945,28 @@ interface JupiterQuoteResponse {
1616
1945
  otherAmountThreshold: string;
1617
1946
  swapMode: string;
1618
1947
  slippageBps: number;
1619
- platformFee: any;
1620
1948
  priceImpactPct: string;
1621
1949
  routePlan: JupiterRoutePlan[];
1622
- contextSlot: number;
1623
- timeTaken: number;
1624
- swapUsdValue: string;
1625
- simplerRouteUsed: boolean;
1626
- mostReliableAmmsQuoteReport: {
1950
+ /** @deprecated v1 only */
1951
+ platformFee?: any;
1952
+ /** @deprecated v1 only */
1953
+ contextSlot?: number;
1954
+ /** @deprecated v1 only */
1955
+ timeTaken?: number;
1956
+ /** @deprecated v1 only */
1957
+ swapUsdValue?: string;
1958
+ /** @deprecated v1 only */
1959
+ simplerRouteUsed?: boolean;
1960
+ /** @deprecated v1 only */
1961
+ mostReliableAmmsQuoteReport?: {
1627
1962
  info: Record<string, string>;
1628
1963
  };
1629
- useIncurredSlippageForQuoting: any;
1630
- otherRoutePlans: any;
1631
- aggregatorVersion: any;
1964
+ /** @deprecated v1 only */
1965
+ useIncurredSlippageForQuoting?: any;
1966
+ /** @deprecated v1 only */
1967
+ otherRoutePlans?: any;
1968
+ /** @deprecated v1 only */
1969
+ aggregatorVersion?: any;
1632
1970
  }
1633
1971
  interface JupiterRoutePlan {
1634
1972
  swapInfo: any;
@@ -1640,6 +1978,39 @@ interface JupiterInstruction {
1640
1978
  accounts: any[];
1641
1979
  data: string;
1642
1980
  }
1981
+ interface JupiterInstructionLayout {
1982
+ /** Byte offset of amount_in (u64 LE) inside the instruction data */
1983
+ amountInOffset: (dataLength: number) => number;
1984
+ /** Index of the user transfer authority in the instruction accounts */
1985
+ userTransferAuthorityIndex: number;
1986
+ }
1987
+ interface JupiterBlockhashWithMetadata {
1988
+ blockhash: number[];
1989
+ lastValidBlockHeight: number;
1990
+ fetchedAt: {
1991
+ secs_since_epoch: number;
1992
+ nanos_since_epoch: number;
1993
+ };
1994
+ }
1995
+ /** Instruction fields shared by v1 `/swap-instructions` and v2 `/build` responses. */
1996
+ interface JupiterSwapInstructions {
1997
+ computeBudgetInstructions: JupiterInstruction[];
1998
+ setupInstructions: JupiterInstruction[];
1999
+ swapInstruction: JupiterInstruction;
2000
+ cleanupInstruction: JupiterInstruction | null;
2001
+ otherInstructions: JupiterInstruction[];
2002
+ tipInstruction?: JupiterInstruction | null;
2003
+ addressesByLookupTableAddress: Record<string, string[]> | null;
2004
+ blockhashWithMetadata: JupiterBlockhashWithMetadata;
2005
+ }
2006
+ /** Lookup table fields of a Jupiter swap instructions response: v2 returns the map, v1 returns only the table addresses. */
2007
+ type JupiterAddressLookupTableFields = {
2008
+ addressesByLookupTableAddress?: Record<string, string[]> | null;
2009
+ addressLookupTableAddresses?: string[];
2010
+ };
2011
+ /** Response of v2 `GET /swap/v2/build`: quote and instructions in one object. */
2012
+ type JupiterBuildResponse = JupiterQuoteResponse & JupiterSwapInstructions;
2013
+ /** @deprecated v1 `POST /swap/v1/swap-instructions` response. Use `JupiterBuildResponse` / `JupiterSwapInstructions`. */
1643
2014
  interface JupiterSwapInstructionResponse {
1644
2015
  tokenLedgerInstruction: JupiterInstruction | null;
1645
2016
  computeBudgetInstructions: JupiterInstruction[];
@@ -1689,6 +2060,7 @@ type GetZapInDammV2DirectPoolParams = {
1689
2060
  priceImpact: Decimal;
1690
2061
  } | null;
1691
2062
  jupiterQuote: JupiterQuoteResponse | null;
2063
+ jupiterQuoteOptions?: JupiterQuoteOptions;
1692
2064
  };
1693
2065
  type GetZapInDammV2IndirectPoolParams = {
1694
2066
  user: PublicKey;
@@ -1702,6 +2074,7 @@ type GetZapInDammV2IndirectPoolParams = {
1702
2074
  slippageBps: number;
1703
2075
  jupiterQuoteToA: JupiterQuoteResponse | null;
1704
2076
  jupiterQuoteToB: JupiterQuoteResponse | null;
2077
+ jupiterQuoteOptions?: JupiterQuoteOptions;
1705
2078
  };
1706
2079
  declare enum ZapInDammV2PoolSwapRoute {
1707
2080
  Jupiter = "jupiter",
@@ -1724,7 +2097,8 @@ type ZapInDammV2DirectPoolParam = {
1724
2097
  maxSqrtPriceChangeBps: number;
1725
2098
  amount: BN;
1726
2099
  preInstructions: TransactionInstruction[];
1727
- swapTransactions: Transaction[];
2100
+ swapInstructions: TransactionInstruction[];
2101
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1728
2102
  cleanUpInstructions: TransactionInstruction[];
1729
2103
  isTokenA?: boolean;
1730
2104
  swapInEstimate: {
@@ -1748,12 +2122,14 @@ type ZapInDammV2IndirectPoolParam = Omit<ZapInDammV2DirectPoolParam, "maxTransfe
1748
2122
  routeB: ZapInDammV2PoolSwapRoute;
1749
2123
  };
1750
2124
  };
1751
- type ZapInDammV2Response = {
1752
- setupTransaction?: Transaction;
1753
- swapTransactions: Transaction[];
1754
- ledgerTransaction: Transaction;
1755
- zapInTransaction: Transaction;
1756
- cleanUpTransaction: Transaction;
2125
+ /**
2126
+ * Output of every Zap method that builds on-chain work. `instructions` must run in order but may be
2127
+ * split across transactions; `addressLookupTableAccounts` lets the client compile v0 transactions.
2128
+ */
2129
+ type ZapInstructionsResponse = {
2130
+ instructions: TransactionInstruction[];
2131
+ /** Lookup tables used by the instructions, each table once. Empty when no Jupiter swap is involved. */
2132
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1757
2133
  };
1758
2134
  declare enum DlmmDirectSwapQuoteRoute {
1759
2135
  Jupiter = 0,
@@ -1780,6 +2156,8 @@ declare enum DlmmSingleSided {
1780
2156
  Y = 1
1781
2157
  }
1782
2158
  interface EstimateDlmmDirectSwapParams {
2159
+ /** Wallet the swap is built for. Sent as Jupiter `taker` under v2. */
2160
+ user: PublicKey;
1783
2161
  amountIn: BN;
1784
2162
  inputTokenMint: PublicKey;
1785
2163
  lbPair: PublicKey;
@@ -1789,6 +2167,7 @@ interface EstimateDlmmDirectSwapParams {
1789
2167
  maxDeltaId: number;
1790
2168
  strategy: StrategyType;
1791
2169
  singleSided?: DlmmSingleSided;
2170
+ jupiterQuoteOptions?: JupiterQuoteOptions;
1792
2171
  config?: ZapConfig;
1793
2172
  }
1794
2173
  interface DlmmDirectSwapEstimateContext {
@@ -1814,6 +2193,8 @@ interface DlmmDirectSwapEstimate {
1814
2193
  context: DlmmDirectSwapEstimateContext;
1815
2194
  }
1816
2195
  interface EstimateDlmmRebalanceSwapParams {
2196
+ /** Wallet the swap is built for. Sent as Jupiter `taker` under v2. */
2197
+ user: PublicKey;
1817
2198
  position: PublicKey;
1818
2199
  lbPair: PublicKey;
1819
2200
  connection: Connection;
@@ -1821,6 +2202,7 @@ interface EstimateDlmmRebalanceSwapParams {
1821
2202
  maxDeltaId: number;
1822
2203
  swapSlippageBps: number;
1823
2204
  strategy: StrategyType;
2205
+ jupiterQuoteOptions?: JupiterQuoteOptions;
1824
2206
  config?: ZapConfig;
1825
2207
  }
1826
2208
  interface DlmmDirectRebalanceEstimateContext {
@@ -1837,6 +2219,8 @@ interface DlmmDirectRebalanceEstimate {
1837
2219
  context: DlmmDirectRebalanceEstimateContext;
1838
2220
  }
1839
2221
  interface EstimateDlmmIndirectSwapParams {
2222
+ /** Wallet the swap is built for. Sent as Jupiter `taker` under v2. */
2223
+ user: PublicKey;
1840
2224
  amountIn: BN;
1841
2225
  inputTokenMint: PublicKey;
1842
2226
  lbPair: PublicKey;
@@ -1846,6 +2230,7 @@ interface EstimateDlmmIndirectSwapParams {
1846
2230
  maxDeltaId: number;
1847
2231
  strategy: StrategyType;
1848
2232
  singleSided?: DlmmSingleSided;
2233
+ jupiterQuoteOptions?: JupiterQuoteOptions;
1849
2234
  config?: ZapConfig;
1850
2235
  }
1851
2236
  interface DlmmIndirectSwapEstimateResult {
@@ -1883,14 +2268,7 @@ interface RebalanceDlmmPositionParams {
1883
2268
  directSwapEstimate: DlmmDirectEstimateResult;
1884
2269
  maxAccounts?: number;
1885
2270
  }
1886
- interface RebalanceDlmmPositionResponse {
1887
- setupTransaction?: Transaction;
1888
- initBinArrayTransaction?: Transaction;
1889
- rebalancePositionTransaction?: Transaction;
1890
- swapTransaction?: Transaction;
1891
- ledgerTransaction: Transaction;
1892
- zapInTransaction: Transaction;
1893
- cleanUpTransaction: Transaction;
2271
+ interface RebalanceDlmmPositionResponse extends ZapInstructionsResponse {
1894
2272
  estimation: {
1895
2273
  currentBalances: {
1896
2274
  tokenX: BN;
@@ -1950,7 +2328,8 @@ type ZapInDlmmIndirectPoolParam = {
1950
2328
  maxTransferAmountX: BN;
1951
2329
  maxTransferAmountY: BN;
1952
2330
  preInstructions: TransactionInstruction[];
1953
- swapTransactions: Transaction[];
2331
+ swapInstructions: TransactionInstruction[];
2332
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1954
2333
  cleanUpInstructions: TransactionInstruction[];
1955
2334
  binArrays: AccountMeta[];
1956
2335
  binArrayBitmapExtension: PublicKey | null;
@@ -1973,7 +2352,8 @@ type ZapInDlmmDirectPoolParam = {
1973
2352
  amount: BN;
1974
2353
  maxTransferAmount: BN;
1975
2354
  preInstructions: TransactionInstruction[];
1976
- swapTransactions: Transaction[];
2355
+ swapInstructions: TransactionInstruction[];
2356
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1977
2357
  cleanUpInstructions: TransactionInstruction[];
1978
2358
  binArrays: AccountMeta[];
1979
2359
  binArrayBitmapExtension: PublicKey | null;
@@ -1981,22 +2361,16 @@ type ZapInDlmmDirectPoolParam = {
1981
2361
  isTokenX: boolean;
1982
2362
  singleSided?: DlmmSingleSided;
1983
2363
  };
1984
- type ZapInDlmmResponse = {
1985
- setupTransaction?: Transaction;
1986
- swapTransactions: Transaction[];
1987
- ledgerTransaction: Transaction;
1988
- zapInTransaction: Transaction;
1989
- cleanUpTransaction: Transaction;
1990
- };
1991
2364
 
1992
2365
  declare class Zap {
1993
2366
  private connection;
1994
2367
  private jupiterApiUrl;
1995
2368
  private jupiterApiKey;
2369
+ private jupiterApiVersion;
1996
2370
  zapProgram: ZapProgram;
1997
2371
  /**
1998
2372
  * @param connection - The connection to the Solana cluster
1999
- * @param config - Optional configuration for Jupiter API URL (default: https://api.jup.ag) and API key (default: empty string)
2373
+ * @param config - Optional configuration for Jupiter API URL (default: https://api.jup.ag), API key (default: empty string) and API version (default: JupiterApiVersion.V2)
2000
2374
  */
2001
2375
  constructor(connection: Connection, config?: ZapConfig);
2002
2376
  private initializeLedgerAccount;
@@ -2023,6 +2397,7 @@ declare class Zap {
2023
2397
  * @param params.dammV2Quote - The DAMM V2 swap quote for exactly 1 input token in lamports (used for price calculation, not the actual amountIn)
2024
2398
  * @param params.jupiterQuote - The Jupiter swap quote for exactly 1 input token in lamports (used for price calculation, not the actual amountIn)
2025
2399
  * @param params.maxTransferAmountExtendPercentage - The percentage to extend the max transfer amount after the swap
2400
+ * @param params.jupiterQuoteOptions - Optional Jupiter quote options, see `JupiterQuoteOptions`
2026
2401
  * @returns The zap-in transaction parameters for a DAMM V2 direct pool
2027
2402
  * @throws if input token mint matches either tokenA or tokenB in the pool
2028
2403
  * @throws if failed to get both Jupiter and DAMM v2 swap quotes
@@ -2045,6 +2420,7 @@ declare class Zap {
2045
2420
  * @param params.jupiterQuoteToA - The Jupiter quote for swapping to tokenA for exactly 1 input token in lamports (used for price calculation, not the actual amountIn)
2046
2421
  * @param params.jupiterQuoteToB - The Jupiter quote for swapping to tokenB for exactly 1 input token in lamports (used for price calculation, not the actual amountIn)
2047
2422
  * @param params.maxTransferAmountExtendPercentage - The percentage to extend the max transfer amount after the swap
2423
+ * @param params.jupiterQuoteOptions - Optional Jupiter quote options, see `JupiterQuoteOptions`
2048
2424
  * @returns The zap-in transaction parameters for a DAMM V2 indirect pool
2049
2425
  * @throws if input token mint matches either tokenA or tokenB in the pool
2050
2426
  * @throws if no Jupiter quote provided for both tokens
@@ -2052,7 +2428,12 @@ declare class Zap {
2052
2428
  */
2053
2429
  getZapInDammV2IndirectPoolParams(params: GetZapInDammV2IndirectPoolParams): Promise<ZapInDammV2IndirectPoolParam | null>;
2054
2430
  /**
2055
- * Build DAMM v2 zap-in transaction
2431
+ * Build the DAMM v2 zap-in instructions
2432
+ *
2433
+ * Instructions are ordered: setup (token accounts, wrap SOL), swaps, ledger, zap in, clean up.
2434
+ * They must run in that order but can be split across several transactions, because state
2435
+ * between steps lives in accounts. Splitting loses atomicity, so send split transactions as a bundle.
2436
+ * No compute budget instructions are included; the client sets the compute budget for each transaction.
2056
2437
  *
2057
2438
  * @param params.user - The user's public key
2058
2439
  * @param params.pool - The pool's public key
@@ -2069,11 +2450,12 @@ declare class Zap {
2069
2450
  * @param params.preSqrtPrice - The sqrt price before the operation
2070
2451
  * @param params.maxSqrtPriceChangeBps - The maximum sqrt price change in basis points
2071
2452
  * @param params.preInstructions - Instructions to run before the zap in
2072
- * @param params.swapTransactions - Swap transactions to execute
2453
+ * @param params.swapInstructions - Swap instructions to execute
2454
+ * @param params.addressLookupTableAccounts - Lookup tables used by the swap instructions
2073
2455
  * @param params.cleanUpInstructions - Instructions to run after the zap in
2074
- * @returns Response containing transaction components
2456
+ * @returns The ordered instructions and the lookup tables they use
2075
2457
  */
2076
- buildZapInDammV2Transaction(params: ZapInDammV2DirectPoolParam | ZapInDammV2IndirectPoolParam): Promise<ZapInDammV2Response>;
2458
+ buildZapInDammV2Transaction(params: ZapInDammV2DirectPoolParam | ZapInDammV2IndirectPoolParam): Promise<ZapInstructionsResponse>;
2077
2459
  /**
2078
2460
  * Get the parameters for building a DLMM zap in transaction through a direct route
2079
2461
  * Direct route means the input token matches either tokenX or tokenY in the pool
@@ -2087,8 +2469,8 @@ declare class Zap {
2087
2469
  * @param params.maxDeltaId - The bin delta relative to the active bin for the upper bin position
2088
2470
  * @param params.strategy - The liquidity distribution strategy
2089
2471
  * @param params.favorXInActiveId - Whether to favor token X in the active bin
2090
- * @param params.maxAccounts - The maximum number of accounts for the Jupiter swap query
2091
- * @param params.swapSlippageBps - The swap slippage tolerance in basis points
2472
+ * @param params.maxAccounts - Max accounts for the Jupiter swap query. Example value is `50`; this is not safe for every pool/size. Combined with Direct estimators (`onlyDirectRoutes=true`) this can select a much thinner route than Jupiter UI.
2473
+ * @param params.swapSlippageBps - Swap slippage vs the **quoted route**, not vs a fair input/output price. Validate `directSwapEstimate` / `outAmount` before send.
2092
2474
  * @param params.maxTransferAmountExtendPercentage - The percentage to extend the max transfer amount after the swap
2093
2475
  * @param params.maxActiveBinSlippage - The maximum active bin slippage
2094
2476
  * @param params.directSwapEstimate - The result from the direct swap estimate
@@ -2123,7 +2505,12 @@ declare class Zap {
2123
2505
  */
2124
2506
  getZapInDlmmIndirectParams(params: GetZapInDlmmIndirectParams): Promise<ZapInDlmmIndirectPoolParam>;
2125
2507
  /**
2126
- * Builds a DLMM zap-in transaction
2508
+ * Build the DLMM zap-in instructions
2509
+ *
2510
+ * Instructions are ordered: setup (token accounts, wrap SOL), swaps, ledger, zap in, clean up.
2511
+ * They must run in that order but can be split across several transactions, because state
2512
+ * between steps lives in accounts. Splitting loses atomicity, so send split transactions as a bundle.
2513
+ * No compute budget instructions are included; the client sets the compute budget for each transaction.
2127
2514
  *
2128
2515
  * @param params.user - The user's public key
2129
2516
  * @param params.lbPair - The DLMM pool's public key
@@ -2139,21 +2526,29 @@ declare class Zap {
2139
2526
  * @param params.favorXInActiveId - Whether to favor token X in the active bin
2140
2527
  * @param params.strategy - The liquidity distribution strategy
2141
2528
  * @param params.preInstructions - Instructions to run before the zap in
2142
- * @param params.swapTransactions - Swap transactions to execute
2529
+ * @param params.swapInstructions - Swap instructions to execute
2530
+ * @param params.addressLookupTableAccounts - Lookup tables used by the swap instructions
2143
2531
  * @param params.cleanUpInstructions - Instructions to run after the zap in
2144
2532
  * @param params.binArrays - The bin arrays required for the position
2145
2533
  * @param params.binArrayBitmapExtension - The bin array bitmap extension account if it exists
2146
2534
  * @param params.isDirectRoute - Whether this is a direct route
2147
2535
  * @param params.singleSided - Optional single-sided deposit mode (X or Y only) - default is non-single-sided
2148
- * @returns Response containing transaction components
2536
+ * @returns The ordered instructions and the lookup tables they use
2149
2537
  */
2150
2538
  buildZapInDlmmTransaction(params: (ZapInDlmmIndirectPoolParam | ZapInDlmmDirectPoolParam) & {
2151
2539
  position: PublicKey;
2152
- }): Promise<ZapInDlmmResponse>;
2540
+ }): Promise<ZapInstructionsResponse>;
2153
2541
  /**
2154
2542
  * High level method for DLMM position rebalancing
2155
2543
  * Consist of remove liquidity, zap out through Jupiter or DLMM, and zap back in to rebalance the position
2156
2544
  *
2545
+ * Instructions are ordered: setup (token accounts), init bin arrays, rebalance position, swap, ledger,
2546
+ * zap in, clean up. They must run in that order but can be split across several transactions.
2547
+ * Splitting loses atomicity, so send split transactions as a bundle.
2548
+ * No compute budget instructions are included. The zap-in instruction was measured at about 462k
2549
+ * compute units. Without a compute unit limit, a transaction gets 200k units per instruction (up to
2550
+ * 1.4M), which may not cover it, so set a compute unit limit on the transaction that holds it.
2551
+ *
2157
2552
  * @param params - Rebalancing DLMM position parameters
2158
2553
  * @param params.lbPairAddress - The DLMM pool address
2159
2554
  * @param params.positionAddress - The position address
@@ -2166,7 +2561,7 @@ declare class Zap {
2166
2561
  * @param params.favorXInActiveId - Whether to favor token X in the active bin
2167
2562
  * @param params.directSwapEstimate - The estimate of the direct swap operation
2168
2563
  * @param params.maxAccounts - The maximum number of accounts to use for the swap operation
2169
- * @returns Response containing transactions and estimation details
2564
+ * @returns The ordered instructions, the lookup tables they use, and the estimated balances
2170
2565
  * @throws if fail to get jupiter quote or jupiter swap instruction
2171
2566
  */
2172
2567
  rebalanceDlmmPosition(params: RebalanceDlmmPositionParams): Promise<RebalanceDlmmPositionResponse>;
@@ -2180,9 +2575,9 @@ declare class Zap {
2180
2575
  * @param params.ammProgram - AMM program ID to interact with
2181
2576
  * @param params.preInstructions - Instructions to run before the zap out
2182
2577
  * @param params.postInstructions - Instructions to run after the zap out
2183
- * @returns builder transaction
2578
+ * @returns The pre-instructions, the zap out instruction and the post-instructions in order, with no lookup tables
2184
2579
  */
2185
- zapOut(params: ZapOutParams): Promise<Transaction>;
2580
+ zapOut(params: ZapOutParams): Promise<ZapInstructionsResponse>;
2186
2581
  /**
2187
2582
  * Performs a token swap using Jupiter V6 protocol as part of a zap out operation.
2188
2583
  * Swaps tokens from the input token ledger to the user's output token account.
@@ -2191,14 +2586,14 @@ declare class Zap {
2191
2586
  * @param params.user - Public key of the user performing the swap
2192
2587
  * @param params.inputMint - Token mint being swapped from
2193
2588
  * @param params.outputMint - Token mint being swapped to
2194
- * @param params.jupiterSwapResponse - Jupiter swap instruction response
2589
+ * @param params.jupiterSwapResponse - Jupiter swap instruction response. Its lookup table fields, when present, are returned as `addressLookupTableAccounts` (v1 tables are fetched with one RPC call)
2195
2590
  * @param params.inputTokenProgram - Token program for the input token (defaults to SPL Token)
2196
2591
  * @param params.outputTokenProgram - Token program for the output token (defaults to SPL Token)
2197
2592
  * @param params.maxSwapAmount - Maximum amount of input token to swap
2198
2593
  * @param params.percentageToZapOut - Percentage of input token to zap out
2199
- * @returns built transaction
2594
+ * @returns The ordered instructions and the lookup tables of the Jupiter swap
2200
2595
  */
2201
- zapOutThroughJupiter(params: ZapOutThroughJupiterParams): Promise<Transaction>;
2596
+ zapOutThroughJupiter(params: ZapOutThroughJupiterParams): Promise<ZapInstructionsResponse>;
2202
2597
  /**
2203
2598
  * Performs a token swap using Damms V2 protocol as part of a zap out operation.
2204
2599
  * Swaps tokens from the input token ledger to the user's output token account.
@@ -2212,8 +2607,9 @@ declare class Zap {
2212
2607
  * @param params.minimumSwapAmountOut - Minimum amount of output token to receive
2213
2608
  * @param params.maxSwapAmount - Maximum amount of input token to swap
2214
2609
  * @param params.percentageToZapOut - Percentage of input token to zap out
2610
+ * @returns The ordered instructions, with no lookup tables
2215
2611
  */
2216
- zapOutThroughDammV2(params: ZapOutThroughDammV2Params): Promise<Transaction>;
2612
+ zapOutThroughDammV2(params: ZapOutThroughDammV2Params): Promise<ZapInstructionsResponse>;
2217
2613
  /**
2218
2614
  * Performs a token swap using Dlmm protocol as part of a zap out operation.
2219
2615
  * Swaps tokens from the input token ledger to the user's output token account.
@@ -2227,14 +2623,76 @@ declare class Zap {
2227
2623
  * @param params.minimumSwapAmountOut - Minimum amount of output token to receive
2228
2624
  * @param params.maxSwapAmount - Maximum amount of input token to swap
2229
2625
  * @param params.percentageToZapOut - Percentage of input token to zap out
2626
+ * @returns The ordered instructions, with no lookup tables
2230
2627
  */
2231
- zapOutThroughDlmm(params: ZapOutThroughDlmmParams): Promise<Transaction>;
2628
+ zapOutThroughDlmm(params: ZapOutThroughDlmmParams): Promise<ZapInstructionsResponse>;
2232
2629
  }
2233
2630
 
2234
- declare function getJupiterQuote(inputMint: PublicKey, outputMint: PublicKey, amount: BN, maxAccounts: number, slippageBps: number, dynamicSlippage: boolean | undefined, onlyDirectRoutes: boolean, restrictIntermediateTokens: boolean, config?: ZapConfig): Promise<JupiterQuoteResponse | null>;
2235
- declare function getJupiterSwapInstruction(userPublicKey: PublicKey, quoteResponse: any, config?: ZapConfig): Promise<JupiterSwapInstructionResponse>;
2236
- declare function buildJupiterSwapTransaction(user: PublicKey, inputMint: PublicKey, outputMint: PublicKey, amount: BN, maxAccounts: number, slippageBps: number, jupiterQuoteResponse?: JupiterQuoteResponse, config?: ZapConfig): Promise<{
2237
- transaction: Transaction;
2631
+ declare function resolveJupiterConfig(config?: ZapConfig): {
2632
+ url: string;
2633
+ apiKey: string;
2634
+ version: JupiterApiVersion;
2635
+ };
2636
+ declare function getJupiterInstructionLayout(data: Buffer): JupiterInstructionLayout;
2637
+ declare function isJupiterBuildResponse(quoteResponse: JupiterQuoteResponse): quoteResponse is JupiterBuildResponse;
2638
+ /**
2639
+ * Whether the swap instruction was built for `user`, i.e. `user` is its user transfer authority.
2640
+ * Throws for an unknown Jupiter instruction discriminator.
2641
+ */
2642
+ declare function isJupiterSwapInstructionForUser(swapInstruction: JupiterInstruction, user: PublicKey): boolean;
2643
+ /**
2644
+ * Get a Jupiter quote.
2645
+ * - v1: `GET /swap/v1/quote`, returns the quote only.
2646
+ * - v2: `GET /swap/v2/build`, returns the quote together with the swap instructions built for `params.user`
2647
+ * (a `JupiterBuildResponse`), so no second request is needed for the swap.
2648
+ * Returns null when the request fails.
2649
+ *
2650
+ * `maxAccounts` and the options in `JupiterQuoteOptions` are forwarded to Jupiter as-is. They can
2651
+ * give a much thinner route than a Jupiter UI quote, because the UI does not set them.
2652
+ * `slippageBps` only bounds execution against this quote. It does not mean `outAmount` is a fair
2653
+ * price for the input size, so validate the output, price impact or simulated token balance
2654
+ * changes before sending.
2655
+ * @see https://developers.jup.ag/docs/resources/support#customer-support
2656
+ */
2657
+ declare function getJupiterQuote(params: GetJupiterQuoteParams, config?: ZapConfig): Promise<JupiterQuoteResponse | null>;
2658
+ /**
2659
+ * Get the Jupiter swap instructions for a quote.
2660
+ * - v1: `POST /swap/v1/swap-instructions`.
2661
+ * - v2: returns `quoteResponse` as is. It must be a `GET /swap/v2/build` response built for `userPublicKey`,
2662
+ * so the executed swap is the quoted one.
2663
+ * Throws when the request fails, or under v2 when `quoteResponse` has no swap instructions built for `userPublicKey`.
2664
+ */
2665
+ declare function getJupiterSwapInstruction(userPublicKey: PublicKey, quoteResponse: JupiterQuoteResponse, config?: ZapConfig): Promise<JupiterSwapInstructions>;
2666
+ /**
2667
+ * Build lookup table accounts from Jupiter v2's `addressesByLookupTableAddress` without an RPC call.
2668
+ * Only `key` and `state.addresses` are real. The other state fields are placeholders, because
2669
+ * `compileToV0Message` does not read them, so `isActive()` on the result does not reflect the chain.
2670
+ */
2671
+ declare function toAddressLookupTableAccounts(addressesByLookupTableAddress: Record<string, string[]> | null): AddressLookupTableAccount[];
2672
+ /**
2673
+ * Fetch lookup table accounts by address with one RPC call. Used for Jupiter v1, which returns
2674
+ * only `addressLookupTableAddresses`.
2675
+ * Throws when a table does not exist or is not owned by the address lookup table program.
2676
+ */
2677
+ declare function fetchAddressLookupTableAccounts(connection: Connection, addresses: string[]): Promise<AddressLookupTableAccount[]>;
2678
+ /** Merge lookup table lists, keeping the first occurrence of each table key. */
2679
+ declare function mergeAddressLookupTableAccounts(...lists: AddressLookupTableAccount[][]): AddressLookupTableAccount[];
2680
+ /**
2681
+ * Resolve the lookup tables a Jupiter swap instruction needs.
2682
+ * - v2 (`addressesByLookupTableAddress`): built from the response, no RPC call.
2683
+ * - v1 (`addressLookupTableAddresses` only): fetched with one RPC call.
2684
+ * Returns an empty array when the response carries neither.
2685
+ */
2686
+ declare function getJupiterAddressLookupTableAccounts(connection: Connection, response: JupiterAddressLookupTableFields): Promise<AddressLookupTableAccount[]>;
2687
+ /**
2688
+ * Get the Jupiter swap instruction for swapping `amount` of `inputMint` to `outputMint`, and the lookup tables it uses.
2689
+ * When `jupiterQuoteResponse` is given it is executed as is, and it must be a quote for `amount` by `user`.
2690
+ * Otherwise a new quote is fetched with `maxAccounts`, `slippageBps` and `jupiterQuoteOptions`.
2691
+ * Throws when the quote does not match the swap, or when the quote, swap instruction or lookup tables cannot be fetched.
2692
+ */
2693
+ declare function buildJupiterSwapTransaction(connection: Connection, user: PublicKey, inputMint: PublicKey, outputMint: PublicKey, amount: BN, maxAccounts: number, slippageBps: number, jupiterQuoteResponse?: JupiterQuoteResponse, config?: ZapConfig, jupiterQuoteOptions?: JupiterQuoteOptions): Promise<{
2694
+ instruction: TransactionInstruction;
2695
+ addressLookupTableAccounts: AddressLookupTableAccount[];
2238
2696
  quoteResponse: JupiterQuoteResponse;
2239
2697
  }>;
2240
2698
 
@@ -2271,6 +2729,7 @@ declare function deriveDlmmEventAuthority(): PublicKey;
2271
2729
  declare function getTokenProgramFromMint(connection: Connection, mint: PublicKey): Promise<PublicKey>;
2272
2730
  declare function convertLamportsToUiAmount(amount: Decimal, decimals: number): Decimal;
2273
2731
  declare function convertUiAmountToLamports(amount: Decimal, decimals: number): Decimal;
2732
+ declare function filterOutComputeBudgetInstructions(instructions: TransactionInstruction[]): TransactionInstruction[];
2274
2733
 
2275
2734
  /**
2276
2735
  * Get or create a token account
@@ -2282,7 +2741,7 @@ declare function convertUiAmountToLamports(amount: Decimal, decimals: number): D
2282
2741
  * @param tokenProgram - The token program to use (defaults to TOKEN_PROGRAM_ID)
2283
2742
  * @returns The token account and the instruction to create it if it doesn't exist
2284
2743
  */
2285
- declare const getOrCreateATAInstruction: (connection: Connection, tokenMint: PublicKey, owner: PublicKey, payer: PublicKey, allowOwnerOffCurve: boolean | undefined, tokenProgram: PublicKey) => Promise<{
2744
+ declare const getOrCreateATAInstruction: (_connection: Connection, tokenMint: PublicKey, owner: PublicKey, payer: PublicKey, allowOwnerOffCurve: boolean | undefined, tokenProgram: PublicKey) => Promise<{
2286
2745
  ataPubkey: PublicKey;
2287
2746
  ix?: TransactionInstruction;
2288
2747
  }>;
@@ -2364,12 +2823,13 @@ declare function getExtraAccountMetasForTransferHook(connection: Connection, min
2364
2823
  * @param params.maxDeltaId - Maximum bin delta from active bin
2365
2824
  * @param params.strategy - Strategy type for the position
2366
2825
  * @param params.singleSided - Optional single-sided deposit mode (X or Y only) - default is non-single-sided
2826
+ * @param params.jupiterQuoteOptions - Optional Jupiter quote options, see `JupiterQuoteOptions`
2367
2827
  * @param params.config - Optional configuration for Jupiter API URL (default: https://api.jup.ag) and API key (default: empty string)
2368
2828
  * @returns IndirectSwapEstimate with swap details and post-swap token amounts
2369
2829
  * @throws if inputTokenMint matches any token in the DLMM pool
2370
2830
  * @throws if failed to get Jupiter swap quote
2371
2831
  */
2372
- declare function estimateDlmmIndirectSwap({ amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, config, }: EstimateDlmmIndirectSwapParams): Promise<DlmmIndirectSwapEstimate>;
2832
+ declare function estimateDlmmIndirectSwap({ user, amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, jupiterQuoteOptions, config, }: EstimateDlmmIndirectSwapParams): Promise<DlmmIndirectSwapEstimate>;
2373
2833
  /**
2374
2834
  * Calculate optimal swap amount for zap-in deposits (single token input)
2375
2835
  *
@@ -2386,11 +2846,12 @@ declare function estimateDlmmIndirectSwap({ amountIn, inputTokenMint, lbPair, co
2386
2846
  * @param params.maxDeltaId - Maximum bin delta from active bin
2387
2847
  * @param params.strategy - Strategy type for the position
2388
2848
  * @param params.singleSided - Optional single-sided deposit mode (X or Y only) - default is non-single-sided
2849
+ * @param params.jupiterQuoteOptions - Optional Jupiter quote options, see `JupiterQuoteOptions`
2389
2850
  * @param params.config - Optional configuration for Jupiter API URL (default: https://api.jup.ag) and API key (default: empty string)
2390
2851
  * @returns DirectSwapEstimate with swap details and post-swap token amounts
2391
2852
  * @throws if failed to get both Jupiter and DLMM swap quotes
2392
2853
  */
2393
- declare function estimateDlmmDirectSwap({ amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, config, }: EstimateDlmmDirectSwapParams): Promise<DlmmDirectSwapEstimate>;
2854
+ declare function estimateDlmmDirectSwap({ user, amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, jupiterQuoteOptions, config, }: EstimateDlmmDirectSwapParams): Promise<DlmmDirectSwapEstimate>;
2394
2855
  /**
2395
2856
  * Calculate optimal swap amount for rebalancing existing positions (both tokens)
2396
2857
  *
@@ -2405,11 +2866,12 @@ declare function estimateDlmmDirectSwap({ amountIn, inputTokenMint, lbPair, conn
2405
2866
  * @param params.minDeltaId - Minimum bin delta from active bin
2406
2867
  * @param params.maxDeltaId - Maximum bin delta from active bin
2407
2868
  * @param params.strategy - Strategy type for the position
2869
+ * @param params.jupiterQuoteOptions - Optional Jupiter quote options, see `JupiterQuoteOptions`
2408
2870
  * @param params.config - Optional configuration for Jupiter API URL (default: https://api.jup.ag) and API key (default: empty string)
2409
2871
  * @returns DirectSwapEstimate with swap details and post-swap token amounts
2410
2872
  * @throws if failed to get both Jupiter and DLMM swap quotes
2411
2873
  */
2412
- declare function estimateDlmmRebalanceSwap({ lbPair, position, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, config, }: EstimateDlmmRebalanceSwapParams): Promise<DlmmDirectRebalanceEstimate>;
2874
+ declare function estimateDlmmRebalanceSwap({ user, lbPair, position, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, jupiterQuoteOptions, config, }: EstimateDlmmRebalanceSwapParams): Promise<DlmmDirectRebalanceEstimate>;
2413
2875
 
2414
2876
  declare const ZAP_PROGRAM_ID: PublicKey;
2415
2877
  declare const JUP_V6_PROGRAM_ID: PublicKey;
@@ -2430,15 +2892,27 @@ declare const AccountsType: {
2430
2892
  };
2431
2893
  declare const DLMM_SWAP_DISCRIMINATOR: number[];
2432
2894
  declare const AMOUNT_IN_DLMM_OFFSET = 8;
2895
+ /**
2896
+ * @deprecated Use `getJupiterInstructionLayout` from helpers; the offset depends on the instruction variant.
2897
+ * Offset for amount_in in reverse order of jupiter Route instruction data:
2898
+ * amount_in(u64) + quoted_out_amount(64) + slippage_bps(u16) + platform_fee_bps(u8) = 19 bytes
2899
+ */
2433
2900
  declare const AMOUNT_IN_JUP_V6_REVERSE_OFFSET = 19;
2901
+ declare const JUP_V6_ROUTE_DISCRIMINATOR: number[];
2902
+ declare const JUP_V6_SHARED_ACCOUNTS_ROUTE_DISCRIMINATOR: number[];
2903
+ declare const JUP_V6_ROUTE_V2_DISCRIMINATOR: number[];
2904
+ declare const JUP_V6_SHARED_ACCOUNTS_ROUTE_V2_DISCRIMINATOR: number[];
2905
+ declare const JUPITER_INSTRUCTION_LAYOUTS: Record<string, JupiterInstructionLayout>;
2434
2906
  declare const AMOUNT_IN_DAMM_V2_OFFSET = 8;
2435
2907
  declare const DAMM_V2_SWAP_DISCRIMINATOR: number[];
2436
2908
  declare const DEFAULT_JUPITER_API_URL = "https://api.jup.ag";
2909
+ declare const DEFAULT_JUPITER_API_VERSION = JupiterApiVersion.V2;
2910
+ declare const DEFAULT_JUPITER_QUOTE_OPTIONS: Required<Omit<JupiterQuoteOptions, "additionalQueryParams">>;
2437
2911
 
2438
2912
  var address = "zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz";
2439
2913
  var metadata = {
2440
2914
  name: "zap",
2441
- version: "0.2.0",
2915
+ version: "0.2.3",
2442
2916
  spec: "0.1.0",
2443
2917
  description: "Created with Anchor"
2444
2918
  };
@@ -2998,32 +3472,6 @@ var instructions = [
2998
3472
  }
2999
3473
  ];
3000
3474
  var accounts = [
3001
- {
3002
- name: "LbPair",
3003
- discriminator: [
3004
- 33,
3005
- 11,
3006
- 49,
3007
- 98,
3008
- 181,
3009
- 101,
3010
- 177,
3011
- 13
3012
- ]
3013
- },
3014
- {
3015
- name: "Pool",
3016
- discriminator: [
3017
- 241,
3018
- 154,
3019
- 109,
3020
- 4,
3021
- 17,
3022
- 177,
3023
- 109,
3024
- 188
3025
- ]
3026
- },
3027
3475
  {
3028
3476
  name: "UserLedger",
3029
3477
  discriminator: [
@@ -3113,7 +3561,7 @@ var types = [
3113
3561
  }
3114
3562
  },
3115
3563
  {
3116
- name: "BaseFeeStruct",
3564
+ name: "BaseFeeInfo",
3117
3565
  serialization: "bytemuck",
3118
3566
  repr: {
3119
3567
  kind: "c"
@@ -3122,39 +3570,34 @@ var types = [
3122
3570
  kind: "struct",
3123
3571
  fields: [
3124
3572
  {
3125
- name: "cliff_fee_numerator",
3126
- type: "u64"
3127
- },
3128
- {
3129
- name: "base_fee_mode",
3130
- type: "u8"
3131
- },
3132
- {
3133
- name: "padding_0",
3573
+ name: "data",
3134
3574
  type: {
3135
3575
  array: [
3136
3576
  "u8",
3137
- 5
3577
+ 32
3138
3578
  ]
3139
3579
  }
3140
- },
3141
- {
3142
- name: "first_factor",
3143
- type: "u16"
3144
- },
3580
+ }
3581
+ ]
3582
+ }
3583
+ },
3584
+ {
3585
+ name: "BaseFeeStruct",
3586
+ serialization: "bytemuck",
3587
+ repr: {
3588
+ kind: "c"
3589
+ },
3590
+ type: {
3591
+ kind: "struct",
3592
+ fields: [
3145
3593
  {
3146
- name: "second_factor",
3594
+ name: "base_fee_info",
3147
3595
  type: {
3148
- array: [
3149
- "u8",
3150
- 8
3151
- ]
3596
+ defined: {
3597
+ name: "BaseFeeInfo"
3598
+ }
3152
3599
  }
3153
3600
  },
3154
- {
3155
- name: "third_factor",
3156
- type: "u64"
3157
- },
3158
3601
  {
3159
3602
  name: "padding_1",
3160
3603
  type: "u64"
@@ -3424,12 +3867,16 @@ var types = [
3424
3867
  name: "token_mint_y_program_flag",
3425
3868
  type: "u8"
3426
3869
  },
3870
+ {
3871
+ name: "version",
3872
+ type: "u8"
3873
+ },
3427
3874
  {
3428
3875
  name: "_reserved",
3429
3876
  type: {
3430
3877
  array: [
3431
3878
  "u8",
3432
- 22
3879
+ 21
3433
3880
  ]
3434
3881
  }
3435
3882
  }
@@ -3492,11 +3939,16 @@ var types = [
3492
3939
  type: "pubkey"
3493
3940
  },
3494
3941
  {
3495
- name: "partner",
3942
+ name: "padding_0",
3496
3943
  docs: [
3497
- "partner"
3944
+ "padding, previously partner pubkey, be careful when using this field"
3498
3945
  ],
3499
- type: "pubkey"
3946
+ type: {
3947
+ array: [
3948
+ "u8",
3949
+ 32
3950
+ ]
3951
+ }
3500
3952
  },
3501
3953
  {
3502
3954
  name: "liquidity",
@@ -3506,7 +3958,7 @@ var types = [
3506
3958
  type: "u128"
3507
3959
  },
3508
3960
  {
3509
- name: "_padding",
3961
+ name: "padding_1",
3510
3962
  docs: [
3511
3963
  "padding, previous reserve amount, be careful to use that field"
3512
3964
  ],
@@ -3527,18 +3979,8 @@ var types = [
3527
3979
  type: "u64"
3528
3980
  },
3529
3981
  {
3530
- name: "partner_a_fee",
3531
- docs: [
3532
- "partner a fee"
3533
- ],
3534
- type: "u64"
3535
- },
3536
- {
3537
- name: "partner_b_fee",
3538
- docs: [
3539
- "partner b fee"
3540
- ],
3541
- type: "u64"
3982
+ name: "padding_2",
3983
+ type: "u128"
3542
3984
  },
3543
3985
  {
3544
3986
  name: "sqrt_min_price",
@@ -3599,7 +4041,7 @@ var types = [
3599
4041
  {
3600
4042
  name: "collect_fee_mode",
3601
4043
  docs: [
3602
- "0 is collect fee in both token, 1 only collect fee in token a, 2 only collect fee in token b"
4044
+ "0 is collect fee in both token, 1 only collect fee only in token b"
3603
4045
  ],
3604
4046
  type: "u8"
3605
4047
  },
@@ -3611,14 +4053,14 @@ var types = [
3611
4053
  type: "u8"
3612
4054
  },
3613
4055
  {
3614
- name: "version",
4056
+ name: "fee_version",
3615
4057
  docs: [
3616
- "pool version, 0: max_fee is still capped at 50%, 1: max_fee is capped at 99%"
4058
+ "pool fee version, 0: max_fee is still capped at 50%, 1: max_fee is capped at 99%"
3617
4059
  ],
3618
4060
  type: "u8"
3619
4061
  },
3620
4062
  {
3621
- name: "_padding_0",
4063
+ name: "padding_3",
3622
4064
  docs: [
3623
4065
  "padding"
3624
4066
  ],
@@ -3671,14 +4113,47 @@ var types = [
3671
4113
  type: "pubkey"
3672
4114
  },
3673
4115
  {
3674
- name: "_padding_1",
4116
+ name: "token_a_amount",
4117
+ docs: [
4118
+ "token a amount"
4119
+ ],
4120
+ type: "u64"
4121
+ },
4122
+ {
4123
+ name: "token_b_amount",
4124
+ docs: [
4125
+ "token b amount"
4126
+ ],
4127
+ type: "u64"
4128
+ },
4129
+ {
4130
+ name: "layout_version",
4131
+ docs: [
4132
+ "layout version: version 0: haven't track token_a_amount and token_b_amount, version 1: track token_a_amount and token_b_amount"
4133
+ ],
4134
+ type: "u8"
4135
+ },
4136
+ {
4137
+ name: "padding_4",
4138
+ docs: [
4139
+ "Padding for further use"
4140
+ ],
4141
+ type: {
4142
+ array: [
4143
+ "u8",
4144
+ 7
4145
+ ]
4146
+ }
4147
+ },
4148
+ {
4149
+ name: "padding_5",
3675
4150
  docs: [
3676
4151
  "Padding for further use"
3677
4152
  ],
3678
4153
  type: {
3679
4154
  array: [
3680
4155
  "u64",
3681
- 6
4156
+ 3
3682
4157
  ]
3683
4158
  }
3684
4159
  },
@@ -3707,8 +4182,7 @@ var types = [
3707
4182
  "Information regarding fee charges",
3708
4183
  "trading_fee = amount * trade_fee_numerator / denominator",
3709
4184
  "protocol_fee = trading_fee * protocol_fee_percentage / 100",
3710
- "referral_fee = protocol_fee * referral_percentage / 100",
3711
- "partner_fee = (protocol_fee - referral_fee) * partner_fee_percentage / denominator"
4185
+ "referral_fee = protocol_fee * referral_percentage / 100"
3712
4186
  ],
3713
4187
  serialization: "bytemuck",
3714
4188
  repr: {
@@ -3741,9 +4215,9 @@ var types = [
3741
4215
  type: "u8"
3742
4216
  },
3743
4217
  {
3744
- name: "partner_fee_percent",
4218
+ name: "padding_0",
3745
4219
  docs: [
3746
- "partner fee"
4220
+ "padding for future use"
3747
4221
  ],
3748
4222
  type: "u8"
3749
4223
  },
@@ -3755,17 +4229,24 @@ var types = [
3755
4229
  type: "u8"
3756
4230
  },
3757
4231
  {
3758
- name: "padding_0",
4232
+ name: "padding_1",
3759
4233
  docs: [
3760
4234
  "padding"
3761
4235
  ],
3762
4236
  type: {
3763
4237
  array: [
3764
4238
  "u8",
3765
- 5
4239
+ 3
3766
4240
  ]
3767
4241
  }
3768
4242
  },
4243
+ {
4244
+ name: "compounding_fee_bps",
4245
+ docs: [
4246
+ "compounding fee bps, only non-zero in CollectFeeMode::Compounding"
4247
+ ],
4248
+ type: "u16"
4249
+ },
3769
4250
  {
3770
4251
  name: "dynamic_fee",
3771
4252
  docs: [
@@ -3778,16 +4259,8 @@ var types = [
3778
4259
  }
3779
4260
  },
3780
4261
  {
3781
- name: "padding_1",
3782
- docs: [
3783
- "padding"
3784
- ],
3785
- type: {
3786
- array: [
3787
- "u64",
3788
- 2
3789
- ]
3790
- }
4262
+ name: "init_sqrt_price",
4263
+ type: "u128"
3791
4264
  }
3792
4265
  ]
3793
4266
  }
@@ -3818,12 +4291,13 @@ var types = [
3818
4291
  type: "u64"
3819
4292
  },
3820
4293
  {
3821
- name: "total_partner_a_fee",
3822
- type: "u64"
3823
- },
3824
- {
3825
- name: "total_partner_b_fee",
3826
- type: "u64"
4294
+ name: "padding_0",
4295
+ type: {
4296
+ array: [
4297
+ "u64",
4298
+ 2
4299
+ ]
4300
+ }
3827
4301
  },
3828
4302
  {
3829
4303
  name: "total_position",
@@ -3946,12 +4420,20 @@ var types = [
3946
4420
  name: "base_fee_power_factor",
3947
4421
  type: "u8"
3948
4422
  },
4423
+ {
4424
+ name: "function_type",
4425
+ type: "u8"
4426
+ },
4427
+ {
4428
+ name: "collect_fee_mode",
4429
+ type: "u8"
4430
+ },
3949
4431
  {
3950
4432
  name: "_padding",
3951
4433
  type: {
3952
4434
  array: [
3953
4435
  "u8",
3954
- 5
4436
+ 3
3955
4437
  ]
3956
4438
  }
3957
4439
  }
@@ -4115,16 +4597,11 @@ var types = [
4115
4597
  }
4116
4598
  },
4117
4599
  {
4118
- name: "_padding_1",
4600
+ name: "dead_liquidity_reward_checkpoint",
4119
4601
  docs: [
4120
- "Padding to ensure `reward_rate: u128` is 16-byte aligned"
4602
+ "Cumulative dead-liquidity reward (Compounding Pool only)"
4121
4603
  ],
4122
- type: {
4123
- array: [
4124
- "u8",
4125
- 8
4126
- ]
4127
- }
4604
+ type: "u64"
4128
4605
  },
4129
4606
  {
4130
4607
  name: "mint",
@@ -4247,56 +4724,6 @@ var types = [
4247
4724
  }
4248
4725
  ];
4249
4726
  var constants = [
4250
- {
4251
- name: "DAMM_V2",
4252
- type: "pubkey",
4253
- value: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG"
4254
- },
4255
- {
4256
- name: "DAMM_V2_SWAP_DISC",
4257
- type: {
4258
- array: [
4259
- "u8",
4260
- 8
4261
- ]
4262
- },
4263
- value: "[248, 198, 158, 145, 225, 117, 135, 200]"
4264
- },
4265
- {
4266
- name: "DLMM_SWAP2_DISC",
4267
- type: {
4268
- array: [
4269
- "u8",
4270
- 8
4271
- ]
4272
- },
4273
- value: "[65, 75, 63, 76, 235, 91, 91, 136]"
4274
- },
4275
- {
4276
- name: "JUP_V6",
4277
- type: "pubkey",
4278
- value: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"
4279
- },
4280
- {
4281
- name: "JUP_V6_ROUTE_DISC",
4282
- type: {
4283
- array: [
4284
- "u8",
4285
- 8
4286
- ]
4287
- },
4288
- value: "[229, 23, 203, 151, 122, 227, 173, 42]"
4289
- },
4290
- {
4291
- name: "JUP_V6_SHARED_ACCOUNT_ROUTE_DISC",
4292
- type: {
4293
- array: [
4294
- "u8",
4295
- 8
4296
- ]
4297
- },
4298
- value: "[193, 32, 155, 51, 65, 214, 156, 129]"
4299
- },
4300
4727
  {
4301
4728
  name: "MAX_BASIS_POINT",
4302
4729
  type: "u16",
@@ -4318,4 +4745,4 @@ var idl = {
4318
4745
  constants: constants
4319
4746
  };
4320
4747
 
4321
- export { AMOUNT_IN_DAMM_V2_OFFSET, AMOUNT_IN_DLMM_OFFSET, AMOUNT_IN_JUP_V6_REVERSE_OFFSET, AccountsType, BIN_ARRAY_INDEX_BOUND, DAMM_V2_PROGRAM_ID, DAMM_V2_SWAP_DISCRIMINATOR, DEFAULT_JUPITER_API_URL, DLMM_PROGRAM_ID, DLMM_SWAP_DISCRIMINATOR, type DlmmDirectEstimateResult, type DlmmDirectRebalanceEstimate, type DlmmDirectRebalanceEstimateContext, type DlmmDirectSwapEstimate, type DlmmDirectSwapEstimateContext, DlmmDirectSwapQuoteRoute, type DlmmIndirectSwapEstimate, type DlmmIndirectSwapEstimateContext, type DlmmIndirectSwapEstimateResult, DlmmSingleSided, DlmmSwapType, type EstimateDlmmDirectSwapParams, type EstimateDlmmIndirectSwapParams, type EstimateDlmmRebalanceSwapParams, type GetZapInDammV2DirectPoolParams, type GetZapInDammV2IndirectPoolParams, type GetZapInDlmmDirectParams, type GetZapInDlmmIndirectParams, JUP_V6_PROGRAM_ID, type JupiterInstruction, type JupiterQuoteResponse, type JupiterRoutePlan, type JupiterSwapInstructionResponse, MEMO_PROGRAM_ID, type ProgramStrategyType, type RebalanceDlmmPositionParams, type RebalanceDlmmPositionResponse, SwapExternalType, type SwapQuoteResult, ZAP_PROGRAM_ID, Zap, type ZapConfig, idl as ZapIdl, type ZapInDammV2DirectPoolParam, type ZapInDammV2IndirectPoolParam, ZapInDammV2PoolSwapRoute, type ZapInDammV2Response, type ZapInDlmmDirectPoolParam, type ZapInDlmmIndirectPoolParam, type ZapInDlmmResponse, type ZapOutParameters, type ZapOutParams, type ZapOutThroughDammV2Params, type ZapOutThroughDlmmParams, type ZapOutThroughJupiterParams, type ZapProgram, type Zap$1 as ZapTypes, buildJupiterSwapTransaction, convertAccountTypeToNumber, convertLamportsToUiAmount, convertUiAmountToLamports, createDammV2SwapPayload, createDlmmSwapPayload, deriveDammV2EventAuthority, deriveDammV2PoolAuthority, deriveDlmmEventAuthority, deriveLedgerAccount, estimateDlmmDirectSwap, estimateDlmmIndirectSwap, estimateDlmmRebalanceSwap, filterOutCloseSplTokenAccountInstructions, getBinArrayBitmapExtension, getBitFromBinArrayIndexInBitmapExtension, getDammV2Pool, getDammV2RemainingAccounts, getDlmmRemainingAccounts, getExtraAccountMetasForTransferHook, getJupiterQuote, getJupiterSwapInstruction, getLbPairState, getNextBinArrayIndexWithLiquidity, getOrCreateATAInstruction, getTokenAccountBalance, getTokenProgramFromMint, isSingleSidedA, isSingleSidedB, toProgramStrategyType, unwrapSOLInstruction, wrapSOLInstruction };
4748
+ export { AMOUNT_IN_DAMM_V2_OFFSET, AMOUNT_IN_DLMM_OFFSET, AMOUNT_IN_JUP_V6_REVERSE_OFFSET, AccountsType, BIN_ARRAY_INDEX_BOUND, DAMM_V2_PROGRAM_ID, DAMM_V2_SWAP_DISCRIMINATOR, DEFAULT_JUPITER_API_URL, DEFAULT_JUPITER_API_VERSION, DEFAULT_JUPITER_QUOTE_OPTIONS, DLMM_PROGRAM_ID, DLMM_SWAP_DISCRIMINATOR, type DlmmDirectEstimateResult, type DlmmDirectRebalanceEstimate, type DlmmDirectRebalanceEstimateContext, type DlmmDirectSwapEstimate, type DlmmDirectSwapEstimateContext, DlmmDirectSwapQuoteRoute, type DlmmIndirectSwapEstimate, type DlmmIndirectSwapEstimateContext, type DlmmIndirectSwapEstimateResult, DlmmSingleSided, DlmmSwapType, type EstimateDlmmDirectSwapParams, type EstimateDlmmIndirectSwapParams, type EstimateDlmmRebalanceSwapParams, type GetJupAndDammV2QuotesParams, type GetJupiterQuoteParams, type GetZapInDammV2DirectPoolParams, type GetZapInDammV2IndirectPoolParams, type GetZapInDlmmDirectParams, type GetZapInDlmmIndirectParams, JUPITER_INSTRUCTION_LAYOUTS, JUP_V6_PROGRAM_ID, JUP_V6_ROUTE_DISCRIMINATOR, JUP_V6_ROUTE_V2_DISCRIMINATOR, JUP_V6_SHARED_ACCOUNTS_ROUTE_DISCRIMINATOR, JUP_V6_SHARED_ACCOUNTS_ROUTE_V2_DISCRIMINATOR, type JupiterAddressLookupTableFields, JupiterApiVersion, type JupiterBlockhashWithMetadata, type JupiterBuildResponse, type JupiterInstruction, type JupiterInstructionLayout, type JupiterQuoteOptions, type JupiterQuoteResponse, type JupiterRoutePlan, type JupiterSwapInstructionResponse, type JupiterSwapInstructions, MEMO_PROGRAM_ID, type ProgramStrategyType, type RebalanceDlmmPositionParams, type RebalanceDlmmPositionResponse, SwapExternalType, type SwapQuoteResult, ZAP_PROGRAM_ID, Zap, type ZapConfig, idl as ZapIdl, type ZapInDammV2DirectPoolParam, type ZapInDammV2IndirectPoolParam, ZapInDammV2PoolSwapRoute, type ZapInDlmmDirectPoolParam, type ZapInDlmmIndirectPoolParam, type ZapInstructionsResponse, type ZapOutParameters, type ZapOutParams, type ZapOutThroughDammV2Params, type ZapOutThroughDlmmParams, type ZapOutThroughJupiterParams, type ZapProgram, type Zap$1 as ZapTypes, buildJupiterSwapTransaction, convertAccountTypeToNumber, convertLamportsToUiAmount, convertUiAmountToLamports, createDammV2SwapPayload, createDlmmSwapPayload, deriveDammV2EventAuthority, deriveDammV2PoolAuthority, deriveDlmmEventAuthority, deriveLedgerAccount, estimateDlmmDirectSwap, estimateDlmmIndirectSwap, estimateDlmmRebalanceSwap, fetchAddressLookupTableAccounts, filterOutCloseSplTokenAccountInstructions, filterOutComputeBudgetInstructions, getBinArrayBitmapExtension, getBitFromBinArrayIndexInBitmapExtension, getDammV2Pool, getDammV2RemainingAccounts, getDlmmRemainingAccounts, getExtraAccountMetasForTransferHook, getJupiterAddressLookupTableAccounts, getJupiterInstructionLayout, getJupiterQuote, getJupiterSwapInstruction, getLbPairState, getNextBinArrayIndexWithLiquidity, getOrCreateATAInstruction, getTokenAccountBalance, getTokenProgramFromMint, isJupiterBuildResponse, isJupiterSwapInstructionForUser, isSingleSidedA, isSingleSidedB, mergeAddressLookupTableAccounts, resolveJupiterConfig, toAddressLookupTableAccounts, toProgramStrategyType, unwrapSOLInstruction, wrapSOLInstruction };