@meteora-ag/zap-sdk 1.3.2 → 2.0.0-rc.1

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.ts 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,47 @@ interface ZapOutThroughJupiterParams {
1604
1892
  outputMint: PublicKey;
1605
1893
  inputTokenProgram: PublicKey;
1606
1894
  outputTokenProgram: PublicKey;
1607
- jupiterSwapResponse: JupiterSwapInstructionResponse;
1895
+ /** Its `setupInstructions`, when present, add the token accounts the swap needs that the zap does not create. */
1896
+ jupiterSwapResponse: Pick<JupiterSwapInstructionResponse, "swapInstruction"> & Partial<Pick<JupiterSwapInstructions, "setupInstructions">> & JupiterAddressLookupTableFields;
1608
1897
  maxSwapAmount: BN;
1609
1898
  percentageToZapOut: number;
1610
1899
  }
1900
+ /** Jupiter query parameter values. The SDK converts each value to a string. */
1901
+ type JupiterQueryParams = Record<string, string | number | boolean>;
1902
+ type GetJupiterQuoteParams = {
1903
+ inputMint: PublicKey;
1904
+ outputMint: PublicKey;
1905
+ amount: BN;
1906
+ /** Wallet the swap is built for. Sent as `taker` under v2, unused under v1. */
1907
+ user: PublicKey;
1908
+ /**
1909
+ * Any other Jupiter query parameter, such as `slippageBps` or `maxAccounts`. The SDK forwards them
1910
+ * to Jupiter as-is and sends nothing else, so Jupiter uses its own default for every parameter not
1911
+ * given here. `inputMint`, `outputMint`, `amount` and, under v2, `taker` always come from the fields
1912
+ * above, even when they are also given here.
1913
+ * Jupiter's API docs are the source of truth for the accepted parameters:
1914
+ * - v1 `GET /swap/v1/quote`: https://developers.jup.ag/docs/api-reference/swap/v1/quote
1915
+ * - v2 `GET /swap/v2/build`: https://developers.jup.ag/docs/api-reference/swap/build
1916
+ */
1917
+ queryParams?: JupiterQueryParams;
1918
+ };
1919
+ type GetJupAndDammV2QuotesParams = {
1920
+ connection: Connection;
1921
+ user: PublicKey;
1922
+ inputTokenMint: PublicKey;
1923
+ poolState: PoolState;
1924
+ tokenADecimal: number;
1925
+ tokenBDecimal: number;
1926
+ dammV2SlippageBps: number;
1927
+ jupSlippageBps: number;
1928
+ /**
1929
+ * Jupiter query parameters for the quotes this helper requests, see `GetJupiterQuoteParams.queryParams`.
1930
+ * The helper sends its slippage argument as `slippageBps`, and these parameters override it.
1931
+ */
1932
+ jupiterQuoteOptions?: JupiterQueryParams;
1933
+ config?: ZapConfig;
1934
+ };
1935
+ /** Quote fields shared by v1 `/quote` and v2 `/build` responses. */
1611
1936
  interface JupiterQuoteResponse {
1612
1937
  inputMint: string;
1613
1938
  inAmount: string;
@@ -1616,19 +1941,28 @@ interface JupiterQuoteResponse {
1616
1941
  otherAmountThreshold: string;
1617
1942
  swapMode: string;
1618
1943
  slippageBps: number;
1619
- platformFee: any;
1620
1944
  priceImpactPct: string;
1621
1945
  routePlan: JupiterRoutePlan[];
1622
- contextSlot: number;
1623
- timeTaken: number;
1624
- swapUsdValue: string;
1625
- simplerRouteUsed: boolean;
1626
- mostReliableAmmsQuoteReport: {
1946
+ /** @deprecated v1 only */
1947
+ platformFee?: any;
1948
+ /** @deprecated v1 only */
1949
+ contextSlot?: number;
1950
+ /** @deprecated v1 only */
1951
+ timeTaken?: number;
1952
+ /** @deprecated v1 only */
1953
+ swapUsdValue?: string;
1954
+ /** @deprecated v1 only */
1955
+ simplerRouteUsed?: boolean;
1956
+ /** @deprecated v1 only */
1957
+ mostReliableAmmsQuoteReport?: {
1627
1958
  info: Record<string, string>;
1628
1959
  };
1629
- useIncurredSlippageForQuoting: any;
1630
- otherRoutePlans: any;
1631
- aggregatorVersion: any;
1960
+ /** @deprecated v1 only */
1961
+ useIncurredSlippageForQuoting?: any;
1962
+ /** @deprecated v1 only */
1963
+ otherRoutePlans?: any;
1964
+ /** @deprecated v1 only */
1965
+ aggregatorVersion?: any;
1632
1966
  }
1633
1967
  interface JupiterRoutePlan {
1634
1968
  swapInfo: any;
@@ -1640,6 +1974,39 @@ interface JupiterInstruction {
1640
1974
  accounts: any[];
1641
1975
  data: string;
1642
1976
  }
1977
+ interface JupiterInstructionLayout {
1978
+ /** Byte offset of amount_in (u64 LE) inside the instruction data */
1979
+ amountInOffset: (dataLength: number) => number;
1980
+ /** Index of the user transfer authority in the instruction accounts */
1981
+ userTransferAuthorityIndex: number;
1982
+ }
1983
+ interface JupiterBlockhashWithMetadata {
1984
+ blockhash: number[];
1985
+ lastValidBlockHeight: number;
1986
+ fetchedAt: {
1987
+ secs_since_epoch: number;
1988
+ nanos_since_epoch: number;
1989
+ };
1990
+ }
1991
+ /** Instruction fields shared by v1 `/swap-instructions` and v2 `/build` responses. */
1992
+ interface JupiterSwapInstructions {
1993
+ computeBudgetInstructions: JupiterInstruction[];
1994
+ setupInstructions: JupiterInstruction[];
1995
+ swapInstruction: JupiterInstruction;
1996
+ cleanupInstruction: JupiterInstruction | null;
1997
+ otherInstructions: JupiterInstruction[];
1998
+ tipInstruction?: JupiterInstruction | null;
1999
+ addressesByLookupTableAddress: Record<string, string[]> | null;
2000
+ blockhashWithMetadata: JupiterBlockhashWithMetadata;
2001
+ }
2002
+ /** Lookup table fields of a Jupiter swap instructions response: v2 returns the map, v1 returns only the table addresses. */
2003
+ type JupiterAddressLookupTableFields = {
2004
+ addressesByLookupTableAddress?: Record<string, string[]> | null;
2005
+ addressLookupTableAddresses?: string[];
2006
+ };
2007
+ /** Response of v2 `GET /swap/v2/build`: quote and instructions in one object. */
2008
+ type JupiterBuildResponse = JupiterQuoteResponse & JupiterSwapInstructions;
2009
+ /** @deprecated v1 `POST /swap/v1/swap-instructions` response. Use `JupiterBuildResponse` / `JupiterSwapInstructions`. */
1643
2010
  interface JupiterSwapInstructionResponse {
1644
2011
  tokenLedgerInstruction: JupiterInstruction | null;
1645
2012
  computeBudgetInstructions: JupiterInstruction[];
@@ -1678,7 +2045,6 @@ type GetZapInDammV2DirectPoolParams = {
1678
2045
  positionNftMint: PublicKey;
1679
2046
  maxSqrtPriceChangeBps: number;
1680
2047
  maxTransferAmountExtendPercentage: number;
1681
- maxAccounts: number;
1682
2048
  slippageBps: number;
1683
2049
  dammV2Quote: {
1684
2050
  swapInAmount: BN;
@@ -1689,6 +2055,11 @@ type GetZapInDammV2DirectPoolParams = {
1689
2055
  priceImpact: Decimal;
1690
2056
  } | null;
1691
2057
  jupiterQuote: JupiterQuoteResponse | null;
2058
+ /**
2059
+ * Jupiter query parameters for the quotes this helper requests, see `GetJupiterQuoteParams.queryParams`.
2060
+ * The helper sends its slippage argument as `slippageBps`, and these parameters override it.
2061
+ */
2062
+ jupiterQuoteOptions?: JupiterQueryParams;
1692
2063
  };
1693
2064
  type GetZapInDammV2IndirectPoolParams = {
1694
2065
  user: PublicKey;
@@ -1698,10 +2069,14 @@ type GetZapInDammV2IndirectPoolParams = {
1698
2069
  positionNftMint: PublicKey;
1699
2070
  maxSqrtPriceChangeBps: number;
1700
2071
  maxTransferAmountExtendPercentage: number;
1701
- maxAccounts: number;
1702
2072
  slippageBps: number;
1703
2073
  jupiterQuoteToA: JupiterQuoteResponse | null;
1704
2074
  jupiterQuoteToB: JupiterQuoteResponse | null;
2075
+ /**
2076
+ * Jupiter query parameters for the quotes this helper requests, see `GetJupiterQuoteParams.queryParams`.
2077
+ * The helper sends its slippage argument as `slippageBps`, and these parameters override it.
2078
+ */
2079
+ jupiterQuoteOptions?: JupiterQueryParams;
1705
2080
  };
1706
2081
  declare enum ZapInDammV2PoolSwapRoute {
1707
2082
  Jupiter = "jupiter",
@@ -1724,7 +2099,8 @@ type ZapInDammV2DirectPoolParam = {
1724
2099
  maxSqrtPriceChangeBps: number;
1725
2100
  amount: BN;
1726
2101
  preInstructions: TransactionInstruction[];
1727
- swapTransactions: Transaction[];
2102
+ swapInstructions: TransactionInstruction[];
2103
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1728
2104
  cleanUpInstructions: TransactionInstruction[];
1729
2105
  isTokenA?: boolean;
1730
2106
  swapInEstimate: {
@@ -1748,12 +2124,14 @@ type ZapInDammV2IndirectPoolParam = Omit<ZapInDammV2DirectPoolParam, "maxTransfe
1748
2124
  routeB: ZapInDammV2PoolSwapRoute;
1749
2125
  };
1750
2126
  };
1751
- type ZapInDammV2Response = {
1752
- setupTransaction?: Transaction;
1753
- swapTransactions: Transaction[];
1754
- ledgerTransaction: Transaction;
1755
- zapInTransaction: Transaction;
1756
- cleanUpTransaction: Transaction;
2127
+ /**
2128
+ * Output of every Zap method that builds on-chain work. `instructions` must run in order but may be
2129
+ * split across transactions; `addressLookupTableAccounts` lets the client compile v0 transactions.
2130
+ */
2131
+ type ZapInstructionsResponse = {
2132
+ instructions: TransactionInstruction[];
2133
+ /** Lookup tables used by the instructions, each table once. Empty when no Jupiter swap is involved. */
2134
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1757
2135
  };
1758
2136
  declare enum DlmmDirectSwapQuoteRoute {
1759
2137
  Jupiter = 0,
@@ -1780,6 +2158,8 @@ declare enum DlmmSingleSided {
1780
2158
  Y = 1
1781
2159
  }
1782
2160
  interface EstimateDlmmDirectSwapParams {
2161
+ /** Wallet the swap is built for. Sent as Jupiter `taker` under v2. */
2162
+ user: PublicKey;
1783
2163
  amountIn: BN;
1784
2164
  inputTokenMint: PublicKey;
1785
2165
  lbPair: PublicKey;
@@ -1789,6 +2169,11 @@ interface EstimateDlmmDirectSwapParams {
1789
2169
  maxDeltaId: number;
1790
2170
  strategy: StrategyType;
1791
2171
  singleSided?: DlmmSingleSided;
2172
+ /**
2173
+ * Jupiter query parameters for the quotes this helper requests, see `GetJupiterQuoteParams.queryParams`.
2174
+ * The helper sends its slippage argument as `slippageBps`, and these parameters override it.
2175
+ */
2176
+ jupiterQuoteOptions?: JupiterQueryParams;
1792
2177
  config?: ZapConfig;
1793
2178
  }
1794
2179
  interface DlmmDirectSwapEstimateContext {
@@ -1814,6 +2199,8 @@ interface DlmmDirectSwapEstimate {
1814
2199
  context: DlmmDirectSwapEstimateContext;
1815
2200
  }
1816
2201
  interface EstimateDlmmRebalanceSwapParams {
2202
+ /** Wallet the swap is built for. Sent as Jupiter `taker` under v2. */
2203
+ user: PublicKey;
1817
2204
  position: PublicKey;
1818
2205
  lbPair: PublicKey;
1819
2206
  connection: Connection;
@@ -1821,6 +2208,11 @@ interface EstimateDlmmRebalanceSwapParams {
1821
2208
  maxDeltaId: number;
1822
2209
  swapSlippageBps: number;
1823
2210
  strategy: StrategyType;
2211
+ /**
2212
+ * Jupiter query parameters for the quotes this helper requests, see `GetJupiterQuoteParams.queryParams`.
2213
+ * The helper sends its slippage argument as `slippageBps`, and these parameters override it.
2214
+ */
2215
+ jupiterQuoteOptions?: JupiterQueryParams;
1824
2216
  config?: ZapConfig;
1825
2217
  }
1826
2218
  interface DlmmDirectRebalanceEstimateContext {
@@ -1837,6 +2229,8 @@ interface DlmmDirectRebalanceEstimate {
1837
2229
  context: DlmmDirectRebalanceEstimateContext;
1838
2230
  }
1839
2231
  interface EstimateDlmmIndirectSwapParams {
2232
+ /** Wallet the swap is built for. Sent as Jupiter `taker` under v2. */
2233
+ user: PublicKey;
1840
2234
  amountIn: BN;
1841
2235
  inputTokenMint: PublicKey;
1842
2236
  lbPair: PublicKey;
@@ -1846,6 +2240,11 @@ interface EstimateDlmmIndirectSwapParams {
1846
2240
  maxDeltaId: number;
1847
2241
  strategy: StrategyType;
1848
2242
  singleSided?: DlmmSingleSided;
2243
+ /**
2244
+ * Jupiter query parameters for the quotes this helper requests, see `GetJupiterQuoteParams.queryParams`.
2245
+ * The helper sends its slippage argument as `slippageBps`, and these parameters override it.
2246
+ */
2247
+ jupiterQuoteOptions?: JupiterQueryParams;
1849
2248
  config?: ZapConfig;
1850
2249
  }
1851
2250
  interface DlmmIndirectSwapEstimateResult {
@@ -1881,16 +2280,8 @@ interface RebalanceDlmmPositionParams {
1881
2280
  strategy: StrategyType;
1882
2281
  favorXInActiveId: boolean;
1883
2282
  directSwapEstimate: DlmmDirectEstimateResult;
1884
- maxAccounts?: number;
1885
2283
  }
1886
- interface RebalanceDlmmPositionResponse {
1887
- setupTransaction?: Transaction;
1888
- initBinArrayTransaction?: Transaction;
1889
- rebalancePositionTransaction?: Transaction;
1890
- swapTransaction?: Transaction;
1891
- ledgerTransaction: Transaction;
1892
- zapInTransaction: Transaction;
1893
- cleanUpTransaction: Transaction;
2284
+ interface RebalanceDlmmPositionResponse extends ZapInstructionsResponse {
1894
2285
  estimation: {
1895
2286
  currentBalances: {
1896
2287
  tokenX: BN;
@@ -1912,7 +2303,6 @@ interface GetZapInDlmmIndirectParams {
1912
2303
  maxDeltaId: number;
1913
2304
  strategy: StrategyType;
1914
2305
  favorXInActiveId: boolean;
1915
- maxAccounts: number;
1916
2306
  swapSlippageBps: number;
1917
2307
  maxTransferAmountExtendPercentage: number;
1918
2308
  indirectSwapEstimate: DlmmIndirectSwapEstimateResult;
@@ -1928,7 +2318,6 @@ interface GetZapInDlmmDirectParams {
1928
2318
  maxDeltaId: number;
1929
2319
  strategy: StrategyType;
1930
2320
  favorXInActiveId: boolean;
1931
- maxAccounts: number;
1932
2321
  swapSlippageBps: number;
1933
2322
  maxTransferAmountExtendPercentage: number;
1934
2323
  directSwapEstimate: DlmmDirectEstimateResult;
@@ -1950,7 +2339,8 @@ type ZapInDlmmIndirectPoolParam = {
1950
2339
  maxTransferAmountX: BN;
1951
2340
  maxTransferAmountY: BN;
1952
2341
  preInstructions: TransactionInstruction[];
1953
- swapTransactions: Transaction[];
2342
+ swapInstructions: TransactionInstruction[];
2343
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1954
2344
  cleanUpInstructions: TransactionInstruction[];
1955
2345
  binArrays: AccountMeta[];
1956
2346
  binArrayBitmapExtension: PublicKey | null;
@@ -1973,7 +2363,8 @@ type ZapInDlmmDirectPoolParam = {
1973
2363
  amount: BN;
1974
2364
  maxTransferAmount: BN;
1975
2365
  preInstructions: TransactionInstruction[];
1976
- swapTransactions: Transaction[];
2366
+ swapInstructions: TransactionInstruction[];
2367
+ addressLookupTableAccounts: AddressLookupTableAccount[];
1977
2368
  cleanUpInstructions: TransactionInstruction[];
1978
2369
  binArrays: AccountMeta[];
1979
2370
  binArrayBitmapExtension: PublicKey | null;
@@ -1981,22 +2372,16 @@ type ZapInDlmmDirectPoolParam = {
1981
2372
  isTokenX: boolean;
1982
2373
  singleSided?: DlmmSingleSided;
1983
2374
  };
1984
- type ZapInDlmmResponse = {
1985
- setupTransaction?: Transaction;
1986
- swapTransactions: Transaction[];
1987
- ledgerTransaction: Transaction;
1988
- zapInTransaction: Transaction;
1989
- cleanUpTransaction: Transaction;
1990
- };
1991
2375
 
1992
2376
  declare class Zap {
1993
2377
  private connection;
1994
2378
  private jupiterApiUrl;
1995
2379
  private jupiterApiKey;
2380
+ private jupiterApiVersion;
1996
2381
  zapProgram: ZapProgram;
1997
2382
  /**
1998
2383
  * @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)
2384
+ * @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
2385
  */
2001
2386
  constructor(connection: Connection, config?: ZapConfig);
2002
2387
  private initializeLedgerAccount;
@@ -2017,12 +2402,12 @@ declare class Zap {
2017
2402
  * @param params.amountIn - The amount of input token
2018
2403
  * @param params.inputTokenMint - The input token mint
2019
2404
  * @param params.positionNftMint - The position NFT mint account's public key
2020
- * @param params.maxAccounts - The maximum number of accounts for the Jupiter swap query
2021
2405
  * @param params.maxSqrtPriceChangeBps - The maximum sqrt price change in basis points
2022
2406
  * @param params.slippageBps - The swap slippage tolerance in basis points
2023
2407
  * @param params.dammV2Quote - The DAMM V2 swap quote for exactly 1 input token in lamports (used for price calculation, not the actual amountIn)
2024
2408
  * @param params.jupiterQuote - The Jupiter swap quote for exactly 1 input token in lamports (used for price calculation, not the actual amountIn)
2025
2409
  * @param params.maxTransferAmountExtendPercentage - The percentage to extend the max transfer amount after the swap
2410
+ * @param params.jupiterQuoteOptions - Optional Jupiter query parameters, see `GetJupiterQuoteParams.queryParams`
2026
2411
  * @returns The zap-in transaction parameters for a DAMM V2 direct pool
2027
2412
  * @throws if input token mint matches either tokenA or tokenB in the pool
2028
2413
  * @throws if failed to get both Jupiter and DAMM v2 swap quotes
@@ -2039,12 +2424,12 @@ declare class Zap {
2039
2424
  * @param params.amountIn - The amount of input token
2040
2425
  * @param params.inputTokenMint - The input token mint
2041
2426
  * @param params.positionNftMint - The position NFT mint account's public key
2042
- * @param params.maxAccounts - The maximum number of accounts for the Jupiter swap query
2043
2427
  * @param params.maxSqrtPriceChangeBps - The maximum sqrt price change in basis points
2044
2428
  * @param params.slippageBps - The swap slippage tolerance in basis points
2045
2429
  * @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
2430
  * @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
2431
  * @param params.maxTransferAmountExtendPercentage - The percentage to extend the max transfer amount after the swap
2432
+ * @param params.jupiterQuoteOptions - Optional Jupiter query parameters, see `GetJupiterQuoteParams.queryParams`
2048
2433
  * @returns The zap-in transaction parameters for a DAMM V2 indirect pool
2049
2434
  * @throws if input token mint matches either tokenA or tokenB in the pool
2050
2435
  * @throws if no Jupiter quote provided for both tokens
@@ -2052,7 +2437,12 @@ declare class Zap {
2052
2437
  */
2053
2438
  getZapInDammV2IndirectPoolParams(params: GetZapInDammV2IndirectPoolParams): Promise<ZapInDammV2IndirectPoolParam | null>;
2054
2439
  /**
2055
- * Build DAMM v2 zap-in transaction
2440
+ * Build the DAMM v2 zap-in instructions
2441
+ *
2442
+ * Instructions are ordered: setup (token accounts, wrap SOL), swaps, ledger, zap in, clean up.
2443
+ * They must run in that order but can be split across several transactions, because state
2444
+ * between steps lives in accounts. Splitting loses atomicity, so send split transactions as a bundle.
2445
+ * No compute budget instructions are included; the client sets the compute budget for each transaction.
2056
2446
  *
2057
2447
  * @param params.user - The user's public key
2058
2448
  * @param params.pool - The pool's public key
@@ -2068,12 +2458,13 @@ declare class Zap {
2068
2458
  * @param params.amount - The amount to deposit
2069
2459
  * @param params.preSqrtPrice - The sqrt price before the operation
2070
2460
  * @param params.maxSqrtPriceChangeBps - The maximum sqrt price change in basis points
2071
- * @param params.preInstructions - Instructions to run before the zap in
2072
- * @param params.swapTransactions - Swap transactions to execute
2461
+ * @param params.preInstructions - Instructions to run before the zap in, including the token accounts the Jupiter swaps need. Token account creation repeated here is removed
2462
+ * @param params.swapInstructions - Swap instructions to execute
2463
+ * @param params.addressLookupTableAccounts - Lookup tables used by the swap instructions
2073
2464
  * @param params.cleanUpInstructions - Instructions to run after the zap in
2074
- * @returns Response containing transaction components
2465
+ * @returns The ordered instructions and the lookup tables they use
2075
2466
  */
2076
- buildZapInDammV2Transaction(params: ZapInDammV2DirectPoolParam | ZapInDammV2IndirectPoolParam): Promise<ZapInDammV2Response>;
2467
+ buildZapInDammV2Transaction(params: ZapInDammV2DirectPoolParam | ZapInDammV2IndirectPoolParam): Promise<ZapInstructionsResponse>;
2077
2468
  /**
2078
2469
  * Get the parameters for building a DLMM zap in transaction through a direct route
2079
2470
  * Direct route means the input token matches either tokenX or tokenY in the pool
@@ -2087,8 +2478,7 @@ declare class Zap {
2087
2478
  * @param params.maxDeltaId - The bin delta relative to the active bin for the upper bin position
2088
2479
  * @param params.strategy - The liquidity distribution strategy
2089
2480
  * @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
2481
+ * @param params.swapSlippageBps - Swap slippage vs the **quoted route**, not vs a fair input/output price. Validate `directSwapEstimate` / `outAmount` before send.
2092
2482
  * @param params.maxTransferAmountExtendPercentage - The percentage to extend the max transfer amount after the swap
2093
2483
  * @param params.maxActiveBinSlippage - The maximum active bin slippage
2094
2484
  * @param params.directSwapEstimate - The result from the direct swap estimate
@@ -2112,7 +2502,6 @@ declare class Zap {
2112
2502
  * @param params.strategy - The liquidity distribution strategy
2113
2503
  * @param params.favorXInActiveId - Whether to favor token X in the active bin
2114
2504
  * @param params.indirectSwapEstimate - The result from the indirect swap estimate
2115
- * @param params.maxAccounts - The maximum number of accounts for the Jupiter swap query
2116
2505
  * @param params.swapSlippageBps - The swap slippage tolerance in basis points
2117
2506
  * @param params.maxTransferAmountExtendPercentage - The percentage to extend the max transfer amount after the swap
2118
2507
  * @param params.maxActiveBinSlippage - The maximum active bin slippage
@@ -2123,7 +2512,12 @@ declare class Zap {
2123
2512
  */
2124
2513
  getZapInDlmmIndirectParams(params: GetZapInDlmmIndirectParams): Promise<ZapInDlmmIndirectPoolParam>;
2125
2514
  /**
2126
- * Builds a DLMM zap-in transaction
2515
+ * Build the DLMM zap-in instructions
2516
+ *
2517
+ * Instructions are ordered: setup (token accounts, wrap SOL), swaps, ledger, zap in, clean up.
2518
+ * They must run in that order but can be split across several transactions, because state
2519
+ * between steps lives in accounts. Splitting loses atomicity, so send split transactions as a bundle.
2520
+ * No compute budget instructions are included; the client sets the compute budget for each transaction.
2127
2521
  *
2128
2522
  * @param params.user - The user's public key
2129
2523
  * @param params.lbPair - The DLMM pool's public key
@@ -2138,22 +2532,30 @@ declare class Zap {
2138
2532
  * @param params.maxActiveBinSlippage - The maximum active bin slippage
2139
2533
  * @param params.favorXInActiveId - Whether to favor token X in the active bin
2140
2534
  * @param params.strategy - The liquidity distribution strategy
2141
- * @param params.preInstructions - Instructions to run before the zap in
2142
- * @param params.swapTransactions - Swap transactions to execute
2535
+ * @param params.preInstructions - Instructions to run before the zap in, including the token accounts the Jupiter swaps need. Token account creation repeated here is removed
2536
+ * @param params.swapInstructions - Swap instructions to execute
2537
+ * @param params.addressLookupTableAccounts - Lookup tables used by the swap instructions
2143
2538
  * @param params.cleanUpInstructions - Instructions to run after the zap in
2144
2539
  * @param params.binArrays - The bin arrays required for the position
2145
2540
  * @param params.binArrayBitmapExtension - The bin array bitmap extension account if it exists
2146
2541
  * @param params.isDirectRoute - Whether this is a direct route
2147
2542
  * @param params.singleSided - Optional single-sided deposit mode (X or Y only) - default is non-single-sided
2148
- * @returns Response containing transaction components
2543
+ * @returns The ordered instructions and the lookup tables they use
2149
2544
  */
2150
2545
  buildZapInDlmmTransaction(params: (ZapInDlmmIndirectPoolParam | ZapInDlmmDirectPoolParam) & {
2151
2546
  position: PublicKey;
2152
- }): Promise<ZapInDlmmResponse>;
2547
+ }): Promise<ZapInstructionsResponse>;
2153
2548
  /**
2154
2549
  * High level method for DLMM position rebalancing
2155
2550
  * Consist of remove liquidity, zap out through Jupiter or DLMM, and zap back in to rebalance the position
2156
2551
  *
2552
+ * Instructions are ordered: setup (token accounts), init bin arrays, rebalance position, swap, ledger,
2553
+ * zap in, clean up. They must run in that order but can be split across several transactions.
2554
+ * Splitting loses atomicity, so send split transactions as a bundle.
2555
+ * No compute budget instructions are included. The zap-in instruction was measured at about 462k
2556
+ * compute units. Without a compute unit limit, a transaction gets 200k units per instruction (up to
2557
+ * 1.4M), which may not cover it, so set a compute unit limit on the transaction that holds it.
2558
+ *
2157
2559
  * @param params - Rebalancing DLMM position parameters
2158
2560
  * @param params.lbPairAddress - The DLMM pool address
2159
2561
  * @param params.positionAddress - The position address
@@ -2165,8 +2567,7 @@ declare class Zap {
2165
2567
  * @param params.strategy - The strategy to use for the rebalance
2166
2568
  * @param params.favorXInActiveId - Whether to favor token X in the active bin
2167
2569
  * @param params.directSwapEstimate - The estimate of the direct swap operation
2168
- * @param params.maxAccounts - The maximum number of accounts to use for the swap operation
2169
- * @returns Response containing transactions and estimation details
2570
+ * @returns The ordered instructions, the lookup tables they use, and the estimated balances
2170
2571
  * @throws if fail to get jupiter quote or jupiter swap instruction
2171
2572
  */
2172
2573
  rebalanceDlmmPosition(params: RebalanceDlmmPositionParams): Promise<RebalanceDlmmPositionResponse>;
@@ -2180,9 +2581,9 @@ declare class Zap {
2180
2581
  * @param params.ammProgram - AMM program ID to interact with
2181
2582
  * @param params.preInstructions - Instructions to run before the zap out
2182
2583
  * @param params.postInstructions - Instructions to run after the zap out
2183
- * @returns builder transaction
2584
+ * @returns The pre-instructions, the zap out instruction and the post-instructions in order, with no lookup tables
2184
2585
  */
2185
- zapOut(params: ZapOutParams): Promise<Transaction>;
2586
+ zapOut(params: ZapOutParams): Promise<ZapInstructionsResponse>;
2186
2587
  /**
2187
2588
  * Performs a token swap using Jupiter V6 protocol as part of a zap out operation.
2188
2589
  * Swaps tokens from the input token ledger to the user's output token account.
@@ -2191,14 +2592,14 @@ declare class Zap {
2191
2592
  * @param params.user - Public key of the user performing the swap
2192
2593
  * @param params.inputMint - Token mint being swapped from
2193
2594
  * @param params.outputMint - Token mint being swapped to
2194
- * @param params.jupiterSwapResponse - Jupiter swap instruction response
2595
+ * @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
2596
  * @param params.inputTokenProgram - Token program for the input token (defaults to SPL Token)
2196
2597
  * @param params.outputTokenProgram - Token program for the output token (defaults to SPL Token)
2197
2598
  * @param params.maxSwapAmount - Maximum amount of input token to swap
2198
2599
  * @param params.percentageToZapOut - Percentage of input token to zap out
2199
- * @returns built transaction
2600
+ * @returns The ordered instructions and the lookup tables of the Jupiter swap
2200
2601
  */
2201
- zapOutThroughJupiter(params: ZapOutThroughJupiterParams): Promise<Transaction>;
2602
+ zapOutThroughJupiter(params: ZapOutThroughJupiterParams): Promise<ZapInstructionsResponse>;
2202
2603
  /**
2203
2604
  * Performs a token swap using Damms V2 protocol as part of a zap out operation.
2204
2605
  * Swaps tokens from the input token ledger to the user's output token account.
@@ -2212,8 +2613,9 @@ declare class Zap {
2212
2613
  * @param params.minimumSwapAmountOut - Minimum amount of output token to receive
2213
2614
  * @param params.maxSwapAmount - Maximum amount of input token to swap
2214
2615
  * @param params.percentageToZapOut - Percentage of input token to zap out
2616
+ * @returns The ordered instructions, with no lookup tables
2215
2617
  */
2216
- zapOutThroughDammV2(params: ZapOutThroughDammV2Params): Promise<Transaction>;
2618
+ zapOutThroughDammV2(params: ZapOutThroughDammV2Params): Promise<ZapInstructionsResponse>;
2217
2619
  /**
2218
2620
  * Performs a token swap using Dlmm protocol as part of a zap out operation.
2219
2621
  * Swaps tokens from the input token ledger to the user's output token account.
@@ -2227,14 +2629,46 @@ declare class Zap {
2227
2629
  * @param params.minimumSwapAmountOut - Minimum amount of output token to receive
2228
2630
  * @param params.maxSwapAmount - Maximum amount of input token to swap
2229
2631
  * @param params.percentageToZapOut - Percentage of input token to zap out
2632
+ * @returns The ordered instructions, with no lookup tables
2230
2633
  */
2231
- zapOutThroughDlmm(params: ZapOutThroughDlmmParams): Promise<Transaction>;
2634
+ zapOutThroughDlmm(params: ZapOutThroughDlmmParams): Promise<ZapInstructionsResponse>;
2232
2635
  }
2233
2636
 
2234
- declare function getJupiterQuote(inputMint: PublicKey, outputMint: PublicKey, amount: BN, maxAccounts: number, slippageBps: number, dynamicSlippage: boolean | undefined, onlyDirectRoutes: boolean, restrictIntermediateTokens: boolean, forJitoBundle?: 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;
2637
+ /**
2638
+ * Get a Jupiter quote.
2639
+ * - v1: `GET /swap/v1/quote`, returns the quote only.
2640
+ * - v2: `GET /swap/v2/build`, returns the quote together with the swap instructions built for `params.user`
2641
+ * (a `JupiterBuildResponse`), so no second request is needed for the swap.
2642
+ * Returns null when the request fails.
2643
+ *
2644
+ * `params.queryParams` is forwarded to Jupiter as-is, and Jupiter uses its own default for every
2645
+ * parameter not given. A low `maxAccounts` can give a much thinner route than a Jupiter UI quote.
2646
+ * `slippageBps` only bounds execution against this quote. It does not mean `outAmount` is a fair
2647
+ * price for the input size, so validate the output, price impact or simulated token balance
2648
+ * changes before sending.
2649
+ * @see https://developers.jup.ag/docs/resources/support#customer-support
2650
+ */
2651
+ declare function getJupiterQuote(params: GetJupiterQuoteParams, config?: ZapConfig): Promise<JupiterQuoteResponse | null>;
2652
+ /**
2653
+ * Get the Jupiter swap instructions for a quote.
2654
+ * - v1: `POST /swap/v1/swap-instructions`.
2655
+ * - v2: returns `quoteResponse` as is. It must be a `GET /swap/v2/build` response built for `userPublicKey`,
2656
+ * so the executed swap is the quoted one.
2657
+ * Throws when the request fails, or under v2 when `quoteResponse` has no swap instructions built for `userPublicKey`.
2658
+ */
2659
+ declare function getJupiterSwapInstruction(userPublicKey: PublicKey, quoteResponse: JupiterQuoteResponse, config?: ZapConfig): Promise<JupiterSwapInstructions>;
2660
+ /**
2661
+ * Get the Jupiter swap instruction for swapping `amount` of `inputMint` to `outputMint`, and the lookup tables it uses.
2662
+ * When `jupiterQuoteResponse` is given it is executed as is, and it must be a quote for `amount` by `user`.
2663
+ * Otherwise a new quote is fetched with `slippageBps`, which `jupiterQuoteOptions` can override.
2664
+ * `setupInstructions` holds all of Jupiter's setup instructions. Their token account create instructions must run
2665
+ * before the swap. The rest wrap SOL, which the zap does itself.
2666
+ * Throws when the quote does not match the swap, or when the quote, swap instruction or lookup tables cannot be fetched.
2667
+ */
2668
+ declare function buildJupiterSwapTransaction(connection: Connection, user: PublicKey, inputMint: PublicKey, outputMint: PublicKey, amount: BN, slippageBps: number, jupiterQuoteResponse?: JupiterQuoteResponse, config?: ZapConfig, jupiterQuoteOptions?: JupiterQueryParams): Promise<{
2669
+ instruction: TransactionInstruction;
2670
+ setupInstructions: TransactionInstruction[];
2671
+ addressLookupTableAccounts: AddressLookupTableAccount[];
2238
2672
  quoteResponse: JupiterQuoteResponse;
2239
2673
  }>;
2240
2674
 
@@ -2282,7 +2716,7 @@ declare function convertUiAmountToLamports(amount: Decimal, decimals: number): D
2282
2716
  * @param tokenProgram - The token program to use (defaults to TOKEN_PROGRAM_ID)
2283
2717
  * @returns The token account and the instruction to create it if it doesn't exist
2284
2718
  */
2285
- declare const getOrCreateATAInstruction: (connection: Connection, tokenMint: PublicKey, owner: PublicKey, payer: PublicKey, allowOwnerOffCurve: boolean | undefined, tokenProgram: PublicKey) => Promise<{
2719
+ declare const getOrCreateATAInstruction: (_connection: Connection, tokenMint: PublicKey, owner: PublicKey, payer: PublicKey, allowOwnerOffCurve: boolean | undefined, tokenProgram: PublicKey) => Promise<{
2286
2720
  ataPubkey: PublicKey;
2287
2721
  ix?: TransactionInstruction;
2288
2722
  }>;
@@ -2364,12 +2798,13 @@ declare function getExtraAccountMetasForTransferHook(connection: Connection, min
2364
2798
  * @param params.maxDeltaId - Maximum bin delta from active bin
2365
2799
  * @param params.strategy - Strategy type for the position
2366
2800
  * @param params.singleSided - Optional single-sided deposit mode (X or Y only) - default is non-single-sided
2801
+ * @param params.jupiterQuoteOptions - Optional Jupiter query parameters, see `GetJupiterQuoteParams.queryParams`
2367
2802
  * @param params.config - Optional configuration for Jupiter API URL (default: https://api.jup.ag) and API key (default: empty string)
2368
2803
  * @returns IndirectSwapEstimate with swap details and post-swap token amounts
2369
2804
  * @throws if inputTokenMint matches any token in the DLMM pool
2370
2805
  * @throws if failed to get Jupiter swap quote
2371
2806
  */
2372
- declare function estimateDlmmIndirectSwap({ amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, config, }: EstimateDlmmIndirectSwapParams): Promise<DlmmIndirectSwapEstimate>;
2807
+ declare function estimateDlmmIndirectSwap({ user, amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, jupiterQuoteOptions, config, }: EstimateDlmmIndirectSwapParams): Promise<DlmmIndirectSwapEstimate>;
2373
2808
  /**
2374
2809
  * Calculate optimal swap amount for zap-in deposits (single token input)
2375
2810
  *
@@ -2386,11 +2821,12 @@ declare function estimateDlmmIndirectSwap({ amountIn, inputTokenMint, lbPair, co
2386
2821
  * @param params.maxDeltaId - Maximum bin delta from active bin
2387
2822
  * @param params.strategy - Strategy type for the position
2388
2823
  * @param params.singleSided - Optional single-sided deposit mode (X or Y only) - default is non-single-sided
2824
+ * @param params.jupiterQuoteOptions - Optional Jupiter query parameters, see `GetJupiterQuoteParams.queryParams`
2389
2825
  * @param params.config - Optional configuration for Jupiter API URL (default: https://api.jup.ag) and API key (default: empty string)
2390
2826
  * @returns DirectSwapEstimate with swap details and post-swap token amounts
2391
2827
  * @throws if failed to get both Jupiter and DLMM swap quotes
2392
2828
  */
2393
- declare function estimateDlmmDirectSwap({ amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, config, }: EstimateDlmmDirectSwapParams): Promise<DlmmDirectSwapEstimate>;
2829
+ declare function estimateDlmmDirectSwap({ user, amountIn, inputTokenMint, lbPair, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, singleSided, jupiterQuoteOptions, config, }: EstimateDlmmDirectSwapParams): Promise<DlmmDirectSwapEstimate>;
2394
2830
  /**
2395
2831
  * Calculate optimal swap amount for rebalancing existing positions (both tokens)
2396
2832
  *
@@ -2405,11 +2841,12 @@ declare function estimateDlmmDirectSwap({ amountIn, inputTokenMint, lbPair, conn
2405
2841
  * @param params.minDeltaId - Minimum bin delta from active bin
2406
2842
  * @param params.maxDeltaId - Maximum bin delta from active bin
2407
2843
  * @param params.strategy - Strategy type for the position
2844
+ * @param params.jupiterQuoteOptions - Optional Jupiter query parameters, see `GetJupiterQuoteParams.queryParams`
2408
2845
  * @param params.config - Optional configuration for Jupiter API URL (default: https://api.jup.ag) and API key (default: empty string)
2409
2846
  * @returns DirectSwapEstimate with swap details and post-swap token amounts
2410
2847
  * @throws if failed to get both Jupiter and DLMM swap quotes
2411
2848
  */
2412
- declare function estimateDlmmRebalanceSwap({ lbPair, position, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, config, }: EstimateDlmmRebalanceSwapParams): Promise<DlmmDirectRebalanceEstimate>;
2849
+ declare function estimateDlmmRebalanceSwap({ user, lbPair, position, connection, swapSlippageBps, minDeltaId, maxDeltaId, strategy, jupiterQuoteOptions, config, }: EstimateDlmmRebalanceSwapParams): Promise<DlmmDirectRebalanceEstimate>;
2413
2850
 
2414
2851
  declare const ZAP_PROGRAM_ID: PublicKey;
2415
2852
  declare const JUP_V6_PROGRAM_ID: PublicKey;
@@ -2430,15 +2867,21 @@ declare const AccountsType: {
2430
2867
  };
2431
2868
  declare const DLMM_SWAP_DISCRIMINATOR: number[];
2432
2869
  declare const AMOUNT_IN_DLMM_OFFSET = 8;
2870
+ /**
2871
+ * @deprecated Only correct for the `route` and `shared_accounts_route` Jupiter instructions. The offset depends on the instruction variant, and the SDK finds it for each one itself.
2872
+ * Offset for amount_in in reverse order of jupiter Route instruction data:
2873
+ * amount_in(u64) + quoted_out_amount(64) + slippage_bps(u16) + platform_fee_bps(u8) = 19 bytes
2874
+ */
2433
2875
  declare const AMOUNT_IN_JUP_V6_REVERSE_OFFSET = 19;
2434
2876
  declare const AMOUNT_IN_DAMM_V2_OFFSET = 8;
2435
2877
  declare const DAMM_V2_SWAP_DISCRIMINATOR: number[];
2436
2878
  declare const DEFAULT_JUPITER_API_URL = "https://api.jup.ag";
2879
+ declare const DEFAULT_JUPITER_API_VERSION = JupiterApiVersion.V2;
2437
2880
 
2438
2881
  var address = "zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz";
2439
2882
  var metadata = {
2440
2883
  name: "zap",
2441
- version: "0.2.0",
2884
+ version: "0.2.3",
2442
2885
  spec: "0.1.0",
2443
2886
  description: "Created with Anchor"
2444
2887
  };
@@ -2998,32 +3441,6 @@ var instructions = [
2998
3441
  }
2999
3442
  ];
3000
3443
  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
3444
  {
3028
3445
  name: "UserLedger",
3029
3446
  discriminator: [
@@ -3113,7 +3530,7 @@ var types = [
3113
3530
  }
3114
3531
  },
3115
3532
  {
3116
- name: "BaseFeeStruct",
3533
+ name: "BaseFeeInfo",
3117
3534
  serialization: "bytemuck",
3118
3535
  repr: {
3119
3536
  kind: "c"
@@ -3122,39 +3539,34 @@ var types = [
3122
3539
  kind: "struct",
3123
3540
  fields: [
3124
3541
  {
3125
- name: "cliff_fee_numerator",
3126
- type: "u64"
3127
- },
3128
- {
3129
- name: "base_fee_mode",
3130
- type: "u8"
3131
- },
3132
- {
3133
- name: "padding_0",
3542
+ name: "data",
3134
3543
  type: {
3135
3544
  array: [
3136
3545
  "u8",
3137
- 5
3546
+ 32
3138
3547
  ]
3139
3548
  }
3140
- },
3141
- {
3142
- name: "first_factor",
3143
- type: "u16"
3144
- },
3549
+ }
3550
+ ]
3551
+ }
3552
+ },
3553
+ {
3554
+ name: "BaseFeeStruct",
3555
+ serialization: "bytemuck",
3556
+ repr: {
3557
+ kind: "c"
3558
+ },
3559
+ type: {
3560
+ kind: "struct",
3561
+ fields: [
3145
3562
  {
3146
- name: "second_factor",
3563
+ name: "base_fee_info",
3147
3564
  type: {
3148
- array: [
3149
- "u8",
3150
- 8
3151
- ]
3565
+ defined: {
3566
+ name: "BaseFeeInfo"
3567
+ }
3152
3568
  }
3153
3569
  },
3154
- {
3155
- name: "third_factor",
3156
- type: "u64"
3157
- },
3158
3570
  {
3159
3571
  name: "padding_1",
3160
3572
  type: "u64"
@@ -3424,12 +3836,16 @@ var types = [
3424
3836
  name: "token_mint_y_program_flag",
3425
3837
  type: "u8"
3426
3838
  },
3839
+ {
3840
+ name: "version",
3841
+ type: "u8"
3842
+ },
3427
3843
  {
3428
3844
  name: "_reserved",
3429
3845
  type: {
3430
3846
  array: [
3431
3847
  "u8",
3432
- 22
3848
+ 21
3433
3849
  ]
3434
3850
  }
3435
3851
  }
@@ -3492,11 +3908,16 @@ var types = [
3492
3908
  type: "pubkey"
3493
3909
  },
3494
3910
  {
3495
- name: "partner",
3911
+ name: "padding_0",
3496
3912
  docs: [
3497
- "partner"
3913
+ "padding, previously partner pubkey, be careful when using this field"
3498
3914
  ],
3499
- type: "pubkey"
3915
+ type: {
3916
+ array: [
3917
+ "u8",
3918
+ 32
3919
+ ]
3920
+ }
3500
3921
  },
3501
3922
  {
3502
3923
  name: "liquidity",
@@ -3506,7 +3927,7 @@ var types = [
3506
3927
  type: "u128"
3507
3928
  },
3508
3929
  {
3509
- name: "_padding",
3930
+ name: "padding_1",
3510
3931
  docs: [
3511
3932
  "padding, previous reserve amount, be careful to use that field"
3512
3933
  ],
@@ -3527,18 +3948,8 @@ var types = [
3527
3948
  type: "u64"
3528
3949
  },
3529
3950
  {
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"
3951
+ name: "padding_2",
3952
+ type: "u128"
3542
3953
  },
3543
3954
  {
3544
3955
  name: "sqrt_min_price",
@@ -3599,7 +4010,7 @@ var types = [
3599
4010
  {
3600
4011
  name: "collect_fee_mode",
3601
4012
  docs: [
3602
- "0 is collect fee in both token, 1 only collect fee in token a, 2 only collect fee in token b"
4013
+ "0 is collect fee in both token, 1 only collect fee only in token b"
3603
4014
  ],
3604
4015
  type: "u8"
3605
4016
  },
@@ -3611,14 +4022,14 @@ var types = [
3611
4022
  type: "u8"
3612
4023
  },
3613
4024
  {
3614
- name: "version",
4025
+ name: "fee_version",
3615
4026
  docs: [
3616
- "pool version, 0: max_fee is still capped at 50%, 1: max_fee is capped at 99%"
4027
+ "pool fee version, 0: max_fee is still capped at 50%, 1: max_fee is capped at 99%"
3617
4028
  ],
3618
4029
  type: "u8"
3619
4030
  },
3620
4031
  {
3621
- name: "_padding_0",
4032
+ name: "padding_3",
3622
4033
  docs: [
3623
4034
  "padding"
3624
4035
  ],
@@ -3671,14 +4082,47 @@ var types = [
3671
4082
  type: "pubkey"
3672
4083
  },
3673
4084
  {
3674
- name: "_padding_1",
4085
+ name: "token_a_amount",
4086
+ docs: [
4087
+ "token a amount"
4088
+ ],
4089
+ type: "u64"
4090
+ },
4091
+ {
4092
+ name: "token_b_amount",
4093
+ docs: [
4094
+ "token b amount"
4095
+ ],
4096
+ type: "u64"
4097
+ },
4098
+ {
4099
+ name: "layout_version",
4100
+ docs: [
4101
+ "layout version: version 0: haven't track token_a_amount and token_b_amount, version 1: track token_a_amount and token_b_amount"
4102
+ ],
4103
+ type: "u8"
4104
+ },
4105
+ {
4106
+ name: "padding_4",
4107
+ docs: [
4108
+ "Padding for further use"
4109
+ ],
4110
+ type: {
4111
+ array: [
4112
+ "u8",
4113
+ 7
4114
+ ]
4115
+ }
4116
+ },
4117
+ {
4118
+ name: "padding_5",
3675
4119
  docs: [
3676
4120
  "Padding for further use"
3677
4121
  ],
3678
4122
  type: {
3679
4123
  array: [
3680
4124
  "u64",
3681
- 6
4125
+ 3
3682
4126
  ]
3683
4127
  }
3684
4128
  },
@@ -3707,8 +4151,7 @@ var types = [
3707
4151
  "Information regarding fee charges",
3708
4152
  "trading_fee = amount * trade_fee_numerator / denominator",
3709
4153
  "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"
4154
+ "referral_fee = protocol_fee * referral_percentage / 100"
3712
4155
  ],
3713
4156
  serialization: "bytemuck",
3714
4157
  repr: {
@@ -3741,9 +4184,9 @@ var types = [
3741
4184
  type: "u8"
3742
4185
  },
3743
4186
  {
3744
- name: "partner_fee_percent",
4187
+ name: "padding_0",
3745
4188
  docs: [
3746
- "partner fee"
4189
+ "padding for future use"
3747
4190
  ],
3748
4191
  type: "u8"
3749
4192
  },
@@ -3755,17 +4198,24 @@ var types = [
3755
4198
  type: "u8"
3756
4199
  },
3757
4200
  {
3758
- name: "padding_0",
4201
+ name: "padding_1",
3759
4202
  docs: [
3760
4203
  "padding"
3761
4204
  ],
3762
4205
  type: {
3763
4206
  array: [
3764
4207
  "u8",
3765
- 5
4208
+ 3
3766
4209
  ]
3767
4210
  }
3768
4211
  },
4212
+ {
4213
+ name: "compounding_fee_bps",
4214
+ docs: [
4215
+ "compounding fee bps, only non-zero in CollectFeeMode::Compounding"
4216
+ ],
4217
+ type: "u16"
4218
+ },
3769
4219
  {
3770
4220
  name: "dynamic_fee",
3771
4221
  docs: [
@@ -3778,16 +4228,8 @@ var types = [
3778
4228
  }
3779
4229
  },
3780
4230
  {
3781
- name: "padding_1",
3782
- docs: [
3783
- "padding"
3784
- ],
3785
- type: {
3786
- array: [
3787
- "u64",
3788
- 2
3789
- ]
3790
- }
4231
+ name: "init_sqrt_price",
4232
+ type: "u128"
3791
4233
  }
3792
4234
  ]
3793
4235
  }
@@ -3818,12 +4260,13 @@ var types = [
3818
4260
  type: "u64"
3819
4261
  },
3820
4262
  {
3821
- name: "total_partner_a_fee",
3822
- type: "u64"
3823
- },
3824
- {
3825
- name: "total_partner_b_fee",
3826
- type: "u64"
4263
+ name: "padding_0",
4264
+ type: {
4265
+ array: [
4266
+ "u64",
4267
+ 2
4268
+ ]
4269
+ }
3827
4270
  },
3828
4271
  {
3829
4272
  name: "total_position",
@@ -3946,12 +4389,20 @@ var types = [
3946
4389
  name: "base_fee_power_factor",
3947
4390
  type: "u8"
3948
4391
  },
4392
+ {
4393
+ name: "function_type",
4394
+ type: "u8"
4395
+ },
4396
+ {
4397
+ name: "collect_fee_mode",
4398
+ type: "u8"
4399
+ },
3949
4400
  {
3950
4401
  name: "_padding",
3951
4402
  type: {
3952
4403
  array: [
3953
4404
  "u8",
3954
- 5
4405
+ 3
3955
4406
  ]
3956
4407
  }
3957
4408
  }
@@ -4115,16 +4566,11 @@ var types = [
4115
4566
  }
4116
4567
  },
4117
4568
  {
4118
- name: "_padding_1",
4569
+ name: "dead_liquidity_reward_checkpoint",
4119
4570
  docs: [
4120
- "Padding to ensure `reward_rate: u128` is 16-byte aligned"
4571
+ "Cumulative dead-liquidity reward (Compounding Pool only)"
4121
4572
  ],
4122
- type: {
4123
- array: [
4124
- "u8",
4125
- 8
4126
- ]
4127
- }
4573
+ type: "u64"
4128
4574
  },
4129
4575
  {
4130
4576
  name: "mint",
@@ -4247,56 +4693,6 @@ var types = [
4247
4693
  }
4248
4694
  ];
4249
4695
  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
4696
  {
4301
4697
  name: "MAX_BASIS_POINT",
4302
4698
  type: "u16",
@@ -4318,4 +4714,4 @@ var idl = {
4318
4714
  constants: constants
4319
4715
  };
4320
4716
 
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 };
4717
+ 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, 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, JUP_V6_PROGRAM_ID, type JupiterAddressLookupTableFields, JupiterApiVersion, type JupiterBlockhashWithMetadata, type JupiterBuildResponse, type JupiterInstruction, type JupiterInstructionLayout, type JupiterQueryParams, 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, filterOutCloseSplTokenAccountInstructions, getBinArrayBitmapExtension, getBitFromBinArrayIndexInBitmapExtension, getDammV2Pool, getDammV2RemainingAccounts, getDlmmRemainingAccounts, getExtraAccountMetasForTransferHook, getJupiterQuote, getJupiterSwapInstruction, getLbPairState, getNextBinArrayIndexWithLiquidity, getOrCreateATAInstruction, getTokenAccountBalance, getTokenProgramFromMint, isSingleSidedA, isSingleSidedB, toProgramStrategyType, unwrapSOLInstruction, wrapSOLInstruction };