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