@hawksightco/hawk-sdk 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3834 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IDL = void 0;
4
+ exports.IDL = {
5
+ "version": "0.3.0",
6
+ "name": "whirlpool",
7
+ "instructions": [
8
+ {
9
+ "name": "initializeConfig",
10
+ "docs": [
11
+ "Initializes a WhirlpoolsConfig account that hosts info & authorities",
12
+ "required to govern a set of Whirlpools.",
13
+ "",
14
+ "### Parameters",
15
+ "- `fee_authority` - Authority authorized to initialize fee-tiers and set customs fees.",
16
+ "- `collect_protocol_fees_authority` - Authority authorized to collect protocol fees.",
17
+ "- `reward_emissions_super_authority` - Authority authorized to set reward authorities in pools."
18
+ ],
19
+ "accounts": [
20
+ {
21
+ "name": "config",
22
+ "isMut": true,
23
+ "isSigner": true
24
+ },
25
+ {
26
+ "name": "funder",
27
+ "isMut": true,
28
+ "isSigner": true
29
+ },
30
+ {
31
+ "name": "systemProgram",
32
+ "isMut": false,
33
+ "isSigner": false
34
+ }
35
+ ],
36
+ "args": [
37
+ {
38
+ "name": "feeAuthority",
39
+ "type": "publicKey"
40
+ },
41
+ {
42
+ "name": "collectProtocolFeesAuthority",
43
+ "type": "publicKey"
44
+ },
45
+ {
46
+ "name": "rewardEmissionsSuperAuthority",
47
+ "type": "publicKey"
48
+ },
49
+ {
50
+ "name": "defaultProtocolFeeRate",
51
+ "type": "u16"
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "name": "initializePool",
57
+ "docs": [
58
+ "Initializes a Whirlpool account.",
59
+ "Fee rate is set to the default values on the config and supplied fee_tier.",
60
+ "",
61
+ "### Parameters",
62
+ "- `bumps` - The bump value when deriving the PDA of the Whirlpool address.",
63
+ "- `tick_spacing` - The desired tick spacing for this pool.",
64
+ "- `initial_sqrt_price` - The desired initial sqrt-price for this pool",
65
+ "",
66
+ "#### Special Errors",
67
+ "`InvalidTokenMintOrder` - The order of mints have to be ordered by",
68
+ "`SqrtPriceOutOfBounds` - provided initial_sqrt_price is not between 2^-64 to 2^64",
69
+ ""
70
+ ],
71
+ "accounts": [
72
+ {
73
+ "name": "whirlpoolsConfig",
74
+ "isMut": false,
75
+ "isSigner": false
76
+ },
77
+ {
78
+ "name": "tokenMintA",
79
+ "isMut": false,
80
+ "isSigner": false
81
+ },
82
+ {
83
+ "name": "tokenMintB",
84
+ "isMut": false,
85
+ "isSigner": false
86
+ },
87
+ {
88
+ "name": "funder",
89
+ "isMut": true,
90
+ "isSigner": true
91
+ },
92
+ {
93
+ "name": "whirlpool",
94
+ "isMut": true,
95
+ "isSigner": false
96
+ },
97
+ {
98
+ "name": "tokenVaultA",
99
+ "isMut": true,
100
+ "isSigner": true
101
+ },
102
+ {
103
+ "name": "tokenVaultB",
104
+ "isMut": true,
105
+ "isSigner": true
106
+ },
107
+ {
108
+ "name": "feeTier",
109
+ "isMut": false,
110
+ "isSigner": false
111
+ },
112
+ {
113
+ "name": "tokenProgram",
114
+ "isMut": false,
115
+ "isSigner": false
116
+ },
117
+ {
118
+ "name": "systemProgram",
119
+ "isMut": false,
120
+ "isSigner": false
121
+ },
122
+ {
123
+ "name": "rent",
124
+ "isMut": false,
125
+ "isSigner": false
126
+ }
127
+ ],
128
+ "args": [
129
+ {
130
+ "name": "bumps",
131
+ "type": {
132
+ "defined": "WhirlpoolBumps"
133
+ }
134
+ },
135
+ {
136
+ "name": "tickSpacing",
137
+ "type": "u16"
138
+ },
139
+ {
140
+ "name": "initialSqrtPrice",
141
+ "type": "u128"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "name": "initializeTickArray",
147
+ "docs": [
148
+ "Initializes a tick_array account to represent a tick-range in a Whirlpool.",
149
+ "",
150
+ "### Parameters",
151
+ "- `start_tick_index` - The starting tick index for this tick-array.",
152
+ "Has to be a multiple of TickArray size & the tick spacing of this pool.",
153
+ "",
154
+ "#### Special Errors",
155
+ "- `InvalidStartTick` - if the provided start tick is out of bounds or is not a multiple of",
156
+ "TICK_ARRAY_SIZE * tick spacing."
157
+ ],
158
+ "accounts": [
159
+ {
160
+ "name": "whirlpool",
161
+ "isMut": false,
162
+ "isSigner": false
163
+ },
164
+ {
165
+ "name": "funder",
166
+ "isMut": true,
167
+ "isSigner": true
168
+ },
169
+ {
170
+ "name": "tickArray",
171
+ "isMut": true,
172
+ "isSigner": false
173
+ },
174
+ {
175
+ "name": "systemProgram",
176
+ "isMut": false,
177
+ "isSigner": false
178
+ }
179
+ ],
180
+ "args": [
181
+ {
182
+ "name": "startTickIndex",
183
+ "type": "i32"
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ "name": "initializeFeeTier",
189
+ "docs": [
190
+ "Initializes a fee_tier account usable by Whirlpools in a WhirlpoolConfig space.",
191
+ "",
192
+ "### Authority",
193
+ "- \"fee_authority\" - Set authority in the WhirlpoolConfig",
194
+ "",
195
+ "### Parameters",
196
+ "- `tick_spacing` - The tick-spacing that this fee-tier suggests the default_fee_rate for.",
197
+ "- `default_fee_rate` - The default fee rate that a pool will use if the pool uses this",
198
+ "fee tier during initialization.",
199
+ "",
200
+ "#### Special Errors",
201
+ "- `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE."
202
+ ],
203
+ "accounts": [
204
+ {
205
+ "name": "config",
206
+ "isMut": false,
207
+ "isSigner": false
208
+ },
209
+ {
210
+ "name": "feeTier",
211
+ "isMut": true,
212
+ "isSigner": false
213
+ },
214
+ {
215
+ "name": "funder",
216
+ "isMut": true,
217
+ "isSigner": true
218
+ },
219
+ {
220
+ "name": "feeAuthority",
221
+ "isMut": false,
222
+ "isSigner": true
223
+ },
224
+ {
225
+ "name": "systemProgram",
226
+ "isMut": false,
227
+ "isSigner": false
228
+ }
229
+ ],
230
+ "args": [
231
+ {
232
+ "name": "tickSpacing",
233
+ "type": "u16"
234
+ },
235
+ {
236
+ "name": "defaultFeeRate",
237
+ "type": "u16"
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ "name": "initializeReward",
243
+ "docs": [
244
+ "Initialize reward for a Whirlpool. A pool can only support up to a set number of rewards.",
245
+ "",
246
+ "### Authority",
247
+ "- \"reward_authority\" - assigned authority by the reward_super_authority for the specified",
248
+ "reward-index in this Whirlpool",
249
+ "",
250
+ "### Parameters",
251
+ "- `reward_index` - The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS)",
252
+ "",
253
+ "#### Special Errors",
254
+ "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized",
255
+ "index in this pool, or exceeds NUM_REWARDS, or",
256
+ "all reward slots for this pool has been initialized."
257
+ ],
258
+ "accounts": [
259
+ {
260
+ "name": "rewardAuthority",
261
+ "isMut": false,
262
+ "isSigner": true
263
+ },
264
+ {
265
+ "name": "funder",
266
+ "isMut": true,
267
+ "isSigner": true
268
+ },
269
+ {
270
+ "name": "whirlpool",
271
+ "isMut": true,
272
+ "isSigner": false
273
+ },
274
+ {
275
+ "name": "rewardMint",
276
+ "isMut": false,
277
+ "isSigner": false
278
+ },
279
+ {
280
+ "name": "rewardVault",
281
+ "isMut": true,
282
+ "isSigner": true
283
+ },
284
+ {
285
+ "name": "tokenProgram",
286
+ "isMut": false,
287
+ "isSigner": false
288
+ },
289
+ {
290
+ "name": "systemProgram",
291
+ "isMut": false,
292
+ "isSigner": false
293
+ },
294
+ {
295
+ "name": "rent",
296
+ "isMut": false,
297
+ "isSigner": false
298
+ }
299
+ ],
300
+ "args": [
301
+ {
302
+ "name": "rewardIndex",
303
+ "type": "u8"
304
+ }
305
+ ]
306
+ },
307
+ {
308
+ "name": "setRewardEmissions",
309
+ "docs": [
310
+ "Set the reward emissions for a reward in a Whirlpool.",
311
+ "",
312
+ "### Authority",
313
+ "- \"reward_authority\" - assigned authority by the reward_super_authority for the specified",
314
+ "reward-index in this Whirlpool",
315
+ "",
316
+ "### Parameters",
317
+ "- `reward_index` - The reward index (0 <= index <= NUM_REWARDS) that we'd like to modify.",
318
+ "- `emissions_per_second_x64` - The amount of rewards emitted in this pool.",
319
+ "",
320
+ "#### Special Errors",
321
+ "- `RewardVaultAmountInsufficient` - The amount of rewards in the reward vault cannot emit",
322
+ "more than a day of desired emissions.",
323
+ "- `InvalidTimestamp` - Provided timestamp is not in order with the previous timestamp.",
324
+ "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized",
325
+ "index in this pool, or exceeds NUM_REWARDS, or",
326
+ "all reward slots for this pool has been initialized."
327
+ ],
328
+ "accounts": [
329
+ {
330
+ "name": "whirlpool",
331
+ "isMut": true,
332
+ "isSigner": false
333
+ },
334
+ {
335
+ "name": "rewardAuthority",
336
+ "isMut": false,
337
+ "isSigner": true
338
+ },
339
+ {
340
+ "name": "rewardVault",
341
+ "isMut": false,
342
+ "isSigner": false
343
+ }
344
+ ],
345
+ "args": [
346
+ {
347
+ "name": "rewardIndex",
348
+ "type": "u8"
349
+ },
350
+ {
351
+ "name": "emissionsPerSecondX64",
352
+ "type": "u128"
353
+ }
354
+ ]
355
+ },
356
+ {
357
+ "name": "openPosition",
358
+ "docs": [
359
+ "Open a position in a Whirlpool. A unique token will be minted to represent the position",
360
+ "in the users wallet. The position will start off with 0 liquidity.",
361
+ "",
362
+ "### Parameters",
363
+ "- `tick_lower_index` - The tick specifying the lower end of the position range.",
364
+ "- `tick_upper_index` - The tick specifying the upper end of the position range.",
365
+ "",
366
+ "#### Special Errors",
367
+ "- `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of",
368
+ "the tick-spacing in this pool."
369
+ ],
370
+ "accounts": [
371
+ {
372
+ "name": "funder",
373
+ "isMut": true,
374
+ "isSigner": true
375
+ },
376
+ {
377
+ "name": "owner",
378
+ "isMut": false,
379
+ "isSigner": false
380
+ },
381
+ {
382
+ "name": "position",
383
+ "isMut": true,
384
+ "isSigner": false
385
+ },
386
+ {
387
+ "name": "positionMint",
388
+ "isMut": true,
389
+ "isSigner": true
390
+ },
391
+ {
392
+ "name": "positionTokenAccount",
393
+ "isMut": true,
394
+ "isSigner": false
395
+ },
396
+ {
397
+ "name": "whirlpool",
398
+ "isMut": false,
399
+ "isSigner": false
400
+ },
401
+ {
402
+ "name": "tokenProgram",
403
+ "isMut": false,
404
+ "isSigner": false
405
+ },
406
+ {
407
+ "name": "systemProgram",
408
+ "isMut": false,
409
+ "isSigner": false
410
+ },
411
+ {
412
+ "name": "rent",
413
+ "isMut": false,
414
+ "isSigner": false
415
+ },
416
+ {
417
+ "name": "associatedTokenProgram",
418
+ "isMut": false,
419
+ "isSigner": false
420
+ }
421
+ ],
422
+ "args": [
423
+ {
424
+ "name": "bumps",
425
+ "type": {
426
+ "defined": "OpenPositionBumps"
427
+ }
428
+ },
429
+ {
430
+ "name": "tickLowerIndex",
431
+ "type": "i32"
432
+ },
433
+ {
434
+ "name": "tickUpperIndex",
435
+ "type": "i32"
436
+ }
437
+ ]
438
+ },
439
+ {
440
+ "name": "openPositionWithMetadata",
441
+ "docs": [
442
+ "Open a position in a Whirlpool. A unique token will be minted to represent the position",
443
+ "in the users wallet. Additional Metaplex metadata is appended to identify the token.",
444
+ "The position will start off with 0 liquidity.",
445
+ "",
446
+ "### Parameters",
447
+ "- `tick_lower_index` - The tick specifying the lower end of the position range.",
448
+ "- `tick_upper_index` - The tick specifying the upper end of the position range.",
449
+ "",
450
+ "#### Special Errors",
451
+ "- `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of",
452
+ "the tick-spacing in this pool."
453
+ ],
454
+ "accounts": [
455
+ {
456
+ "name": "funder",
457
+ "isMut": true,
458
+ "isSigner": true
459
+ },
460
+ {
461
+ "name": "owner",
462
+ "isMut": false,
463
+ "isSigner": false
464
+ },
465
+ {
466
+ "name": "position",
467
+ "isMut": true,
468
+ "isSigner": false
469
+ },
470
+ {
471
+ "name": "positionMint",
472
+ "isMut": true,
473
+ "isSigner": true
474
+ },
475
+ {
476
+ "name": "positionMetadataAccount",
477
+ "isMut": true,
478
+ "isSigner": false,
479
+ "docs": [
480
+ "https://github.com/metaplex-foundation/metaplex-program-library/blob/master/token-metadata/program/src/utils.rs#L873"
481
+ ]
482
+ },
483
+ {
484
+ "name": "positionTokenAccount",
485
+ "isMut": true,
486
+ "isSigner": false
487
+ },
488
+ {
489
+ "name": "whirlpool",
490
+ "isMut": false,
491
+ "isSigner": false
492
+ },
493
+ {
494
+ "name": "tokenProgram",
495
+ "isMut": false,
496
+ "isSigner": false
497
+ },
498
+ {
499
+ "name": "systemProgram",
500
+ "isMut": false,
501
+ "isSigner": false
502
+ },
503
+ {
504
+ "name": "rent",
505
+ "isMut": false,
506
+ "isSigner": false
507
+ },
508
+ {
509
+ "name": "associatedTokenProgram",
510
+ "isMut": false,
511
+ "isSigner": false
512
+ },
513
+ {
514
+ "name": "metadataProgram",
515
+ "isMut": false,
516
+ "isSigner": false
517
+ },
518
+ {
519
+ "name": "metadataUpdateAuth",
520
+ "isMut": false,
521
+ "isSigner": false
522
+ }
523
+ ],
524
+ "args": [
525
+ {
526
+ "name": "bumps",
527
+ "type": {
528
+ "defined": "OpenPositionWithMetadataBumps"
529
+ }
530
+ },
531
+ {
532
+ "name": "tickLowerIndex",
533
+ "type": "i32"
534
+ },
535
+ {
536
+ "name": "tickUpperIndex",
537
+ "type": "i32"
538
+ }
539
+ ]
540
+ },
541
+ {
542
+ "name": "increaseLiquidity",
543
+ "docs": [
544
+ "Add liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards.",
545
+ "",
546
+ "### Authority",
547
+ "- `position_authority` - authority that owns the token corresponding to this desired position.",
548
+ "",
549
+ "### Parameters",
550
+ "- `liquidity_amount` - The total amount of Liquidity the user is willing to deposit.",
551
+ "- `token_max_a` - The maximum amount of tokenA the user is willing to deposit.",
552
+ "- `token_max_b` - The maximum amount of tokenB the user is willing to deposit.",
553
+ "",
554
+ "#### Special Errors",
555
+ "- `LiquidityZero` - Provided liquidity amount is zero.",
556
+ "- `LiquidityTooHigh` - Provided liquidity exceeds u128::max.",
557
+ "- `TokenMaxExceeded` - The required token to perform this operation exceeds the user defined amount."
558
+ ],
559
+ "accounts": [
560
+ {
561
+ "name": "whirlpool",
562
+ "isMut": true,
563
+ "isSigner": false
564
+ },
565
+ {
566
+ "name": "tokenProgram",
567
+ "isMut": false,
568
+ "isSigner": false
569
+ },
570
+ {
571
+ "name": "positionAuthority",
572
+ "isMut": false,
573
+ "isSigner": true
574
+ },
575
+ {
576
+ "name": "position",
577
+ "isMut": true,
578
+ "isSigner": false
579
+ },
580
+ {
581
+ "name": "positionTokenAccount",
582
+ "isMut": false,
583
+ "isSigner": false
584
+ },
585
+ {
586
+ "name": "tokenOwnerAccountA",
587
+ "isMut": true,
588
+ "isSigner": false
589
+ },
590
+ {
591
+ "name": "tokenOwnerAccountB",
592
+ "isMut": true,
593
+ "isSigner": false
594
+ },
595
+ {
596
+ "name": "tokenVaultA",
597
+ "isMut": true,
598
+ "isSigner": false
599
+ },
600
+ {
601
+ "name": "tokenVaultB",
602
+ "isMut": true,
603
+ "isSigner": false
604
+ },
605
+ {
606
+ "name": "tickArrayLower",
607
+ "isMut": true,
608
+ "isSigner": false
609
+ },
610
+ {
611
+ "name": "tickArrayUpper",
612
+ "isMut": true,
613
+ "isSigner": false
614
+ }
615
+ ],
616
+ "args": [
617
+ {
618
+ "name": "liquidityAmount",
619
+ "type": "u128"
620
+ },
621
+ {
622
+ "name": "tokenMaxA",
623
+ "type": "u64"
624
+ },
625
+ {
626
+ "name": "tokenMaxB",
627
+ "type": "u64"
628
+ }
629
+ ]
630
+ },
631
+ {
632
+ "name": "decreaseLiquidity",
633
+ "docs": [
634
+ "Withdraw liquidity from a position in the Whirlpool. This call also updates the position's accrued fees and rewards.",
635
+ "",
636
+ "### Authority",
637
+ "- `position_authority` - authority that owns the token corresponding to this desired position.",
638
+ "",
639
+ "### Parameters",
640
+ "- `liquidity_amount` - The total amount of Liquidity the user desires to withdraw.",
641
+ "- `token_min_a` - The minimum amount of tokenA the user is willing to withdraw.",
642
+ "- `token_min_b` - The minimum amount of tokenB the user is willing to withdraw.",
643
+ "",
644
+ "#### Special Errors",
645
+ "- `LiquidityZero` - Provided liquidity amount is zero.",
646
+ "- `LiquidityTooHigh` - Provided liquidity exceeds u128::max.",
647
+ "- `TokenMinSubceeded` - The required token to perform this operation subceeds the user defined amount."
648
+ ],
649
+ "accounts": [
650
+ {
651
+ "name": "whirlpool",
652
+ "isMut": true,
653
+ "isSigner": false
654
+ },
655
+ {
656
+ "name": "tokenProgram",
657
+ "isMut": false,
658
+ "isSigner": false
659
+ },
660
+ {
661
+ "name": "positionAuthority",
662
+ "isMut": false,
663
+ "isSigner": true
664
+ },
665
+ {
666
+ "name": "position",
667
+ "isMut": true,
668
+ "isSigner": false
669
+ },
670
+ {
671
+ "name": "positionTokenAccount",
672
+ "isMut": false,
673
+ "isSigner": false
674
+ },
675
+ {
676
+ "name": "tokenOwnerAccountA",
677
+ "isMut": true,
678
+ "isSigner": false
679
+ },
680
+ {
681
+ "name": "tokenOwnerAccountB",
682
+ "isMut": true,
683
+ "isSigner": false
684
+ },
685
+ {
686
+ "name": "tokenVaultA",
687
+ "isMut": true,
688
+ "isSigner": false
689
+ },
690
+ {
691
+ "name": "tokenVaultB",
692
+ "isMut": true,
693
+ "isSigner": false
694
+ },
695
+ {
696
+ "name": "tickArrayLower",
697
+ "isMut": true,
698
+ "isSigner": false
699
+ },
700
+ {
701
+ "name": "tickArrayUpper",
702
+ "isMut": true,
703
+ "isSigner": false
704
+ }
705
+ ],
706
+ "args": [
707
+ {
708
+ "name": "liquidityAmount",
709
+ "type": "u128"
710
+ },
711
+ {
712
+ "name": "tokenMinA",
713
+ "type": "u64"
714
+ },
715
+ {
716
+ "name": "tokenMinB",
717
+ "type": "u64"
718
+ }
719
+ ]
720
+ },
721
+ {
722
+ "name": "updateFeesAndRewards",
723
+ "docs": [
724
+ "Update the accrued fees and rewards for a position.",
725
+ "",
726
+ "#### Special Errors",
727
+ "- `TickNotFound` - Provided tick array account does not contain the tick for this position.",
728
+ "- `LiquidityZero` - Position has zero liquidity and therefore already has the most updated fees and reward values."
729
+ ],
730
+ "accounts": [
731
+ {
732
+ "name": "whirlpool",
733
+ "isMut": true,
734
+ "isSigner": false
735
+ },
736
+ {
737
+ "name": "position",
738
+ "isMut": true,
739
+ "isSigner": false
740
+ },
741
+ {
742
+ "name": "tickArrayLower",
743
+ "isMut": false,
744
+ "isSigner": false
745
+ },
746
+ {
747
+ "name": "tickArrayUpper",
748
+ "isMut": false,
749
+ "isSigner": false
750
+ }
751
+ ],
752
+ "args": []
753
+ },
754
+ {
755
+ "name": "collectFees",
756
+ "docs": [
757
+ "Collect fees accrued for this position.",
758
+ "",
759
+ "### Authority",
760
+ "- `position_authority` - authority that owns the token corresponding to this desired position."
761
+ ],
762
+ "accounts": [
763
+ {
764
+ "name": "whirlpool",
765
+ "isMut": false,
766
+ "isSigner": false
767
+ },
768
+ {
769
+ "name": "positionAuthority",
770
+ "isMut": false,
771
+ "isSigner": true
772
+ },
773
+ {
774
+ "name": "position",
775
+ "isMut": true,
776
+ "isSigner": false
777
+ },
778
+ {
779
+ "name": "positionTokenAccount",
780
+ "isMut": false,
781
+ "isSigner": false
782
+ },
783
+ {
784
+ "name": "tokenOwnerAccountA",
785
+ "isMut": true,
786
+ "isSigner": false
787
+ },
788
+ {
789
+ "name": "tokenVaultA",
790
+ "isMut": true,
791
+ "isSigner": false
792
+ },
793
+ {
794
+ "name": "tokenOwnerAccountB",
795
+ "isMut": true,
796
+ "isSigner": false
797
+ },
798
+ {
799
+ "name": "tokenVaultB",
800
+ "isMut": true,
801
+ "isSigner": false
802
+ },
803
+ {
804
+ "name": "tokenProgram",
805
+ "isMut": false,
806
+ "isSigner": false
807
+ }
808
+ ],
809
+ "args": []
810
+ },
811
+ {
812
+ "name": "collectReward",
813
+ "docs": [
814
+ "Collect rewards accrued for this position.",
815
+ "",
816
+ "### Authority",
817
+ "- `position_authority` - authority that owns the token corresponding to this desired position."
818
+ ],
819
+ "accounts": [
820
+ {
821
+ "name": "whirlpool",
822
+ "isMut": false,
823
+ "isSigner": false
824
+ },
825
+ {
826
+ "name": "positionAuthority",
827
+ "isMut": false,
828
+ "isSigner": true
829
+ },
830
+ {
831
+ "name": "position",
832
+ "isMut": true,
833
+ "isSigner": false
834
+ },
835
+ {
836
+ "name": "positionTokenAccount",
837
+ "isMut": false,
838
+ "isSigner": false
839
+ },
840
+ {
841
+ "name": "rewardOwnerAccount",
842
+ "isMut": true,
843
+ "isSigner": false
844
+ },
845
+ {
846
+ "name": "rewardVault",
847
+ "isMut": true,
848
+ "isSigner": false
849
+ },
850
+ {
851
+ "name": "tokenProgram",
852
+ "isMut": false,
853
+ "isSigner": false
854
+ }
855
+ ],
856
+ "args": [
857
+ {
858
+ "name": "rewardIndex",
859
+ "type": "u8"
860
+ }
861
+ ]
862
+ },
863
+ {
864
+ "name": "collectProtocolFees",
865
+ "docs": [
866
+ "Collect the protocol fees accrued in this Whirlpool",
867
+ "",
868
+ "### Authority",
869
+ "- `collect_protocol_fees_authority` - assigned authority in the WhirlpoolConfig that can collect protocol fees"
870
+ ],
871
+ "accounts": [
872
+ {
873
+ "name": "whirlpoolsConfig",
874
+ "isMut": false,
875
+ "isSigner": false
876
+ },
877
+ {
878
+ "name": "whirlpool",
879
+ "isMut": true,
880
+ "isSigner": false
881
+ },
882
+ {
883
+ "name": "collectProtocolFeesAuthority",
884
+ "isMut": false,
885
+ "isSigner": true
886
+ },
887
+ {
888
+ "name": "tokenVaultA",
889
+ "isMut": true,
890
+ "isSigner": false
891
+ },
892
+ {
893
+ "name": "tokenVaultB",
894
+ "isMut": true,
895
+ "isSigner": false
896
+ },
897
+ {
898
+ "name": "tokenDestinationA",
899
+ "isMut": true,
900
+ "isSigner": false
901
+ },
902
+ {
903
+ "name": "tokenDestinationB",
904
+ "isMut": true,
905
+ "isSigner": false
906
+ },
907
+ {
908
+ "name": "tokenProgram",
909
+ "isMut": false,
910
+ "isSigner": false
911
+ }
912
+ ],
913
+ "args": []
914
+ },
915
+ {
916
+ "name": "swap",
917
+ "docs": [
918
+ "Perform a swap in this Whirlpool",
919
+ "",
920
+ "### Authority",
921
+ "- \"token_authority\" - The authority to withdraw tokens from the input token account.",
922
+ "",
923
+ "### Parameters",
924
+ "- `amount` - The amount of input or output token to swap from (depending on amount_specified_is_input).",
925
+ "- `other_amount_threshold` - The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).",
926
+ "- `sqrt_price_limit` - The maximum/minimum price the swap will swap to.",
927
+ "- `amount_specified_is_input` - Specifies the token the parameter `amount`represents. If true, the amount represents the input token of the swap.",
928
+ "- `a_to_b` - The direction of the swap. True if swapping from A to B. False if swapping from B to A.",
929
+ "",
930
+ "#### Special Errors",
931
+ "- `ZeroTradableAmount` - User provided parameter `amount` is 0.",
932
+ "- `InvalidSqrtPriceLimitDirection` - User provided parameter `sqrt_price_limit` does not match the direction of the trade.",
933
+ "- `SqrtPriceOutOfBounds` - User provided parameter `sqrt_price_limit` is over Whirlppool's max/min bounds for sqrt-price.",
934
+ "- `InvalidTickArraySequence` - User provided tick-arrays are not in sequential order required to proceed in this trade direction.",
935
+ "- `TickArraySequenceInvalidIndex` - The swap loop attempted to access an invalid array index during the query of the next initialized tick.",
936
+ "- `TickArrayIndexOutofBounds` - The swap loop attempted to access an invalid array index during tick crossing.",
937
+ "- `LiquidityOverflow` - Liquidity value overflowed 128bits during tick crossing.",
938
+ "- `InvalidTickSpacing` - The swap pool was initialized with tick-spacing of 0."
939
+ ],
940
+ "accounts": [
941
+ {
942
+ "name": "tokenProgram",
943
+ "isMut": false,
944
+ "isSigner": false
945
+ },
946
+ {
947
+ "name": "tokenAuthority",
948
+ "isMut": false,
949
+ "isSigner": true
950
+ },
951
+ {
952
+ "name": "whirlpool",
953
+ "isMut": true,
954
+ "isSigner": false
955
+ },
956
+ {
957
+ "name": "tokenOwnerAccountA",
958
+ "isMut": true,
959
+ "isSigner": false
960
+ },
961
+ {
962
+ "name": "tokenVaultA",
963
+ "isMut": true,
964
+ "isSigner": false
965
+ },
966
+ {
967
+ "name": "tokenOwnerAccountB",
968
+ "isMut": true,
969
+ "isSigner": false
970
+ },
971
+ {
972
+ "name": "tokenVaultB",
973
+ "isMut": true,
974
+ "isSigner": false
975
+ },
976
+ {
977
+ "name": "tickArray0",
978
+ "isMut": true,
979
+ "isSigner": false
980
+ },
981
+ {
982
+ "name": "tickArray1",
983
+ "isMut": true,
984
+ "isSigner": false
985
+ },
986
+ {
987
+ "name": "tickArray2",
988
+ "isMut": true,
989
+ "isSigner": false
990
+ },
991
+ {
992
+ "name": "oracle",
993
+ "isMut": false,
994
+ "isSigner": false
995
+ }
996
+ ],
997
+ "args": [
998
+ {
999
+ "name": "amount",
1000
+ "type": "u64"
1001
+ },
1002
+ {
1003
+ "name": "otherAmountThreshold",
1004
+ "type": "u64"
1005
+ },
1006
+ {
1007
+ "name": "sqrtPriceLimit",
1008
+ "type": "u128"
1009
+ },
1010
+ {
1011
+ "name": "amountSpecifiedIsInput",
1012
+ "type": "bool"
1013
+ },
1014
+ {
1015
+ "name": "aToB",
1016
+ "type": "bool"
1017
+ }
1018
+ ]
1019
+ },
1020
+ {
1021
+ "name": "closePosition",
1022
+ "docs": [
1023
+ "Close a position in a Whirlpool. Burns the position token in the owner's wallet.",
1024
+ "",
1025
+ "### Authority",
1026
+ "- \"position_authority\" - The authority that owns the position token.",
1027
+ "",
1028
+ "#### Special Errors",
1029
+ "- `ClosePositionNotEmpty` - The provided position account is not empty."
1030
+ ],
1031
+ "accounts": [
1032
+ {
1033
+ "name": "positionAuthority",
1034
+ "isMut": false,
1035
+ "isSigner": true
1036
+ },
1037
+ {
1038
+ "name": "receiver",
1039
+ "isMut": true,
1040
+ "isSigner": false
1041
+ },
1042
+ {
1043
+ "name": "position",
1044
+ "isMut": true,
1045
+ "isSigner": false
1046
+ },
1047
+ {
1048
+ "name": "positionMint",
1049
+ "isMut": true,
1050
+ "isSigner": false
1051
+ },
1052
+ {
1053
+ "name": "positionTokenAccount",
1054
+ "isMut": true,
1055
+ "isSigner": false
1056
+ },
1057
+ {
1058
+ "name": "tokenProgram",
1059
+ "isMut": false,
1060
+ "isSigner": false
1061
+ }
1062
+ ],
1063
+ "args": []
1064
+ },
1065
+ {
1066
+ "name": "setDefaultFeeRate",
1067
+ "docs": [
1068
+ "Set the default_fee_rate for a FeeTier",
1069
+ "Only the current fee authority has permission to invoke this instruction.",
1070
+ "",
1071
+ "### Authority",
1072
+ "- \"fee_authority\" - Set authority in the WhirlpoolConfig",
1073
+ "",
1074
+ "### Parameters",
1075
+ "- `default_fee_rate` - The default fee rate that a pool will use if the pool uses this",
1076
+ "fee tier during initialization.",
1077
+ "",
1078
+ "#### Special Errors",
1079
+ "- `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE."
1080
+ ],
1081
+ "accounts": [
1082
+ {
1083
+ "name": "whirlpoolsConfig",
1084
+ "isMut": false,
1085
+ "isSigner": false
1086
+ },
1087
+ {
1088
+ "name": "feeTier",
1089
+ "isMut": true,
1090
+ "isSigner": false
1091
+ },
1092
+ {
1093
+ "name": "feeAuthority",
1094
+ "isMut": false,
1095
+ "isSigner": true
1096
+ }
1097
+ ],
1098
+ "args": [
1099
+ {
1100
+ "name": "defaultFeeRate",
1101
+ "type": "u16"
1102
+ }
1103
+ ]
1104
+ },
1105
+ {
1106
+ "name": "setDefaultProtocolFeeRate",
1107
+ "docs": [
1108
+ "Sets the default protocol fee rate for a WhirlpoolConfig",
1109
+ "Protocol fee rate is represented as a basis point.",
1110
+ "Only the current fee authority has permission to invoke this instruction.",
1111
+ "",
1112
+ "### Authority",
1113
+ "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig",
1114
+ "",
1115
+ "### Parameters",
1116
+ "- `default_protocol_fee_rate` - Rate that is referenced during the initialization of a Whirlpool using this config.",
1117
+ "",
1118
+ "#### Special Errors",
1119
+ "- `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE."
1120
+ ],
1121
+ "accounts": [
1122
+ {
1123
+ "name": "whirlpoolsConfig",
1124
+ "isMut": true,
1125
+ "isSigner": false
1126
+ },
1127
+ {
1128
+ "name": "feeAuthority",
1129
+ "isMut": false,
1130
+ "isSigner": true
1131
+ }
1132
+ ],
1133
+ "args": [
1134
+ {
1135
+ "name": "defaultProtocolFeeRate",
1136
+ "type": "u16"
1137
+ }
1138
+ ]
1139
+ },
1140
+ {
1141
+ "name": "setFeeRate",
1142
+ "docs": [
1143
+ "Sets the fee rate for a Whirlpool.",
1144
+ "Fee rate is represented as hundredths of a basis point.",
1145
+ "Only the current fee authority has permission to invoke this instruction.",
1146
+ "",
1147
+ "### Authority",
1148
+ "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig",
1149
+ "",
1150
+ "### Parameters",
1151
+ "- `fee_rate` - The rate that the pool will use to calculate fees going onwards.",
1152
+ "",
1153
+ "#### Special Errors",
1154
+ "- `FeeRateMaxExceeded` - If the provided fee_rate exceeds MAX_FEE_RATE."
1155
+ ],
1156
+ "accounts": [
1157
+ {
1158
+ "name": "whirlpoolsConfig",
1159
+ "isMut": false,
1160
+ "isSigner": false
1161
+ },
1162
+ {
1163
+ "name": "whirlpool",
1164
+ "isMut": true,
1165
+ "isSigner": false
1166
+ },
1167
+ {
1168
+ "name": "feeAuthority",
1169
+ "isMut": false,
1170
+ "isSigner": true
1171
+ }
1172
+ ],
1173
+ "args": [
1174
+ {
1175
+ "name": "feeRate",
1176
+ "type": "u16"
1177
+ }
1178
+ ]
1179
+ },
1180
+ {
1181
+ "name": "setProtocolFeeRate",
1182
+ "docs": [
1183
+ "Sets the protocol fee rate for a Whirlpool.",
1184
+ "Protocol fee rate is represented as a basis point.",
1185
+ "Only the current fee authority has permission to invoke this instruction.",
1186
+ "",
1187
+ "### Authority",
1188
+ "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig",
1189
+ "",
1190
+ "### Parameters",
1191
+ "- `protocol_fee_rate` - The rate that the pool will use to calculate protocol fees going onwards.",
1192
+ "",
1193
+ "#### Special Errors",
1194
+ "- `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE."
1195
+ ],
1196
+ "accounts": [
1197
+ {
1198
+ "name": "whirlpoolsConfig",
1199
+ "isMut": false,
1200
+ "isSigner": false
1201
+ },
1202
+ {
1203
+ "name": "whirlpool",
1204
+ "isMut": true,
1205
+ "isSigner": false
1206
+ },
1207
+ {
1208
+ "name": "feeAuthority",
1209
+ "isMut": false,
1210
+ "isSigner": true
1211
+ }
1212
+ ],
1213
+ "args": [
1214
+ {
1215
+ "name": "protocolFeeRate",
1216
+ "type": "u16"
1217
+ }
1218
+ ]
1219
+ },
1220
+ {
1221
+ "name": "setFeeAuthority",
1222
+ "docs": [
1223
+ "Sets the fee authority for a WhirlpoolConfig.",
1224
+ "The fee authority can set the fee & protocol fee rate for individual pools or",
1225
+ "set the default fee rate for newly minted pools.",
1226
+ "Only the current fee authority has permission to invoke this instruction.",
1227
+ "",
1228
+ "### Authority",
1229
+ "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig"
1230
+ ],
1231
+ "accounts": [
1232
+ {
1233
+ "name": "whirlpoolsConfig",
1234
+ "isMut": true,
1235
+ "isSigner": false
1236
+ },
1237
+ {
1238
+ "name": "feeAuthority",
1239
+ "isMut": false,
1240
+ "isSigner": true
1241
+ },
1242
+ {
1243
+ "name": "newFeeAuthority",
1244
+ "isMut": false,
1245
+ "isSigner": false
1246
+ }
1247
+ ],
1248
+ "args": []
1249
+ },
1250
+ {
1251
+ "name": "setCollectProtocolFeesAuthority",
1252
+ "docs": [
1253
+ "Sets the fee authority to collect protocol fees for a WhirlpoolConfig.",
1254
+ "Only the current collect protocol fee authority has permission to invoke this instruction.",
1255
+ "",
1256
+ "### Authority",
1257
+ "- \"fee_authority\" - Set authority that can collect protocol fees in the WhirlpoolConfig"
1258
+ ],
1259
+ "accounts": [
1260
+ {
1261
+ "name": "whirlpoolsConfig",
1262
+ "isMut": true,
1263
+ "isSigner": false
1264
+ },
1265
+ {
1266
+ "name": "collectProtocolFeesAuthority",
1267
+ "isMut": false,
1268
+ "isSigner": true
1269
+ },
1270
+ {
1271
+ "name": "newCollectProtocolFeesAuthority",
1272
+ "isMut": false,
1273
+ "isSigner": false
1274
+ }
1275
+ ],
1276
+ "args": []
1277
+ },
1278
+ {
1279
+ "name": "setRewardAuthority",
1280
+ "docs": [
1281
+ "Set the whirlpool reward authority at the provided `reward_index`.",
1282
+ "Only the current reward authority for this reward index has permission to invoke this instruction.",
1283
+ "",
1284
+ "### Authority",
1285
+ "- \"reward_authority\" - Set authority that can control reward emission for this particular reward.",
1286
+ "",
1287
+ "#### Special Errors",
1288
+ "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized",
1289
+ "index in this pool, or exceeds NUM_REWARDS, or",
1290
+ "all reward slots for this pool has been initialized."
1291
+ ],
1292
+ "accounts": [
1293
+ {
1294
+ "name": "whirlpool",
1295
+ "isMut": true,
1296
+ "isSigner": false
1297
+ },
1298
+ {
1299
+ "name": "rewardAuthority",
1300
+ "isMut": false,
1301
+ "isSigner": true
1302
+ },
1303
+ {
1304
+ "name": "newRewardAuthority",
1305
+ "isMut": false,
1306
+ "isSigner": false
1307
+ }
1308
+ ],
1309
+ "args": [
1310
+ {
1311
+ "name": "rewardIndex",
1312
+ "type": "u8"
1313
+ }
1314
+ ]
1315
+ },
1316
+ {
1317
+ "name": "setRewardAuthorityBySuperAuthority",
1318
+ "docs": [
1319
+ "Set the whirlpool reward authority at the provided `reward_index`.",
1320
+ "Only the current reward super authority has permission to invoke this instruction.",
1321
+ "",
1322
+ "### Authority",
1323
+ "- \"reward_authority\" - Set authority that can control reward emission for this particular reward.",
1324
+ "",
1325
+ "#### Special Errors",
1326
+ "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized",
1327
+ "index in this pool, or exceeds NUM_REWARDS, or",
1328
+ "all reward slots for this pool has been initialized."
1329
+ ],
1330
+ "accounts": [
1331
+ {
1332
+ "name": "whirlpoolsConfig",
1333
+ "isMut": false,
1334
+ "isSigner": false
1335
+ },
1336
+ {
1337
+ "name": "whirlpool",
1338
+ "isMut": true,
1339
+ "isSigner": false
1340
+ },
1341
+ {
1342
+ "name": "rewardEmissionsSuperAuthority",
1343
+ "isMut": false,
1344
+ "isSigner": true
1345
+ },
1346
+ {
1347
+ "name": "newRewardAuthority",
1348
+ "isMut": false,
1349
+ "isSigner": false
1350
+ }
1351
+ ],
1352
+ "args": [
1353
+ {
1354
+ "name": "rewardIndex",
1355
+ "type": "u8"
1356
+ }
1357
+ ]
1358
+ },
1359
+ {
1360
+ "name": "setRewardEmissionsSuperAuthority",
1361
+ "docs": [
1362
+ "Set the whirlpool reward super authority for a WhirlpoolConfig",
1363
+ "Only the current reward super authority has permission to invoke this instruction.",
1364
+ "This instruction will not change the authority on any `WhirlpoolRewardInfo` whirlpool rewards.",
1365
+ "",
1366
+ "### Authority",
1367
+ "- \"reward_emissions_super_authority\" - Set authority that can control reward authorities for all pools in this config space."
1368
+ ],
1369
+ "accounts": [
1370
+ {
1371
+ "name": "whirlpoolsConfig",
1372
+ "isMut": true,
1373
+ "isSigner": false
1374
+ },
1375
+ {
1376
+ "name": "rewardEmissionsSuperAuthority",
1377
+ "isMut": false,
1378
+ "isSigner": true
1379
+ },
1380
+ {
1381
+ "name": "newRewardEmissionsSuperAuthority",
1382
+ "isMut": false,
1383
+ "isSigner": false
1384
+ }
1385
+ ],
1386
+ "args": []
1387
+ },
1388
+ {
1389
+ "name": "twoHopSwap",
1390
+ "docs": [
1391
+ "Perform a two-hop swap in this Whirlpool",
1392
+ "",
1393
+ "### Authority",
1394
+ "- \"token_authority\" - The authority to withdraw tokens from the input token account.",
1395
+ "",
1396
+ "### Parameters",
1397
+ "- `amount` - The amount of input or output token to swap from (depending on amount_specified_is_input).",
1398
+ "- `other_amount_threshold` - The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).",
1399
+ "- `amount_specified_is_input` - Specifies the token the parameter `amount`represents. If true, the amount represents the input token of the swap.",
1400
+ "- `a_to_b_one` - The direction of the swap of hop one. True if swapping from A to B. False if swapping from B to A.",
1401
+ "- `a_to_b_two` - The direction of the swap of hop two. True if swapping from A to B. False if swapping from B to A.",
1402
+ "- `sqrt_price_limit_one` - The maximum/minimum price the swap will swap to in the first hop.",
1403
+ "- `sqrt_price_limit_two` - The maximum/minimum price the swap will swap to in the second hop.",
1404
+ "",
1405
+ "#### Special Errors",
1406
+ "- `ZeroTradableAmount` - User provided parameter `amount` is 0.",
1407
+ "- `InvalidSqrtPriceLimitDirection` - User provided parameter `sqrt_price_limit` does not match the direction of the trade.",
1408
+ "- `SqrtPriceOutOfBounds` - User provided parameter `sqrt_price_limit` is over Whirlppool's max/min bounds for sqrt-price.",
1409
+ "- `InvalidTickArraySequence` - User provided tick-arrays are not in sequential order required to proceed in this trade direction.",
1410
+ "- `TickArraySequenceInvalidIndex` - The swap loop attempted to access an invalid array index during the query of the next initialized tick.",
1411
+ "- `TickArrayIndexOutofBounds` - The swap loop attempted to access an invalid array index during tick crossing.",
1412
+ "- `LiquidityOverflow` - Liquidity value overflowed 128bits during tick crossing.",
1413
+ "- `InvalidTickSpacing` - The swap pool was initialized with tick-spacing of 0.",
1414
+ "- `InvalidIntermediaryMint` - Error if the intermediary mint between hop one and two do not equal.",
1415
+ "- `DuplicateTwoHopPool` - Error if whirlpool one & two are the same pool."
1416
+ ],
1417
+ "accounts": [
1418
+ {
1419
+ "name": "tokenProgram",
1420
+ "isMut": false,
1421
+ "isSigner": false
1422
+ },
1423
+ {
1424
+ "name": "tokenAuthority",
1425
+ "isMut": false,
1426
+ "isSigner": true
1427
+ },
1428
+ {
1429
+ "name": "whirlpoolOne",
1430
+ "isMut": true,
1431
+ "isSigner": false
1432
+ },
1433
+ {
1434
+ "name": "whirlpoolTwo",
1435
+ "isMut": true,
1436
+ "isSigner": false
1437
+ },
1438
+ {
1439
+ "name": "tokenOwnerAccountOneA",
1440
+ "isMut": true,
1441
+ "isSigner": false
1442
+ },
1443
+ {
1444
+ "name": "tokenVaultOneA",
1445
+ "isMut": true,
1446
+ "isSigner": false
1447
+ },
1448
+ {
1449
+ "name": "tokenOwnerAccountOneB",
1450
+ "isMut": true,
1451
+ "isSigner": false
1452
+ },
1453
+ {
1454
+ "name": "tokenVaultOneB",
1455
+ "isMut": true,
1456
+ "isSigner": false
1457
+ },
1458
+ {
1459
+ "name": "tokenOwnerAccountTwoA",
1460
+ "isMut": true,
1461
+ "isSigner": false
1462
+ },
1463
+ {
1464
+ "name": "tokenVaultTwoA",
1465
+ "isMut": true,
1466
+ "isSigner": false
1467
+ },
1468
+ {
1469
+ "name": "tokenOwnerAccountTwoB",
1470
+ "isMut": true,
1471
+ "isSigner": false
1472
+ },
1473
+ {
1474
+ "name": "tokenVaultTwoB",
1475
+ "isMut": true,
1476
+ "isSigner": false
1477
+ },
1478
+ {
1479
+ "name": "tickArrayOne0",
1480
+ "isMut": true,
1481
+ "isSigner": false
1482
+ },
1483
+ {
1484
+ "name": "tickArrayOne1",
1485
+ "isMut": true,
1486
+ "isSigner": false
1487
+ },
1488
+ {
1489
+ "name": "tickArrayOne2",
1490
+ "isMut": true,
1491
+ "isSigner": false
1492
+ },
1493
+ {
1494
+ "name": "tickArrayTwo0",
1495
+ "isMut": true,
1496
+ "isSigner": false
1497
+ },
1498
+ {
1499
+ "name": "tickArrayTwo1",
1500
+ "isMut": true,
1501
+ "isSigner": false
1502
+ },
1503
+ {
1504
+ "name": "tickArrayTwo2",
1505
+ "isMut": true,
1506
+ "isSigner": false
1507
+ },
1508
+ {
1509
+ "name": "oracleOne",
1510
+ "isMut": false,
1511
+ "isSigner": false
1512
+ },
1513
+ {
1514
+ "name": "oracleTwo",
1515
+ "isMut": false,
1516
+ "isSigner": false
1517
+ }
1518
+ ],
1519
+ "args": [
1520
+ {
1521
+ "name": "amount",
1522
+ "type": "u64"
1523
+ },
1524
+ {
1525
+ "name": "otherAmountThreshold",
1526
+ "type": "u64"
1527
+ },
1528
+ {
1529
+ "name": "amountSpecifiedIsInput",
1530
+ "type": "bool"
1531
+ },
1532
+ {
1533
+ "name": "aToBOne",
1534
+ "type": "bool"
1535
+ },
1536
+ {
1537
+ "name": "aToBTwo",
1538
+ "type": "bool"
1539
+ },
1540
+ {
1541
+ "name": "sqrtPriceLimitOne",
1542
+ "type": "u128"
1543
+ },
1544
+ {
1545
+ "name": "sqrtPriceLimitTwo",
1546
+ "type": "u128"
1547
+ }
1548
+ ]
1549
+ },
1550
+ {
1551
+ "name": "initializePositionBundle",
1552
+ "docs": [
1553
+ "Initializes a PositionBundle account that bundles several positions.",
1554
+ "A unique token will be minted to represent the position bundle in the users wallet."
1555
+ ],
1556
+ "accounts": [
1557
+ {
1558
+ "name": "positionBundle",
1559
+ "isMut": true,
1560
+ "isSigner": false
1561
+ },
1562
+ {
1563
+ "name": "positionBundleMint",
1564
+ "isMut": true,
1565
+ "isSigner": true
1566
+ },
1567
+ {
1568
+ "name": "positionBundleTokenAccount",
1569
+ "isMut": true,
1570
+ "isSigner": false
1571
+ },
1572
+ {
1573
+ "name": "positionBundleOwner",
1574
+ "isMut": false,
1575
+ "isSigner": false
1576
+ },
1577
+ {
1578
+ "name": "funder",
1579
+ "isMut": true,
1580
+ "isSigner": true
1581
+ },
1582
+ {
1583
+ "name": "tokenProgram",
1584
+ "isMut": false,
1585
+ "isSigner": false
1586
+ },
1587
+ {
1588
+ "name": "systemProgram",
1589
+ "isMut": false,
1590
+ "isSigner": false
1591
+ },
1592
+ {
1593
+ "name": "rent",
1594
+ "isMut": false,
1595
+ "isSigner": false
1596
+ },
1597
+ {
1598
+ "name": "associatedTokenProgram",
1599
+ "isMut": false,
1600
+ "isSigner": false
1601
+ }
1602
+ ],
1603
+ "args": []
1604
+ },
1605
+ {
1606
+ "name": "initializePositionBundleWithMetadata",
1607
+ "docs": [
1608
+ "Initializes a PositionBundle account that bundles several positions.",
1609
+ "A unique token will be minted to represent the position bundle in the users wallet.",
1610
+ "Additional Metaplex metadata is appended to identify the token."
1611
+ ],
1612
+ "accounts": [
1613
+ {
1614
+ "name": "positionBundle",
1615
+ "isMut": true,
1616
+ "isSigner": false
1617
+ },
1618
+ {
1619
+ "name": "positionBundleMint",
1620
+ "isMut": true,
1621
+ "isSigner": true
1622
+ },
1623
+ {
1624
+ "name": "positionBundleMetadata",
1625
+ "isMut": true,
1626
+ "isSigner": false,
1627
+ "docs": [
1628
+ "https://github.com/metaplex-foundation/metaplex-program-library/blob/773a574c4b34e5b9f248a81306ec24db064e255f/token-metadata/program/src/utils/metadata.rs#L100"
1629
+ ]
1630
+ },
1631
+ {
1632
+ "name": "positionBundleTokenAccount",
1633
+ "isMut": true,
1634
+ "isSigner": false
1635
+ },
1636
+ {
1637
+ "name": "positionBundleOwner",
1638
+ "isMut": false,
1639
+ "isSigner": false
1640
+ },
1641
+ {
1642
+ "name": "funder",
1643
+ "isMut": true,
1644
+ "isSigner": true
1645
+ },
1646
+ {
1647
+ "name": "metadataUpdateAuth",
1648
+ "isMut": false,
1649
+ "isSigner": false
1650
+ },
1651
+ {
1652
+ "name": "tokenProgram",
1653
+ "isMut": false,
1654
+ "isSigner": false
1655
+ },
1656
+ {
1657
+ "name": "systemProgram",
1658
+ "isMut": false,
1659
+ "isSigner": false
1660
+ },
1661
+ {
1662
+ "name": "rent",
1663
+ "isMut": false,
1664
+ "isSigner": false
1665
+ },
1666
+ {
1667
+ "name": "associatedTokenProgram",
1668
+ "isMut": false,
1669
+ "isSigner": false
1670
+ },
1671
+ {
1672
+ "name": "metadataProgram",
1673
+ "isMut": false,
1674
+ "isSigner": false
1675
+ }
1676
+ ],
1677
+ "args": []
1678
+ },
1679
+ {
1680
+ "name": "deletePositionBundle",
1681
+ "docs": [
1682
+ "Delete a PositionBundle account. Burns the position bundle token in the owner's wallet.",
1683
+ "",
1684
+ "### Authority",
1685
+ "- `position_bundle_owner` - The owner that owns the position bundle token.",
1686
+ "",
1687
+ "### Special Errors",
1688
+ "- `PositionBundleNotDeletable` - The provided position bundle has open positions."
1689
+ ],
1690
+ "accounts": [
1691
+ {
1692
+ "name": "positionBundle",
1693
+ "isMut": true,
1694
+ "isSigner": false
1695
+ },
1696
+ {
1697
+ "name": "positionBundleMint",
1698
+ "isMut": true,
1699
+ "isSigner": false
1700
+ },
1701
+ {
1702
+ "name": "positionBundleTokenAccount",
1703
+ "isMut": true,
1704
+ "isSigner": false
1705
+ },
1706
+ {
1707
+ "name": "positionBundleOwner",
1708
+ "isMut": false,
1709
+ "isSigner": true
1710
+ },
1711
+ {
1712
+ "name": "receiver",
1713
+ "isMut": true,
1714
+ "isSigner": false
1715
+ },
1716
+ {
1717
+ "name": "tokenProgram",
1718
+ "isMut": false,
1719
+ "isSigner": false
1720
+ }
1721
+ ],
1722
+ "args": []
1723
+ },
1724
+ {
1725
+ "name": "openBundledPosition",
1726
+ "docs": [
1727
+ "Open a bundled position in a Whirlpool. No new tokens are issued",
1728
+ "because the owner of the position bundle becomes the owner of the position.",
1729
+ "The position will start off with 0 liquidity.",
1730
+ "",
1731
+ "### Authority",
1732
+ "- `position_bundle_authority` - authority that owns the token corresponding to this desired position bundle.",
1733
+ "",
1734
+ "### Parameters",
1735
+ "- `bundle_index` - The bundle index that we'd like to open.",
1736
+ "- `tick_lower_index` - The tick specifying the lower end of the position range.",
1737
+ "- `tick_upper_index` - The tick specifying the upper end of the position range.",
1738
+ "",
1739
+ "#### Special Errors",
1740
+ "- `InvalidBundleIndex` - If the provided bundle index is out of bounds.",
1741
+ "- `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of",
1742
+ "the tick-spacing in this pool."
1743
+ ],
1744
+ "accounts": [
1745
+ {
1746
+ "name": "bundledPosition",
1747
+ "isMut": true,
1748
+ "isSigner": false
1749
+ },
1750
+ {
1751
+ "name": "positionBundle",
1752
+ "isMut": true,
1753
+ "isSigner": false
1754
+ },
1755
+ {
1756
+ "name": "positionBundleTokenAccount",
1757
+ "isMut": false,
1758
+ "isSigner": false
1759
+ },
1760
+ {
1761
+ "name": "positionBundleAuthority",
1762
+ "isMut": false,
1763
+ "isSigner": true
1764
+ },
1765
+ {
1766
+ "name": "whirlpool",
1767
+ "isMut": false,
1768
+ "isSigner": false
1769
+ },
1770
+ {
1771
+ "name": "funder",
1772
+ "isMut": true,
1773
+ "isSigner": true
1774
+ },
1775
+ {
1776
+ "name": "systemProgram",
1777
+ "isMut": false,
1778
+ "isSigner": false
1779
+ },
1780
+ {
1781
+ "name": "rent",
1782
+ "isMut": false,
1783
+ "isSigner": false
1784
+ }
1785
+ ],
1786
+ "args": [
1787
+ {
1788
+ "name": "bundleIndex",
1789
+ "type": "u16"
1790
+ },
1791
+ {
1792
+ "name": "tickLowerIndex",
1793
+ "type": "i32"
1794
+ },
1795
+ {
1796
+ "name": "tickUpperIndex",
1797
+ "type": "i32"
1798
+ }
1799
+ ]
1800
+ },
1801
+ {
1802
+ "name": "closeBundledPosition",
1803
+ "docs": [
1804
+ "Close a bundled position in a Whirlpool.",
1805
+ "",
1806
+ "### Authority",
1807
+ "- `position_bundle_authority` - authority that owns the token corresponding to this desired position bundle.",
1808
+ "",
1809
+ "### Parameters",
1810
+ "- `bundle_index` - The bundle index that we'd like to close.",
1811
+ "",
1812
+ "#### Special Errors",
1813
+ "- `InvalidBundleIndex` - If the provided bundle index is out of bounds.",
1814
+ "- `ClosePositionNotEmpty` - The provided position account is not empty."
1815
+ ],
1816
+ "accounts": [
1817
+ {
1818
+ "name": "bundledPosition",
1819
+ "isMut": true,
1820
+ "isSigner": false
1821
+ },
1822
+ {
1823
+ "name": "positionBundle",
1824
+ "isMut": true,
1825
+ "isSigner": false
1826
+ },
1827
+ {
1828
+ "name": "positionBundleTokenAccount",
1829
+ "isMut": false,
1830
+ "isSigner": false
1831
+ },
1832
+ {
1833
+ "name": "positionBundleAuthority",
1834
+ "isMut": false,
1835
+ "isSigner": true
1836
+ },
1837
+ {
1838
+ "name": "receiver",
1839
+ "isMut": true,
1840
+ "isSigner": false
1841
+ }
1842
+ ],
1843
+ "args": [
1844
+ {
1845
+ "name": "bundleIndex",
1846
+ "type": "u16"
1847
+ }
1848
+ ]
1849
+ },
1850
+ {
1851
+ "name": "collectFeesV2",
1852
+ "docs": [
1853
+ "Collect fees accrued for this position.",
1854
+ "",
1855
+ "### Authority",
1856
+ "- `position_authority` - authority that owns the token corresponding to this desired position."
1857
+ ],
1858
+ "accounts": [
1859
+ {
1860
+ "name": "whirlpool",
1861
+ "isMut": false,
1862
+ "isSigner": false
1863
+ },
1864
+ {
1865
+ "name": "positionAuthority",
1866
+ "isMut": false,
1867
+ "isSigner": true
1868
+ },
1869
+ {
1870
+ "name": "position",
1871
+ "isMut": true,
1872
+ "isSigner": false
1873
+ },
1874
+ {
1875
+ "name": "positionTokenAccount",
1876
+ "isMut": false,
1877
+ "isSigner": false
1878
+ },
1879
+ {
1880
+ "name": "tokenMintA",
1881
+ "isMut": false,
1882
+ "isSigner": false
1883
+ },
1884
+ {
1885
+ "name": "tokenMintB",
1886
+ "isMut": false,
1887
+ "isSigner": false
1888
+ },
1889
+ {
1890
+ "name": "tokenOwnerAccountA",
1891
+ "isMut": true,
1892
+ "isSigner": false
1893
+ },
1894
+ {
1895
+ "name": "tokenVaultA",
1896
+ "isMut": true,
1897
+ "isSigner": false
1898
+ },
1899
+ {
1900
+ "name": "tokenOwnerAccountB",
1901
+ "isMut": true,
1902
+ "isSigner": false
1903
+ },
1904
+ {
1905
+ "name": "tokenVaultB",
1906
+ "isMut": true,
1907
+ "isSigner": false
1908
+ },
1909
+ {
1910
+ "name": "tokenProgramA",
1911
+ "isMut": false,
1912
+ "isSigner": false
1913
+ },
1914
+ {
1915
+ "name": "tokenProgramB",
1916
+ "isMut": false,
1917
+ "isSigner": false
1918
+ },
1919
+ {
1920
+ "name": "memoProgram",
1921
+ "isMut": false,
1922
+ "isSigner": false
1923
+ }
1924
+ ],
1925
+ "args": [
1926
+ {
1927
+ "name": "remainingAccountsInfo",
1928
+ "type": {
1929
+ "option": {
1930
+ "defined": "RemainingAccountsInfo"
1931
+ }
1932
+ }
1933
+ }
1934
+ ]
1935
+ },
1936
+ {
1937
+ "name": "collectProtocolFeesV2",
1938
+ "docs": [
1939
+ "Collect the protocol fees accrued in this Whirlpool",
1940
+ "",
1941
+ "### Authority",
1942
+ "- `collect_protocol_fees_authority` - assigned authority in the WhirlpoolConfig that can collect protocol fees"
1943
+ ],
1944
+ "accounts": [
1945
+ {
1946
+ "name": "whirlpoolsConfig",
1947
+ "isMut": false,
1948
+ "isSigner": false
1949
+ },
1950
+ {
1951
+ "name": "whirlpool",
1952
+ "isMut": true,
1953
+ "isSigner": false
1954
+ },
1955
+ {
1956
+ "name": "collectProtocolFeesAuthority",
1957
+ "isMut": false,
1958
+ "isSigner": true
1959
+ },
1960
+ {
1961
+ "name": "tokenMintA",
1962
+ "isMut": false,
1963
+ "isSigner": false
1964
+ },
1965
+ {
1966
+ "name": "tokenMintB",
1967
+ "isMut": false,
1968
+ "isSigner": false
1969
+ },
1970
+ {
1971
+ "name": "tokenVaultA",
1972
+ "isMut": true,
1973
+ "isSigner": false
1974
+ },
1975
+ {
1976
+ "name": "tokenVaultB",
1977
+ "isMut": true,
1978
+ "isSigner": false
1979
+ },
1980
+ {
1981
+ "name": "tokenDestinationA",
1982
+ "isMut": true,
1983
+ "isSigner": false
1984
+ },
1985
+ {
1986
+ "name": "tokenDestinationB",
1987
+ "isMut": true,
1988
+ "isSigner": false
1989
+ },
1990
+ {
1991
+ "name": "tokenProgramA",
1992
+ "isMut": false,
1993
+ "isSigner": false
1994
+ },
1995
+ {
1996
+ "name": "tokenProgramB",
1997
+ "isMut": false,
1998
+ "isSigner": false
1999
+ },
2000
+ {
2001
+ "name": "memoProgram",
2002
+ "isMut": false,
2003
+ "isSigner": false
2004
+ }
2005
+ ],
2006
+ "args": [
2007
+ {
2008
+ "name": "remainingAccountsInfo",
2009
+ "type": {
2010
+ "option": {
2011
+ "defined": "RemainingAccountsInfo"
2012
+ }
2013
+ }
2014
+ }
2015
+ ]
2016
+ },
2017
+ {
2018
+ "name": "collectRewardV2",
2019
+ "docs": [
2020
+ "Collect rewards accrued for this position.",
2021
+ "",
2022
+ "### Authority",
2023
+ "- `position_authority` - authority that owns the token corresponding to this desired position."
2024
+ ],
2025
+ "accounts": [
2026
+ {
2027
+ "name": "whirlpool",
2028
+ "isMut": false,
2029
+ "isSigner": false
2030
+ },
2031
+ {
2032
+ "name": "positionAuthority",
2033
+ "isMut": false,
2034
+ "isSigner": true
2035
+ },
2036
+ {
2037
+ "name": "position",
2038
+ "isMut": true,
2039
+ "isSigner": false
2040
+ },
2041
+ {
2042
+ "name": "positionTokenAccount",
2043
+ "isMut": false,
2044
+ "isSigner": false
2045
+ },
2046
+ {
2047
+ "name": "rewardOwnerAccount",
2048
+ "isMut": true,
2049
+ "isSigner": false
2050
+ },
2051
+ {
2052
+ "name": "rewardMint",
2053
+ "isMut": false,
2054
+ "isSigner": false
2055
+ },
2056
+ {
2057
+ "name": "rewardVault",
2058
+ "isMut": true,
2059
+ "isSigner": false
2060
+ },
2061
+ {
2062
+ "name": "rewardTokenProgram",
2063
+ "isMut": false,
2064
+ "isSigner": false
2065
+ },
2066
+ {
2067
+ "name": "memoProgram",
2068
+ "isMut": false,
2069
+ "isSigner": false
2070
+ }
2071
+ ],
2072
+ "args": [
2073
+ {
2074
+ "name": "rewardIndex",
2075
+ "type": "u8"
2076
+ },
2077
+ {
2078
+ "name": "remainingAccountsInfo",
2079
+ "type": {
2080
+ "option": {
2081
+ "defined": "RemainingAccountsInfo"
2082
+ }
2083
+ }
2084
+ }
2085
+ ]
2086
+ },
2087
+ {
2088
+ "name": "decreaseLiquidityV2",
2089
+ "docs": [
2090
+ "Withdraw liquidity from a position in the Whirlpool. This call also updates the position's accrued fees and rewards.",
2091
+ "",
2092
+ "### Authority",
2093
+ "- `position_authority` - authority that owns the token corresponding to this desired position.",
2094
+ "",
2095
+ "### Parameters",
2096
+ "- `liquidity_amount` - The total amount of Liquidity the user desires to withdraw.",
2097
+ "- `token_min_a` - The minimum amount of tokenA the user is willing to withdraw.",
2098
+ "- `token_min_b` - The minimum amount of tokenB the user is willing to withdraw.",
2099
+ "",
2100
+ "#### Special Errors",
2101
+ "- `LiquidityZero` - Provided liquidity amount is zero.",
2102
+ "- `LiquidityTooHigh` - Provided liquidity exceeds u128::max.",
2103
+ "- `TokenMinSubceeded` - The required token to perform this operation subceeds the user defined amount."
2104
+ ],
2105
+ "accounts": [
2106
+ {
2107
+ "name": "whirlpool",
2108
+ "isMut": true,
2109
+ "isSigner": false
2110
+ },
2111
+ {
2112
+ "name": "tokenProgramA",
2113
+ "isMut": false,
2114
+ "isSigner": false
2115
+ },
2116
+ {
2117
+ "name": "tokenProgramB",
2118
+ "isMut": false,
2119
+ "isSigner": false
2120
+ },
2121
+ {
2122
+ "name": "memoProgram",
2123
+ "isMut": false,
2124
+ "isSigner": false
2125
+ },
2126
+ {
2127
+ "name": "positionAuthority",
2128
+ "isMut": false,
2129
+ "isSigner": true
2130
+ },
2131
+ {
2132
+ "name": "position",
2133
+ "isMut": true,
2134
+ "isSigner": false
2135
+ },
2136
+ {
2137
+ "name": "positionTokenAccount",
2138
+ "isMut": false,
2139
+ "isSigner": false
2140
+ },
2141
+ {
2142
+ "name": "tokenMintA",
2143
+ "isMut": false,
2144
+ "isSigner": false
2145
+ },
2146
+ {
2147
+ "name": "tokenMintB",
2148
+ "isMut": false,
2149
+ "isSigner": false
2150
+ },
2151
+ {
2152
+ "name": "tokenOwnerAccountA",
2153
+ "isMut": true,
2154
+ "isSigner": false
2155
+ },
2156
+ {
2157
+ "name": "tokenOwnerAccountB",
2158
+ "isMut": true,
2159
+ "isSigner": false
2160
+ },
2161
+ {
2162
+ "name": "tokenVaultA",
2163
+ "isMut": true,
2164
+ "isSigner": false
2165
+ },
2166
+ {
2167
+ "name": "tokenVaultB",
2168
+ "isMut": true,
2169
+ "isSigner": false
2170
+ },
2171
+ {
2172
+ "name": "tickArrayLower",
2173
+ "isMut": true,
2174
+ "isSigner": false
2175
+ },
2176
+ {
2177
+ "name": "tickArrayUpper",
2178
+ "isMut": true,
2179
+ "isSigner": false
2180
+ }
2181
+ ],
2182
+ "args": [
2183
+ {
2184
+ "name": "liquidityAmount",
2185
+ "type": "u128"
2186
+ },
2187
+ {
2188
+ "name": "tokenMinA",
2189
+ "type": "u64"
2190
+ },
2191
+ {
2192
+ "name": "tokenMinB",
2193
+ "type": "u64"
2194
+ },
2195
+ {
2196
+ "name": "remainingAccountsInfo",
2197
+ "type": {
2198
+ "option": {
2199
+ "defined": "RemainingAccountsInfo"
2200
+ }
2201
+ }
2202
+ }
2203
+ ]
2204
+ },
2205
+ {
2206
+ "name": "increaseLiquidityV2",
2207
+ "docs": [
2208
+ "Add liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards.",
2209
+ "",
2210
+ "### Authority",
2211
+ "- `position_authority` - authority that owns the token corresponding to this desired position.",
2212
+ "",
2213
+ "### Parameters",
2214
+ "- `liquidity_amount` - The total amount of Liquidity the user is willing to deposit.",
2215
+ "- `token_max_a` - The maximum amount of tokenA the user is willing to deposit.",
2216
+ "- `token_max_b` - The maximum amount of tokenB the user is willing to deposit.",
2217
+ "",
2218
+ "#### Special Errors",
2219
+ "- `LiquidityZero` - Provided liquidity amount is zero.",
2220
+ "- `LiquidityTooHigh` - Provided liquidity exceeds u128::max.",
2221
+ "- `TokenMaxExceeded` - The required token to perform this operation exceeds the user defined amount."
2222
+ ],
2223
+ "accounts": [
2224
+ {
2225
+ "name": "whirlpool",
2226
+ "isMut": true,
2227
+ "isSigner": false
2228
+ },
2229
+ {
2230
+ "name": "tokenProgramA",
2231
+ "isMut": false,
2232
+ "isSigner": false
2233
+ },
2234
+ {
2235
+ "name": "tokenProgramB",
2236
+ "isMut": false,
2237
+ "isSigner": false
2238
+ },
2239
+ {
2240
+ "name": "memoProgram",
2241
+ "isMut": false,
2242
+ "isSigner": false
2243
+ },
2244
+ {
2245
+ "name": "positionAuthority",
2246
+ "isMut": false,
2247
+ "isSigner": true
2248
+ },
2249
+ {
2250
+ "name": "position",
2251
+ "isMut": true,
2252
+ "isSigner": false
2253
+ },
2254
+ {
2255
+ "name": "positionTokenAccount",
2256
+ "isMut": false,
2257
+ "isSigner": false
2258
+ },
2259
+ {
2260
+ "name": "tokenMintA",
2261
+ "isMut": false,
2262
+ "isSigner": false
2263
+ },
2264
+ {
2265
+ "name": "tokenMintB",
2266
+ "isMut": false,
2267
+ "isSigner": false
2268
+ },
2269
+ {
2270
+ "name": "tokenOwnerAccountA",
2271
+ "isMut": true,
2272
+ "isSigner": false
2273
+ },
2274
+ {
2275
+ "name": "tokenOwnerAccountB",
2276
+ "isMut": true,
2277
+ "isSigner": false
2278
+ },
2279
+ {
2280
+ "name": "tokenVaultA",
2281
+ "isMut": true,
2282
+ "isSigner": false
2283
+ },
2284
+ {
2285
+ "name": "tokenVaultB",
2286
+ "isMut": true,
2287
+ "isSigner": false
2288
+ },
2289
+ {
2290
+ "name": "tickArrayLower",
2291
+ "isMut": true,
2292
+ "isSigner": false
2293
+ },
2294
+ {
2295
+ "name": "tickArrayUpper",
2296
+ "isMut": true,
2297
+ "isSigner": false
2298
+ }
2299
+ ],
2300
+ "args": [
2301
+ {
2302
+ "name": "liquidityAmount",
2303
+ "type": "u128"
2304
+ },
2305
+ {
2306
+ "name": "tokenMaxA",
2307
+ "type": "u64"
2308
+ },
2309
+ {
2310
+ "name": "tokenMaxB",
2311
+ "type": "u64"
2312
+ },
2313
+ {
2314
+ "name": "remainingAccountsInfo",
2315
+ "type": {
2316
+ "option": {
2317
+ "defined": "RemainingAccountsInfo"
2318
+ }
2319
+ }
2320
+ }
2321
+ ]
2322
+ },
2323
+ {
2324
+ "name": "initializePoolV2",
2325
+ "docs": [
2326
+ "Initializes a Whirlpool account.",
2327
+ "Fee rate is set to the default values on the config and supplied fee_tier.",
2328
+ "",
2329
+ "### Parameters",
2330
+ "- `bumps` - The bump value when deriving the PDA of the Whirlpool address.",
2331
+ "- `tick_spacing` - The desired tick spacing for this pool.",
2332
+ "- `initial_sqrt_price` - The desired initial sqrt-price for this pool",
2333
+ "",
2334
+ "#### Special Errors",
2335
+ "`InvalidTokenMintOrder` - The order of mints have to be ordered by",
2336
+ "`SqrtPriceOutOfBounds` - provided initial_sqrt_price is not between 2^-64 to 2^64",
2337
+ ""
2338
+ ],
2339
+ "accounts": [
2340
+ {
2341
+ "name": "whirlpoolsConfig",
2342
+ "isMut": false,
2343
+ "isSigner": false
2344
+ },
2345
+ {
2346
+ "name": "tokenMintA",
2347
+ "isMut": false,
2348
+ "isSigner": false
2349
+ },
2350
+ {
2351
+ "name": "tokenMintB",
2352
+ "isMut": false,
2353
+ "isSigner": false
2354
+ },
2355
+ {
2356
+ "name": "tokenBadgeA",
2357
+ "isMut": false,
2358
+ "isSigner": false
2359
+ },
2360
+ {
2361
+ "name": "tokenBadgeB",
2362
+ "isMut": false,
2363
+ "isSigner": false
2364
+ },
2365
+ {
2366
+ "name": "funder",
2367
+ "isMut": true,
2368
+ "isSigner": true
2369
+ },
2370
+ {
2371
+ "name": "whirlpool",
2372
+ "isMut": true,
2373
+ "isSigner": false
2374
+ },
2375
+ {
2376
+ "name": "tokenVaultA",
2377
+ "isMut": true,
2378
+ "isSigner": true
2379
+ },
2380
+ {
2381
+ "name": "tokenVaultB",
2382
+ "isMut": true,
2383
+ "isSigner": true
2384
+ },
2385
+ {
2386
+ "name": "feeTier",
2387
+ "isMut": false,
2388
+ "isSigner": false
2389
+ },
2390
+ {
2391
+ "name": "tokenProgramA",
2392
+ "isMut": false,
2393
+ "isSigner": false
2394
+ },
2395
+ {
2396
+ "name": "tokenProgramB",
2397
+ "isMut": false,
2398
+ "isSigner": false
2399
+ },
2400
+ {
2401
+ "name": "systemProgram",
2402
+ "isMut": false,
2403
+ "isSigner": false
2404
+ },
2405
+ {
2406
+ "name": "rent",
2407
+ "isMut": false,
2408
+ "isSigner": false
2409
+ }
2410
+ ],
2411
+ "args": [
2412
+ {
2413
+ "name": "tickSpacing",
2414
+ "type": "u16"
2415
+ },
2416
+ {
2417
+ "name": "initialSqrtPrice",
2418
+ "type": "u128"
2419
+ }
2420
+ ]
2421
+ },
2422
+ {
2423
+ "name": "initializeRewardV2",
2424
+ "docs": [
2425
+ "Initialize reward for a Whirlpool. A pool can only support up to a set number of rewards.",
2426
+ "",
2427
+ "### Authority",
2428
+ "- \"reward_authority\" - assigned authority by the reward_super_authority for the specified",
2429
+ "reward-index in this Whirlpool",
2430
+ "",
2431
+ "### Parameters",
2432
+ "- `reward_index` - The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS)",
2433
+ "",
2434
+ "#### Special Errors",
2435
+ "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized",
2436
+ "index in this pool, or exceeds NUM_REWARDS, or",
2437
+ "all reward slots for this pool has been initialized."
2438
+ ],
2439
+ "accounts": [
2440
+ {
2441
+ "name": "rewardAuthority",
2442
+ "isMut": false,
2443
+ "isSigner": true
2444
+ },
2445
+ {
2446
+ "name": "funder",
2447
+ "isMut": true,
2448
+ "isSigner": true
2449
+ },
2450
+ {
2451
+ "name": "whirlpool",
2452
+ "isMut": true,
2453
+ "isSigner": false
2454
+ },
2455
+ {
2456
+ "name": "rewardMint",
2457
+ "isMut": false,
2458
+ "isSigner": false
2459
+ },
2460
+ {
2461
+ "name": "rewardTokenBadge",
2462
+ "isMut": false,
2463
+ "isSigner": false
2464
+ },
2465
+ {
2466
+ "name": "rewardVault",
2467
+ "isMut": true,
2468
+ "isSigner": true
2469
+ },
2470
+ {
2471
+ "name": "rewardTokenProgram",
2472
+ "isMut": false,
2473
+ "isSigner": false
2474
+ },
2475
+ {
2476
+ "name": "systemProgram",
2477
+ "isMut": false,
2478
+ "isSigner": false
2479
+ },
2480
+ {
2481
+ "name": "rent",
2482
+ "isMut": false,
2483
+ "isSigner": false
2484
+ }
2485
+ ],
2486
+ "args": [
2487
+ {
2488
+ "name": "rewardIndex",
2489
+ "type": "u8"
2490
+ }
2491
+ ]
2492
+ },
2493
+ {
2494
+ "name": "setRewardEmissionsV2",
2495
+ "docs": [
2496
+ "Set the reward emissions for a reward in a Whirlpool.",
2497
+ "",
2498
+ "### Authority",
2499
+ "- \"reward_authority\" - assigned authority by the reward_super_authority for the specified",
2500
+ "reward-index in this Whirlpool",
2501
+ "",
2502
+ "### Parameters",
2503
+ "- `reward_index` - The reward index (0 <= index <= NUM_REWARDS) that we'd like to modify.",
2504
+ "- `emissions_per_second_x64` - The amount of rewards emitted in this pool.",
2505
+ "",
2506
+ "#### Special Errors",
2507
+ "- `RewardVaultAmountInsufficient` - The amount of rewards in the reward vault cannot emit",
2508
+ "more than a day of desired emissions.",
2509
+ "- `InvalidTimestamp` - Provided timestamp is not in order with the previous timestamp.",
2510
+ "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized",
2511
+ "index in this pool, or exceeds NUM_REWARDS, or",
2512
+ "all reward slots for this pool has been initialized."
2513
+ ],
2514
+ "accounts": [
2515
+ {
2516
+ "name": "whirlpool",
2517
+ "isMut": true,
2518
+ "isSigner": false
2519
+ },
2520
+ {
2521
+ "name": "rewardAuthority",
2522
+ "isMut": false,
2523
+ "isSigner": true
2524
+ },
2525
+ {
2526
+ "name": "rewardVault",
2527
+ "isMut": false,
2528
+ "isSigner": false
2529
+ }
2530
+ ],
2531
+ "args": [
2532
+ {
2533
+ "name": "rewardIndex",
2534
+ "type": "u8"
2535
+ },
2536
+ {
2537
+ "name": "emissionsPerSecondX64",
2538
+ "type": "u128"
2539
+ }
2540
+ ]
2541
+ },
2542
+ {
2543
+ "name": "swapV2",
2544
+ "docs": [
2545
+ "Perform a swap in this Whirlpool",
2546
+ "",
2547
+ "### Authority",
2548
+ "- \"token_authority\" - The authority to withdraw tokens from the input token account.",
2549
+ "",
2550
+ "### Parameters",
2551
+ "- `amount` - The amount of input or output token to swap from (depending on amount_specified_is_input).",
2552
+ "- `other_amount_threshold` - The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).",
2553
+ "- `sqrt_price_limit` - The maximum/minimum price the swap will swap to.",
2554
+ "- `amount_specified_is_input` - Specifies the token the parameter `amount`represents. If true, the amount represents the input token of the swap.",
2555
+ "- `a_to_b` - The direction of the swap. True if swapping from A to B. False if swapping from B to A.",
2556
+ "",
2557
+ "#### Special Errors",
2558
+ "- `ZeroTradableAmount` - User provided parameter `amount` is 0.",
2559
+ "- `InvalidSqrtPriceLimitDirection` - User provided parameter `sqrt_price_limit` does not match the direction of the trade.",
2560
+ "- `SqrtPriceOutOfBounds` - User provided parameter `sqrt_price_limit` is over Whirlppool's max/min bounds for sqrt-price.",
2561
+ "- `InvalidTickArraySequence` - User provided tick-arrays are not in sequential order required to proceed in this trade direction.",
2562
+ "- `TickArraySequenceInvalidIndex` - The swap loop attempted to access an invalid array index during the query of the next initialized tick.",
2563
+ "- `TickArrayIndexOutofBounds` - The swap loop attempted to access an invalid array index during tick crossing.",
2564
+ "- `LiquidityOverflow` - Liquidity value overflowed 128bits during tick crossing.",
2565
+ "- `InvalidTickSpacing` - The swap pool was initialized with tick-spacing of 0."
2566
+ ],
2567
+ "accounts": [
2568
+ {
2569
+ "name": "tokenProgramA",
2570
+ "isMut": false,
2571
+ "isSigner": false
2572
+ },
2573
+ {
2574
+ "name": "tokenProgramB",
2575
+ "isMut": false,
2576
+ "isSigner": false
2577
+ },
2578
+ {
2579
+ "name": "memoProgram",
2580
+ "isMut": false,
2581
+ "isSigner": false
2582
+ },
2583
+ {
2584
+ "name": "tokenAuthority",
2585
+ "isMut": false,
2586
+ "isSigner": true
2587
+ },
2588
+ {
2589
+ "name": "whirlpool",
2590
+ "isMut": true,
2591
+ "isSigner": false
2592
+ },
2593
+ {
2594
+ "name": "tokenMintA",
2595
+ "isMut": false,
2596
+ "isSigner": false
2597
+ },
2598
+ {
2599
+ "name": "tokenMintB",
2600
+ "isMut": false,
2601
+ "isSigner": false
2602
+ },
2603
+ {
2604
+ "name": "tokenOwnerAccountA",
2605
+ "isMut": true,
2606
+ "isSigner": false
2607
+ },
2608
+ {
2609
+ "name": "tokenVaultA",
2610
+ "isMut": true,
2611
+ "isSigner": false
2612
+ },
2613
+ {
2614
+ "name": "tokenOwnerAccountB",
2615
+ "isMut": true,
2616
+ "isSigner": false
2617
+ },
2618
+ {
2619
+ "name": "tokenVaultB",
2620
+ "isMut": true,
2621
+ "isSigner": false
2622
+ },
2623
+ {
2624
+ "name": "tickArray0",
2625
+ "isMut": true,
2626
+ "isSigner": false
2627
+ },
2628
+ {
2629
+ "name": "tickArray1",
2630
+ "isMut": true,
2631
+ "isSigner": false
2632
+ },
2633
+ {
2634
+ "name": "tickArray2",
2635
+ "isMut": true,
2636
+ "isSigner": false
2637
+ },
2638
+ {
2639
+ "name": "oracle",
2640
+ "isMut": true,
2641
+ "isSigner": false
2642
+ }
2643
+ ],
2644
+ "args": [
2645
+ {
2646
+ "name": "amount",
2647
+ "type": "u64"
2648
+ },
2649
+ {
2650
+ "name": "otherAmountThreshold",
2651
+ "type": "u64"
2652
+ },
2653
+ {
2654
+ "name": "sqrtPriceLimit",
2655
+ "type": "u128"
2656
+ },
2657
+ {
2658
+ "name": "amountSpecifiedIsInput",
2659
+ "type": "bool"
2660
+ },
2661
+ {
2662
+ "name": "aToB",
2663
+ "type": "bool"
2664
+ },
2665
+ {
2666
+ "name": "remainingAccountsInfo",
2667
+ "type": {
2668
+ "option": {
2669
+ "defined": "RemainingAccountsInfo"
2670
+ }
2671
+ }
2672
+ }
2673
+ ]
2674
+ },
2675
+ {
2676
+ "name": "twoHopSwapV2",
2677
+ "docs": [
2678
+ "Perform a two-hop swap in this Whirlpool",
2679
+ "",
2680
+ "### Authority",
2681
+ "- \"token_authority\" - The authority to withdraw tokens from the input token account.",
2682
+ "",
2683
+ "### Parameters",
2684
+ "- `amount` - The amount of input or output token to swap from (depending on amount_specified_is_input).",
2685
+ "- `other_amount_threshold` - The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).",
2686
+ "- `amount_specified_is_input` - Specifies the token the parameter `amount`represents. If true, the amount represents the input token of the swap.",
2687
+ "- `a_to_b_one` - The direction of the swap of hop one. True if swapping from A to B. False if swapping from B to A.",
2688
+ "- `a_to_b_two` - The direction of the swap of hop two. True if swapping from A to B. False if swapping from B to A.",
2689
+ "- `sqrt_price_limit_one` - The maximum/minimum price the swap will swap to in the first hop.",
2690
+ "- `sqrt_price_limit_two` - The maximum/minimum price the swap will swap to in the second hop.",
2691
+ "",
2692
+ "#### Special Errors",
2693
+ "- `ZeroTradableAmount` - User provided parameter `amount` is 0.",
2694
+ "- `InvalidSqrtPriceLimitDirection` - User provided parameter `sqrt_price_limit` does not match the direction of the trade.",
2695
+ "- `SqrtPriceOutOfBounds` - User provided parameter `sqrt_price_limit` is over Whirlppool's max/min bounds for sqrt-price.",
2696
+ "- `InvalidTickArraySequence` - User provided tick-arrays are not in sequential order required to proceed in this trade direction.",
2697
+ "- `TickArraySequenceInvalidIndex` - The swap loop attempted to access an invalid array index during the query of the next initialized tick.",
2698
+ "- `TickArrayIndexOutofBounds` - The swap loop attempted to access an invalid array index during tick crossing.",
2699
+ "- `LiquidityOverflow` - Liquidity value overflowed 128bits during tick crossing.",
2700
+ "- `InvalidTickSpacing` - The swap pool was initialized with tick-spacing of 0.",
2701
+ "- `InvalidIntermediaryMint` - Error if the intermediary mint between hop one and two do not equal.",
2702
+ "- `DuplicateTwoHopPool` - Error if whirlpool one & two are the same pool."
2703
+ ],
2704
+ "accounts": [
2705
+ {
2706
+ "name": "whirlpoolOne",
2707
+ "isMut": true,
2708
+ "isSigner": false
2709
+ },
2710
+ {
2711
+ "name": "whirlpoolTwo",
2712
+ "isMut": true,
2713
+ "isSigner": false
2714
+ },
2715
+ {
2716
+ "name": "tokenMintInput",
2717
+ "isMut": false,
2718
+ "isSigner": false
2719
+ },
2720
+ {
2721
+ "name": "tokenMintIntermediate",
2722
+ "isMut": false,
2723
+ "isSigner": false
2724
+ },
2725
+ {
2726
+ "name": "tokenMintOutput",
2727
+ "isMut": false,
2728
+ "isSigner": false
2729
+ },
2730
+ {
2731
+ "name": "tokenProgramInput",
2732
+ "isMut": false,
2733
+ "isSigner": false
2734
+ },
2735
+ {
2736
+ "name": "tokenProgramIntermediate",
2737
+ "isMut": false,
2738
+ "isSigner": false
2739
+ },
2740
+ {
2741
+ "name": "tokenProgramOutput",
2742
+ "isMut": false,
2743
+ "isSigner": false
2744
+ },
2745
+ {
2746
+ "name": "tokenOwnerAccountInput",
2747
+ "isMut": true,
2748
+ "isSigner": false
2749
+ },
2750
+ {
2751
+ "name": "tokenVaultOneInput",
2752
+ "isMut": true,
2753
+ "isSigner": false
2754
+ },
2755
+ {
2756
+ "name": "tokenVaultOneIntermediate",
2757
+ "isMut": true,
2758
+ "isSigner": false
2759
+ },
2760
+ {
2761
+ "name": "tokenVaultTwoIntermediate",
2762
+ "isMut": true,
2763
+ "isSigner": false
2764
+ },
2765
+ {
2766
+ "name": "tokenVaultTwoOutput",
2767
+ "isMut": true,
2768
+ "isSigner": false
2769
+ },
2770
+ {
2771
+ "name": "tokenOwnerAccountOutput",
2772
+ "isMut": true,
2773
+ "isSigner": false
2774
+ },
2775
+ {
2776
+ "name": "tokenAuthority",
2777
+ "isMut": false,
2778
+ "isSigner": true
2779
+ },
2780
+ {
2781
+ "name": "tickArrayOne0",
2782
+ "isMut": true,
2783
+ "isSigner": false
2784
+ },
2785
+ {
2786
+ "name": "tickArrayOne1",
2787
+ "isMut": true,
2788
+ "isSigner": false
2789
+ },
2790
+ {
2791
+ "name": "tickArrayOne2",
2792
+ "isMut": true,
2793
+ "isSigner": false
2794
+ },
2795
+ {
2796
+ "name": "tickArrayTwo0",
2797
+ "isMut": true,
2798
+ "isSigner": false
2799
+ },
2800
+ {
2801
+ "name": "tickArrayTwo1",
2802
+ "isMut": true,
2803
+ "isSigner": false
2804
+ },
2805
+ {
2806
+ "name": "tickArrayTwo2",
2807
+ "isMut": true,
2808
+ "isSigner": false
2809
+ },
2810
+ {
2811
+ "name": "oracleOne",
2812
+ "isMut": true,
2813
+ "isSigner": false
2814
+ },
2815
+ {
2816
+ "name": "oracleTwo",
2817
+ "isMut": true,
2818
+ "isSigner": false
2819
+ },
2820
+ {
2821
+ "name": "memoProgram",
2822
+ "isMut": false,
2823
+ "isSigner": false
2824
+ }
2825
+ ],
2826
+ "args": [
2827
+ {
2828
+ "name": "amount",
2829
+ "type": "u64"
2830
+ },
2831
+ {
2832
+ "name": "otherAmountThreshold",
2833
+ "type": "u64"
2834
+ },
2835
+ {
2836
+ "name": "amountSpecifiedIsInput",
2837
+ "type": "bool"
2838
+ },
2839
+ {
2840
+ "name": "aToBOne",
2841
+ "type": "bool"
2842
+ },
2843
+ {
2844
+ "name": "aToBTwo",
2845
+ "type": "bool"
2846
+ },
2847
+ {
2848
+ "name": "sqrtPriceLimitOne",
2849
+ "type": "u128"
2850
+ },
2851
+ {
2852
+ "name": "sqrtPriceLimitTwo",
2853
+ "type": "u128"
2854
+ },
2855
+ {
2856
+ "name": "remainingAccountsInfo",
2857
+ "type": {
2858
+ "option": {
2859
+ "defined": "RemainingAccountsInfo"
2860
+ }
2861
+ }
2862
+ }
2863
+ ]
2864
+ },
2865
+ {
2866
+ "name": "initializeConfigExtension",
2867
+ "accounts": [
2868
+ {
2869
+ "name": "config",
2870
+ "isMut": false,
2871
+ "isSigner": false
2872
+ },
2873
+ {
2874
+ "name": "configExtension",
2875
+ "isMut": true,
2876
+ "isSigner": false
2877
+ },
2878
+ {
2879
+ "name": "funder",
2880
+ "isMut": true,
2881
+ "isSigner": true
2882
+ },
2883
+ {
2884
+ "name": "feeAuthority",
2885
+ "isMut": false,
2886
+ "isSigner": true
2887
+ },
2888
+ {
2889
+ "name": "systemProgram",
2890
+ "isMut": false,
2891
+ "isSigner": false
2892
+ }
2893
+ ],
2894
+ "args": []
2895
+ },
2896
+ {
2897
+ "name": "setConfigExtensionAuthority",
2898
+ "accounts": [
2899
+ {
2900
+ "name": "whirlpoolsConfig",
2901
+ "isMut": false,
2902
+ "isSigner": false
2903
+ },
2904
+ {
2905
+ "name": "whirlpoolsConfigExtension",
2906
+ "isMut": true,
2907
+ "isSigner": false
2908
+ },
2909
+ {
2910
+ "name": "configExtensionAuthority",
2911
+ "isMut": false,
2912
+ "isSigner": true
2913
+ },
2914
+ {
2915
+ "name": "newConfigExtensionAuthority",
2916
+ "isMut": false,
2917
+ "isSigner": false
2918
+ }
2919
+ ],
2920
+ "args": []
2921
+ },
2922
+ {
2923
+ "name": "setTokenBadgeAuthority",
2924
+ "accounts": [
2925
+ {
2926
+ "name": "whirlpoolsConfig",
2927
+ "isMut": false,
2928
+ "isSigner": false
2929
+ },
2930
+ {
2931
+ "name": "whirlpoolsConfigExtension",
2932
+ "isMut": true,
2933
+ "isSigner": false
2934
+ },
2935
+ {
2936
+ "name": "configExtensionAuthority",
2937
+ "isMut": false,
2938
+ "isSigner": true
2939
+ },
2940
+ {
2941
+ "name": "newTokenBadgeAuthority",
2942
+ "isMut": false,
2943
+ "isSigner": false
2944
+ }
2945
+ ],
2946
+ "args": []
2947
+ },
2948
+ {
2949
+ "name": "initializeTokenBadge",
2950
+ "accounts": [
2951
+ {
2952
+ "name": "whirlpoolsConfig",
2953
+ "isMut": false,
2954
+ "isSigner": false
2955
+ },
2956
+ {
2957
+ "name": "whirlpoolsConfigExtension",
2958
+ "isMut": false,
2959
+ "isSigner": false
2960
+ },
2961
+ {
2962
+ "name": "tokenBadgeAuthority",
2963
+ "isMut": false,
2964
+ "isSigner": true
2965
+ },
2966
+ {
2967
+ "name": "tokenMint",
2968
+ "isMut": false,
2969
+ "isSigner": false
2970
+ },
2971
+ {
2972
+ "name": "tokenBadge",
2973
+ "isMut": true,
2974
+ "isSigner": false
2975
+ },
2976
+ {
2977
+ "name": "funder",
2978
+ "isMut": true,
2979
+ "isSigner": true
2980
+ },
2981
+ {
2982
+ "name": "systemProgram",
2983
+ "isMut": false,
2984
+ "isSigner": false
2985
+ }
2986
+ ],
2987
+ "args": []
2988
+ },
2989
+ {
2990
+ "name": "deleteTokenBadge",
2991
+ "accounts": [
2992
+ {
2993
+ "name": "whirlpoolsConfig",
2994
+ "isMut": false,
2995
+ "isSigner": false
2996
+ },
2997
+ {
2998
+ "name": "whirlpoolsConfigExtension",
2999
+ "isMut": false,
3000
+ "isSigner": false
3001
+ },
3002
+ {
3003
+ "name": "tokenBadgeAuthority",
3004
+ "isMut": false,
3005
+ "isSigner": true
3006
+ },
3007
+ {
3008
+ "name": "tokenMint",
3009
+ "isMut": false,
3010
+ "isSigner": false
3011
+ },
3012
+ {
3013
+ "name": "tokenBadge",
3014
+ "isMut": true,
3015
+ "isSigner": false
3016
+ },
3017
+ {
3018
+ "name": "receiver",
3019
+ "isMut": true,
3020
+ "isSigner": false
3021
+ }
3022
+ ],
3023
+ "args": []
3024
+ }
3025
+ ],
3026
+ "accounts": [
3027
+ {
3028
+ "name": "whirlpoolsConfigExtension",
3029
+ "type": {
3030
+ "kind": "struct",
3031
+ "fields": [
3032
+ {
3033
+ "name": "whirlpoolsConfig",
3034
+ "type": "publicKey",
3035
+ },
3036
+ {
3037
+ "name": "configExtensionAuthority",
3038
+ "type": "publicKey",
3039
+ },
3040
+ {
3041
+ "name": "tokenBadgeAuthority",
3042
+ "type": "publicKey",
3043
+ }
3044
+ ],
3045
+ },
3046
+ },
3047
+ {
3048
+ "name": "whirlpoolsConfig",
3049
+ "type": {
3050
+ "kind": "struct",
3051
+ "fields": [
3052
+ {
3053
+ "name": "feeAuthority",
3054
+ "type": "publicKey"
3055
+ },
3056
+ {
3057
+ "name": "collectProtocolFeesAuthority",
3058
+ "type": "publicKey"
3059
+ },
3060
+ {
3061
+ "name": "rewardEmissionsSuperAuthority",
3062
+ "type": "publicKey"
3063
+ },
3064
+ {
3065
+ "name": "defaultProtocolFeeRate",
3066
+ "type": "u16"
3067
+ }
3068
+ ]
3069
+ }
3070
+ },
3071
+ {
3072
+ "name": "feeTier",
3073
+ "type": {
3074
+ "kind": "struct",
3075
+ "fields": [
3076
+ {
3077
+ "name": "whirlpoolsConfig",
3078
+ "type": "publicKey"
3079
+ },
3080
+ {
3081
+ "name": "tickSpacing",
3082
+ "type": "u16"
3083
+ },
3084
+ {
3085
+ "name": "defaultFeeRate",
3086
+ "type": "u16"
3087
+ }
3088
+ ]
3089
+ }
3090
+ },
3091
+ {
3092
+ "name": "positionBundle",
3093
+ "type": {
3094
+ "kind": "struct",
3095
+ "fields": [
3096
+ {
3097
+ "name": "positionBundleMint",
3098
+ "type": "publicKey"
3099
+ },
3100
+ {
3101
+ "name": "positionBitmap",
3102
+ "type": {
3103
+ "array": [
3104
+ "u8",
3105
+ 32
3106
+ ]
3107
+ }
3108
+ }
3109
+ ]
3110
+ }
3111
+ },
3112
+ {
3113
+ "name": "position",
3114
+ "type": {
3115
+ "kind": "struct",
3116
+ "fields": [
3117
+ {
3118
+ "name": "whirlpool",
3119
+ "type": "publicKey"
3120
+ },
3121
+ {
3122
+ "name": "positionMint",
3123
+ "type": "publicKey"
3124
+ },
3125
+ {
3126
+ "name": "liquidity",
3127
+ "type": "u128"
3128
+ },
3129
+ {
3130
+ "name": "tickLowerIndex",
3131
+ "type": "i32"
3132
+ },
3133
+ {
3134
+ "name": "tickUpperIndex",
3135
+ "type": "i32"
3136
+ },
3137
+ {
3138
+ "name": "feeGrowthCheckpointA",
3139
+ "type": "u128"
3140
+ },
3141
+ {
3142
+ "name": "feeOwedA",
3143
+ "type": "u64"
3144
+ },
3145
+ {
3146
+ "name": "feeGrowthCheckpointB",
3147
+ "type": "u128"
3148
+ },
3149
+ {
3150
+ "name": "feeOwedB",
3151
+ "type": "u64"
3152
+ },
3153
+ {
3154
+ "name": "rewardInfos",
3155
+ "type": {
3156
+ "array": [
3157
+ {
3158
+ "defined": "PositionRewardInfo"
3159
+ },
3160
+ 3
3161
+ ]
3162
+ }
3163
+ }
3164
+ ]
3165
+ }
3166
+ },
3167
+ {
3168
+ "name": "tickArray",
3169
+ "type": {
3170
+ "kind": "struct",
3171
+ "fields": [
3172
+ {
3173
+ "name": "startTickIndex",
3174
+ "type": "i32"
3175
+ },
3176
+ {
3177
+ "name": "ticks",
3178
+ "type": {
3179
+ "array": [
3180
+ {
3181
+ "defined": "Tick"
3182
+ },
3183
+ 88
3184
+ ]
3185
+ }
3186
+ },
3187
+ {
3188
+ "name": "whirlpool",
3189
+ "type": "publicKey"
3190
+ }
3191
+ ]
3192
+ }
3193
+ },
3194
+ {
3195
+ "name": "tokenBadge",
3196
+ "type": {
3197
+ "kind": "struct",
3198
+ "fields": [
3199
+ {
3200
+ "name": "whirlpoolsConfig",
3201
+ "type": "publicKey"
3202
+ },
3203
+ {
3204
+ "name": "tokenMint",
3205
+ "type": "publicKey"
3206
+ }
3207
+ ]
3208
+ }
3209
+ },
3210
+ {
3211
+ "name": "whirlpool",
3212
+ "type": {
3213
+ "kind": "struct",
3214
+ "fields": [
3215
+ {
3216
+ "name": "whirlpoolsConfig",
3217
+ "type": "publicKey"
3218
+ },
3219
+ {
3220
+ "name": "whirlpoolBump",
3221
+ "type": {
3222
+ "array": [
3223
+ "u8",
3224
+ 1
3225
+ ]
3226
+ }
3227
+ },
3228
+ {
3229
+ "name": "tickSpacing",
3230
+ "type": "u16"
3231
+ },
3232
+ {
3233
+ "name": "tickSpacingSeed",
3234
+ "type": {
3235
+ "array": [
3236
+ "u8",
3237
+ 2
3238
+ ]
3239
+ }
3240
+ },
3241
+ {
3242
+ "name": "feeRate",
3243
+ "type": "u16"
3244
+ },
3245
+ {
3246
+ "name": "protocolFeeRate",
3247
+ "type": "u16"
3248
+ },
3249
+ {
3250
+ "name": "liquidity",
3251
+ "type": "u128"
3252
+ },
3253
+ {
3254
+ "name": "sqrtPrice",
3255
+ "type": "u128"
3256
+ },
3257
+ {
3258
+ "name": "tickCurrentIndex",
3259
+ "type": "i32"
3260
+ },
3261
+ {
3262
+ "name": "protocolFeeOwedA",
3263
+ "type": "u64"
3264
+ },
3265
+ {
3266
+ "name": "protocolFeeOwedB",
3267
+ "type": "u64"
3268
+ },
3269
+ {
3270
+ "name": "tokenMintA",
3271
+ "type": "publicKey"
3272
+ },
3273
+ {
3274
+ "name": "tokenVaultA",
3275
+ "type": "publicKey"
3276
+ },
3277
+ {
3278
+ "name": "feeGrowthGlobalA",
3279
+ "type": "u128"
3280
+ },
3281
+ {
3282
+ "name": "tokenMintB",
3283
+ "type": "publicKey"
3284
+ },
3285
+ {
3286
+ "name": "tokenVaultB",
3287
+ "type": "publicKey"
3288
+ },
3289
+ {
3290
+ "name": "feeGrowthGlobalB",
3291
+ "type": "u128"
3292
+ },
3293
+ {
3294
+ "name": "rewardLastUpdatedTimestamp",
3295
+ "type": "u64"
3296
+ },
3297
+ {
3298
+ "name": "rewardInfos",
3299
+ "type": {
3300
+ "array": [
3301
+ {
3302
+ "defined": "WhirlpoolRewardInfo"
3303
+ },
3304
+ 3
3305
+ ]
3306
+ }
3307
+ }
3308
+ ]
3309
+ }
3310
+ }
3311
+ ],
3312
+ "types": [
3313
+ {
3314
+ "name": "OpenPositionBumps",
3315
+ "type": {
3316
+ "kind": "struct",
3317
+ "fields": [
3318
+ {
3319
+ "name": "positionBump",
3320
+ "type": "u8"
3321
+ }
3322
+ ]
3323
+ }
3324
+ },
3325
+ {
3326
+ "name": "OpenPositionWithMetadataBumps",
3327
+ "type": {
3328
+ "kind": "struct",
3329
+ "fields": [
3330
+ {
3331
+ "name": "positionBump",
3332
+ "type": "u8"
3333
+ },
3334
+ {
3335
+ "name": "metadataBump",
3336
+ "type": "u8"
3337
+ }
3338
+ ]
3339
+ }
3340
+ },
3341
+ {
3342
+ "name": "PositionRewardInfo",
3343
+ "type": {
3344
+ "kind": "struct",
3345
+ "fields": [
3346
+ {
3347
+ "name": "growthInsideCheckpoint",
3348
+ "type": "u128"
3349
+ },
3350
+ {
3351
+ "name": "amountOwed",
3352
+ "type": "u64"
3353
+ }
3354
+ ]
3355
+ }
3356
+ },
3357
+ {
3358
+ "name": "Tick",
3359
+ "type": {
3360
+ "kind": "struct",
3361
+ "fields": [
3362
+ {
3363
+ "name": "initialized",
3364
+ "type": "bool"
3365
+ },
3366
+ {
3367
+ "name": "liquidityNet",
3368
+ "type": "i128"
3369
+ },
3370
+ {
3371
+ "name": "liquidityGross",
3372
+ "type": "u128"
3373
+ },
3374
+ {
3375
+ "name": "feeGrowthOutsideA",
3376
+ "type": "u128"
3377
+ },
3378
+ {
3379
+ "name": "feeGrowthOutsideB",
3380
+ "type": "u128"
3381
+ },
3382
+ {
3383
+ "name": "rewardGrowthsOutside",
3384
+ "type": {
3385
+ "array": [
3386
+ "u128",
3387
+ 3
3388
+ ]
3389
+ }
3390
+ }
3391
+ ]
3392
+ }
3393
+ },
3394
+ {
3395
+ "name": "WhirlpoolRewardInfo",
3396
+ "docs": [
3397
+ "Stores the state relevant for tracking liquidity mining rewards at the `Whirlpool` level.",
3398
+ "These values are used in conjunction with `PositionRewardInfo`, `Tick.reward_growths_outside`,",
3399
+ "and `Whirlpool.reward_last_updated_timestamp` to determine how many rewards are earned by open",
3400
+ "positions."
3401
+ ],
3402
+ "type": {
3403
+ "kind": "struct",
3404
+ "fields": [
3405
+ {
3406
+ "name": "mint",
3407
+ "docs": [
3408
+ "Reward token mint."
3409
+ ],
3410
+ "type": "publicKey"
3411
+ },
3412
+ {
3413
+ "name": "vault",
3414
+ "docs": [
3415
+ "Reward vault token account."
3416
+ ],
3417
+ "type": "publicKey"
3418
+ },
3419
+ {
3420
+ "name": "authority",
3421
+ "docs": [
3422
+ "Authority account that has permission to initialize the reward and set emissions."
3423
+ ],
3424
+ "type": "publicKey"
3425
+ },
3426
+ {
3427
+ "name": "emissionsPerSecondX64",
3428
+ "docs": [
3429
+ "Q64.64 number that indicates how many tokens per second are earned per unit of liquidity."
3430
+ ],
3431
+ "type": "u128"
3432
+ },
3433
+ {
3434
+ "name": "growthGlobalX64",
3435
+ "docs": [
3436
+ "Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward",
3437
+ "emissions were turned on."
3438
+ ],
3439
+ "type": "u128"
3440
+ }
3441
+ ]
3442
+ }
3443
+ },
3444
+ {
3445
+ "name": "WhirlpoolBumps",
3446
+ "type": {
3447
+ "kind": "struct",
3448
+ "fields": [
3449
+ {
3450
+ "name": "whirlpoolBump",
3451
+ "type": "u8"
3452
+ }
3453
+ ]
3454
+ }
3455
+ },
3456
+ {
3457
+ "name": "RemainingAccountsSlice",
3458
+ "type": {
3459
+ "kind": "struct",
3460
+ "fields": [
3461
+ {
3462
+ "name": "accountsType",
3463
+ "type": {
3464
+ "defined": "AccountsType"
3465
+ }
3466
+ },
3467
+ {
3468
+ "name": "length",
3469
+ "type": "u8"
3470
+ }
3471
+ ]
3472
+ }
3473
+ },
3474
+ {
3475
+ "name": "RemainingAccountsInfo",
3476
+ "type": {
3477
+ "kind": "struct",
3478
+ "fields": [
3479
+ {
3480
+ "name": "slices",
3481
+ "type": {
3482
+ "vec": {
3483
+ "defined": "RemainingAccountsSlice"
3484
+ }
3485
+ }
3486
+ }
3487
+ ]
3488
+ }
3489
+ },
3490
+ {
3491
+ "name": "CurrIndex",
3492
+ "type": {
3493
+ "kind": "enum",
3494
+ "variants": [
3495
+ {
3496
+ "name": "Below"
3497
+ },
3498
+ {
3499
+ "name": "Inside"
3500
+ },
3501
+ {
3502
+ "name": "Above"
3503
+ }
3504
+ ]
3505
+ }
3506
+ },
3507
+ {
3508
+ "name": "TickLabel",
3509
+ "type": {
3510
+ "kind": "enum",
3511
+ "variants": [
3512
+ {
3513
+ "name": "Upper"
3514
+ },
3515
+ {
3516
+ "name": "Lower"
3517
+ }
3518
+ ]
3519
+ }
3520
+ },
3521
+ {
3522
+ "name": "Direction",
3523
+ "type": {
3524
+ "kind": "enum",
3525
+ "variants": [
3526
+ {
3527
+ "name": "Left"
3528
+ },
3529
+ {
3530
+ "name": "Right"
3531
+ }
3532
+ ]
3533
+ }
3534
+ },
3535
+ {
3536
+ "name": "AccountsType",
3537
+ "type": {
3538
+ "kind": "enum",
3539
+ "variants": [
3540
+ {
3541
+ "name": "TransferHookA",
3542
+ },
3543
+ {
3544
+ "name": "TransferHookB",
3545
+ },
3546
+ {
3547
+ "name": "TransferHookReward",
3548
+ },
3549
+ {
3550
+ "name": "TransferHookInput",
3551
+ },
3552
+ {
3553
+ "name": "TransferHookIntermediate",
3554
+ },
3555
+ {
3556
+ "name": "TransferHookOutput",
3557
+ }
3558
+ ]
3559
+ }
3560
+ }
3561
+ ],
3562
+ "errors": [
3563
+ {
3564
+ "code": 6000,
3565
+ "name": "InvalidEnum",
3566
+ "msg": "Enum value could not be converted",
3567
+ },
3568
+ {
3569
+ "code": 6001,
3570
+ "name": "InvalidStartTick",
3571
+ "msg": "Invalid start tick index provided.",
3572
+ },
3573
+ {
3574
+ "code": 6002,
3575
+ "name": "TickArrayExistInPool",
3576
+ "msg": "Tick-array already exists in this whirlpool",
3577
+ },
3578
+ {
3579
+ "code": 6003,
3580
+ "name": "TickArrayIndexOutofBounds",
3581
+ "msg": "Attempt to search for a tick-array failed",
3582
+ },
3583
+ {
3584
+ "code": 6004,
3585
+ "name": "InvalidTickSpacing",
3586
+ "msg": "Tick-spacing is not supported",
3587
+ },
3588
+ {
3589
+ "code": 6005,
3590
+ "name": "ClosePositionNotEmpty",
3591
+ "msg": "Position is not empty It cannot be closed",
3592
+ },
3593
+ {
3594
+ "code": 6006,
3595
+ "name": "DivideByZero",
3596
+ "msg": "Unable to divide by zero",
3597
+ },
3598
+ {
3599
+ "code": 6007,
3600
+ "name": "NumberCastError",
3601
+ "msg": "Unable to cast number into BigInt",
3602
+ },
3603
+ {
3604
+ "code": 6008,
3605
+ "name": "NumberDownCastError",
3606
+ "msg": "Unable to down cast number",
3607
+ },
3608
+ {
3609
+ "code": 6009,
3610
+ "name": "TickNotFound",
3611
+ "msg": "Tick not found within tick array",
3612
+ },
3613
+ {
3614
+ "code": 6010,
3615
+ "name": "InvalidTickIndex",
3616
+ "msg": "Provided tick index is either out of bounds or uninitializable",
3617
+ },
3618
+ {
3619
+ "code": 6011,
3620
+ "name": "SqrtPriceOutOfBounds",
3621
+ "msg": "Provided sqrt price out of bounds",
3622
+ },
3623
+ {
3624
+ "code": 6012,
3625
+ "name": "LiquidityZero",
3626
+ "msg": "Liquidity amount must be greater than zero",
3627
+ },
3628
+ {
3629
+ "code": 6013,
3630
+ "name": "LiquidityTooHigh",
3631
+ "msg": "Liquidity amount must be less than i64::MAX",
3632
+ },
3633
+ {
3634
+ "code": 6014,
3635
+ "name": "LiquidityOverflow",
3636
+ "msg": "Liquidity overflow",
3637
+ },
3638
+ {
3639
+ "code": 6015,
3640
+ "name": "LiquidityUnderflow",
3641
+ "msg": "Liquidity underflow",
3642
+ },
3643
+ {
3644
+ "code": 6016,
3645
+ "name": "LiquidityNetError",
3646
+ "msg": "Tick liquidity net underflowed or overflowed",
3647
+ },
3648
+ {
3649
+ "code": 6017,
3650
+ "name": "TokenMaxExceeded",
3651
+ "msg": "Exceeded token max",
3652
+ },
3653
+ {
3654
+ "code": 6018,
3655
+ "name": "TokenMinSubceeded",
3656
+ "msg": "Did not meet token min",
3657
+ },
3658
+ {
3659
+ "code": 6019,
3660
+ "name": "MissingOrInvalidDelegate",
3661
+ "msg": "Position token account has a missing or invalid delegate",
3662
+ },
3663
+ {
3664
+ "code": 6020,
3665
+ "name": "InvalidPositionTokenAmount",
3666
+ "msg": "Position token amount must be 1",
3667
+ },
3668
+ {
3669
+ "code": 6021,
3670
+ "name": "InvalidTimestampConversion",
3671
+ "msg": "Timestamp should be convertible from i64 to u64",
3672
+ },
3673
+ {
3674
+ "code": 6022,
3675
+ "name": "InvalidTimestamp",
3676
+ "msg": "Timestamp should be greater than the last updated timestamp",
3677
+ },
3678
+ {
3679
+ "code": 6023,
3680
+ "name": "InvalidTickArraySequence",
3681
+ "msg": "Invalid tick array sequence provided for instruction.",
3682
+ },
3683
+ {
3684
+ "code": 6024,
3685
+ "name": "InvalidTokenMintOrder",
3686
+ "msg": "Token Mint in wrong order",
3687
+ },
3688
+ {
3689
+ "code": 6025,
3690
+ "name": "RewardNotInitialized",
3691
+ "msg": "Reward not initialized",
3692
+ },
3693
+ {
3694
+ "code": 6026,
3695
+ "name": "InvalidRewardIndex",
3696
+ "msg": "Invalid reward index",
3697
+ },
3698
+ {
3699
+ "code": 6027,
3700
+ "name": "RewardVaultAmountInsufficient",
3701
+ "msg": "Reward vault requires amount to support emissions for at least one day",
3702
+ },
3703
+ {
3704
+ "code": 6028,
3705
+ "name": "FeeRateMaxExceeded",
3706
+ "msg": "Exceeded max fee rate",
3707
+ },
3708
+ {
3709
+ "code": 6029,
3710
+ "name": "ProtocolFeeRateMaxExceeded",
3711
+ "msg": "Exceeded max protocol fee rate",
3712
+ },
3713
+ {
3714
+ "code": 6030,
3715
+ "name": "MultiplicationShiftRightOverflow",
3716
+ "msg": "Multiplication with shift right overflow",
3717
+ },
3718
+ {
3719
+ "code": 6031,
3720
+ "name": "MulDivOverflow",
3721
+ "msg": "Muldiv overflow",
3722
+ },
3723
+ {
3724
+ "code": 6032,
3725
+ "name": "MulDivInvalidInput",
3726
+ "msg": "Invalid div_u256 input",
3727
+ },
3728
+ {
3729
+ "code": 6033,
3730
+ "name": "MultiplicationOverflow",
3731
+ "msg": "Multiplication overflow",
3732
+ },
3733
+ {
3734
+ "code": 6034,
3735
+ "name": "InvalidSqrtPriceLimitDirection",
3736
+ "msg": "Provided SqrtPriceLimit not in the same direction as the swap.",
3737
+ },
3738
+ {
3739
+ "code": 6035,
3740
+ "name": "ZeroTradableAmount",
3741
+ "msg": "There are no tradable amount to swap.",
3742
+ },
3743
+ {
3744
+ "code": 6036,
3745
+ "name": "AmountOutBelowMinimum",
3746
+ "msg": "Amount out below minimum threshold",
3747
+ },
3748
+ {
3749
+ "code": 6037,
3750
+ "name": "AmountInAboveMaximum",
3751
+ "msg": "Amount in above maximum threshold",
3752
+ },
3753
+ {
3754
+ "code": 6038,
3755
+ "name": "TickArraySequenceInvalidIndex",
3756
+ "msg": "Invalid index for tick array sequence",
3757
+ },
3758
+ {
3759
+ "code": 6039,
3760
+ "name": "AmountCalcOverflow",
3761
+ "msg": "Amount calculated overflows",
3762
+ },
3763
+ {
3764
+ "code": 6040,
3765
+ "name": "AmountRemainingOverflow",
3766
+ "msg": "Amount remaining overflows",
3767
+ },
3768
+ {
3769
+ "code": 6041,
3770
+ "name": "InvalidIntermediaryMint",
3771
+ "msg": "Invalid intermediary mint",
3772
+ },
3773
+ {
3774
+ "code": 6042,
3775
+ "name": "DuplicateTwoHopPool",
3776
+ "msg": "Duplicate two hop pool",
3777
+ },
3778
+ {
3779
+ "code": 6043,
3780
+ "name": "InvalidBundleIndex",
3781
+ "msg": "Bundle index is out of bounds",
3782
+ },
3783
+ {
3784
+ "code": 6044,
3785
+ "name": "BundledPositionAlreadyOpened",
3786
+ "msg": "Position has already been opened",
3787
+ },
3788
+ {
3789
+ "code": 6045,
3790
+ "name": "BundledPositionAlreadyClosed",
3791
+ "msg": "Position has already been closed",
3792
+ },
3793
+ {
3794
+ "code": 6046,
3795
+ "name": "PositionBundleNotDeletable",
3796
+ "msg": "Unable to delete PositionBundle with open positions",
3797
+ },
3798
+ {
3799
+ "code": 6047,
3800
+ "name": "UnsupportedTokenMint",
3801
+ "msg": "Token mint has unsupported attributes",
3802
+ },
3803
+ {
3804
+ "code": 6048,
3805
+ "name": "RemainingAccountsInvalidSlice",
3806
+ "msg": "Invalid remaining accounts",
3807
+ },
3808
+ {
3809
+ "code": 6049,
3810
+ "name": "RemainingAccountsInsufficient",
3811
+ "msg": "Insufficient remaining accounts",
3812
+ },
3813
+ {
3814
+ "code": 6050,
3815
+ "name": "NoExtraAccountsForTransferHook",
3816
+ "msg": "Unable to call transfer hook without extra accounts",
3817
+ },
3818
+ {
3819
+ "code": 6051,
3820
+ "name": "IntermediateTokenAmountMismatch",
3821
+ "msg": "Output and input amount mismatch",
3822
+ },
3823
+ {
3824
+ "code": 6052,
3825
+ "name": "TransferFeeCalculationError",
3826
+ "msg": "Transfer fee calculation failed",
3827
+ },
3828
+ {
3829
+ "code": 6053,
3830
+ "name": "RemainingAccountsDuplicatedAccountsType",
3831
+ "msg": "Same accounts type is provided more than once",
3832
+ }
3833
+ ]
3834
+ };