@meteora-ag/cp-amm-sdk 1.0.12-rc.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -13,7 +13,7 @@ type CpAmm$1 = {
13
13
  address: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
14
14
  metadata: {
15
15
  name: "cpAmm";
16
- version: "0.1.1";
16
+ version: "0.1.3";
17
17
  spec: "0.1.0";
18
18
  description: "Created with Anchor";
19
19
  };
@@ -130,29 +130,7 @@ type CpAmm$1 = {
130
130
  accounts: [
131
131
  {
132
132
  name: "poolAuthority";
133
- pda: {
134
- seeds: [
135
- {
136
- kind: "const";
137
- value: [
138
- 112,
139
- 111,
140
- 111,
141
- 108,
142
- 95,
143
- 97,
144
- 117,
145
- 116,
146
- 104,
147
- 111,
148
- 114,
149
- 105,
150
- 116,
151
- 121
152
- ];
153
- }
154
- ];
155
- };
133
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
156
134
  },
157
135
  {
158
136
  name: "pool";
@@ -253,29 +231,7 @@ type CpAmm$1 = {
253
231
  accounts: [
254
232
  {
255
233
  name: "poolAuthority";
256
- pda: {
257
- seeds: [
258
- {
259
- kind: "const";
260
- value: [
261
- 112,
262
- 111,
263
- 111,
264
- 108,
265
- 95,
266
- 97,
267
- 117,
268
- 116,
269
- 104,
270
- 111,
271
- 114,
272
- 105,
273
- 116,
274
- 121
275
- ];
276
- }
277
- ];
278
- };
234
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
279
235
  },
280
236
  {
281
237
  name: "pool";
@@ -375,29 +331,7 @@ type CpAmm$1 = {
375
331
  accounts: [
376
332
  {
377
333
  name: "poolAuthority";
378
- pda: {
379
- seeds: [
380
- {
381
- kind: "const";
382
- value: [
383
- 112,
384
- 111,
385
- 111,
386
- 108,
387
- 95,
388
- 97,
389
- 117,
390
- 116,
391
- 104,
392
- 111,
393
- 114,
394
- 105,
395
- 116,
396
- 121
397
- ];
398
- }
399
- ];
400
- };
334
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
401
335
  },
402
336
  {
403
337
  name: "pool";
@@ -658,7 +592,16 @@ type CpAmm$1 = {
658
592
  name: "program";
659
593
  }
660
594
  ];
661
- args: [];
595
+ args: [
596
+ {
597
+ name: "maxAmountA";
598
+ type: "u64";
599
+ },
600
+ {
601
+ name: "maxAmountB";
602
+ type: "u64";
603
+ }
604
+ ];
662
605
  },
663
606
  {
664
607
  name: "claimReward";
@@ -666,29 +609,7 @@ type CpAmm$1 = {
666
609
  accounts: [
667
610
  {
668
611
  name: "poolAuthority";
669
- pda: {
670
- seeds: [
671
- {
672
- kind: "const";
673
- value: [
674
- 112,
675
- 111,
676
- 111,
677
- 108,
678
- 95,
679
- 97,
680
- 117,
681
- 116,
682
- 104,
683
- 111,
684
- 114,
685
- 105,
686
- 116,
687
- 121
688
- ];
689
- }
690
- ];
691
- };
612
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
692
613
  },
693
614
  {
694
615
  name: "pool";
@@ -760,6 +681,10 @@ type CpAmm$1 = {
760
681
  {
761
682
  name: "rewardIndex";
762
683
  type: "u8";
684
+ },
685
+ {
686
+ name: "skipReward";
687
+ type: "u8";
763
688
  }
764
689
  ];
765
690
  },
@@ -891,15 +816,38 @@ type CpAmm$1 = {
891
816
  },
892
817
  {
893
818
  name: "poolAuthority";
819
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
820
+ },
821
+ {
822
+ name: "rentReceiver";
823
+ writable: true;
824
+ },
825
+ {
826
+ name: "owner";
827
+ docs: ["Owner of position"];
828
+ signer: true;
829
+ },
830
+ {
831
+ name: "tokenProgram";
832
+ docs: [
833
+ "Program to create NFT mint/token account and transfer for token22 account"
834
+ ];
835
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
836
+ },
837
+ {
838
+ name: "eventAuthority";
894
839
  pda: {
895
840
  seeds: [
896
841
  {
897
842
  kind: "const";
898
843
  value: [
899
- 112,
900
- 111,
901
- 111,
902
- 108,
844
+ 95,
845
+ 95,
846
+ 101,
847
+ 118,
848
+ 101,
849
+ 110,
850
+ 116,
903
851
  95,
904
852
  97,
905
853
  117,
@@ -916,20 +864,27 @@ type CpAmm$1 = {
916
864
  };
917
865
  },
918
866
  {
919
- name: "rentReceiver";
867
+ name: "program";
868
+ }
869
+ ];
870
+ args: [];
871
+ },
872
+ {
873
+ name: "closeTokenBadge";
874
+ discriminator: [108, 146, 86, 110, 179, 254, 10, 104];
875
+ accounts: [
876
+ {
877
+ name: "tokenBadge";
920
878
  writable: true;
921
879
  },
922
880
  {
923
- name: "owner";
924
- docs: ["Owner of position"];
881
+ name: "admin";
882
+ writable: true;
925
883
  signer: true;
926
884
  },
927
885
  {
928
- name: "tokenProgram";
929
- docs: [
930
- "Program to create NFT mint/token account and transfer for token22 account"
931
- ];
932
- address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
886
+ name: "rentReceiver";
887
+ writable: true;
933
888
  },
934
889
  {
935
890
  name: "eventAuthority";
@@ -1261,29 +1216,7 @@ type CpAmm$1 = {
1261
1216
  },
1262
1217
  {
1263
1218
  name: "poolAuthority";
1264
- pda: {
1265
- seeds: [
1266
- {
1267
- kind: "const";
1268
- value: [
1269
- 112,
1270
- 111,
1271
- 111,
1272
- 108,
1273
- 95,
1274
- 97,
1275
- 117,
1276
- 116,
1277
- 104,
1278
- 111,
1279
- 114,
1280
- 105,
1281
- 116,
1282
- 121
1283
- ];
1284
- }
1285
- ];
1286
- };
1219
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
1287
1220
  },
1288
1221
  {
1289
1222
  name: "payer";
@@ -1537,29 +1470,7 @@ type CpAmm$1 = {
1537
1470
  },
1538
1471
  {
1539
1472
  name: "poolAuthority";
1540
- pda: {
1541
- seeds: [
1542
- {
1543
- kind: "const";
1544
- value: [
1545
- 112,
1546
- 111,
1547
- 111,
1548
- 108,
1549
- 95,
1550
- 97,
1551
- 117,
1552
- 116,
1553
- 104,
1554
- 111,
1555
- 114,
1556
- 105,
1557
- 116,
1558
- 121
1559
- ];
1560
- }
1561
- ];
1562
- };
1473
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
1563
1474
  },
1564
1475
  {
1565
1476
  name: "pool";
@@ -1769,29 +1680,7 @@ type CpAmm$1 = {
1769
1680
  },
1770
1681
  {
1771
1682
  name: "poolAuthority";
1772
- pda: {
1773
- seeds: [
1774
- {
1775
- kind: "const";
1776
- value: [
1777
- 112,
1778
- 111,
1779
- 111,
1780
- 108,
1781
- 95,
1782
- 97,
1783
- 117,
1784
- 116,
1785
- 104,
1786
- 111,
1787
- 114,
1788
- 105,
1789
- 116,
1790
- 121
1791
- ];
1792
- }
1793
- ];
1794
- };
1683
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
1795
1684
  },
1796
1685
  {
1797
1686
  name: "pool";
@@ -2005,29 +1894,7 @@ type CpAmm$1 = {
2005
1894
  },
2006
1895
  {
2007
1896
  name: "poolAuthority";
2008
- pda: {
2009
- seeds: [
2010
- {
2011
- kind: "const";
2012
- value: [
2013
- 112,
2014
- 111,
2015
- 111,
2016
- 108,
2017
- 95,
2018
- 97,
2019
- 117,
2020
- 116,
2021
- 104,
2022
- 111,
2023
- 114,
2024
- 105,
2025
- 116,
2026
- 121
2027
- ];
2028
- }
2029
- ];
2030
- };
1897
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
2031
1898
  },
2032
1899
  {
2033
1900
  name: "pool";
@@ -2179,29 +2046,7 @@ type CpAmm$1 = {
2179
2046
  accounts: [
2180
2047
  {
2181
2048
  name: "poolAuthority";
2182
- pda: {
2183
- seeds: [
2184
- {
2185
- kind: "const";
2186
- value: [
2187
- 112,
2188
- 111,
2189
- 111,
2190
- 108,
2191
- 95,
2192
- 97,
2193
- 117,
2194
- 116,
2195
- 104,
2196
- 111,
2197
- 114,
2198
- 105,
2199
- 116,
2200
- 121
2201
- ];
2202
- }
2203
- ];
2204
- };
2049
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
2205
2050
  },
2206
2051
  {
2207
2052
  name: "pool";
@@ -2244,7 +2089,11 @@ type CpAmm$1 = {
2244
2089
  name: "rewardMint";
2245
2090
  },
2246
2091
  {
2247
- name: "admin";
2092
+ name: "signer";
2093
+ signer: true;
2094
+ },
2095
+ {
2096
+ name: "payer";
2248
2097
  writable: true;
2249
2098
  signer: true;
2250
2099
  },
@@ -2472,29 +2321,7 @@ type CpAmm$1 = {
2472
2321
  accounts: [
2473
2322
  {
2474
2323
  name: "poolAuthority";
2475
- pda: {
2476
- seeds: [
2477
- {
2478
- kind: "const";
2479
- value: [
2480
- 112,
2481
- 111,
2482
- 111,
2483
- 108,
2484
- 95,
2485
- 97,
2486
- 117,
2487
- 116,
2488
- 104,
2489
- 111,
2490
- 114,
2491
- 105,
2492
- 116,
2493
- 121
2494
- ];
2495
- }
2496
- ];
2497
- };
2324
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
2498
2325
  },
2499
2326
  {
2500
2327
  name: "pool";
@@ -2604,29 +2431,7 @@ type CpAmm$1 = {
2604
2431
  accounts: [
2605
2432
  {
2606
2433
  name: "poolAuthority";
2607
- pda: {
2608
- seeds: [
2609
- {
2610
- kind: "const";
2611
- value: [
2612
- 112,
2613
- 111,
2614
- 111,
2615
- 108,
2616
- 95,
2617
- 97,
2618
- 117,
2619
- 116,
2620
- 104,
2621
- 111,
2622
- 114,
2623
- 105,
2624
- 116,
2625
- 121
2626
- ];
2627
- }
2628
- ];
2629
- };
2434
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
2630
2435
  },
2631
2436
  {
2632
2437
  name: "pool";
@@ -2783,20 +2588,56 @@ type CpAmm$1 = {
2783
2588
  ];
2784
2589
  },
2785
2590
  {
2786
- name: "swap";
2787
- discriminator: [248, 198, 158, 145, 225, 117, 135, 200];
2591
+ name: "splitPosition";
2592
+ discriminator: [172, 241, 221, 138, 161, 29, 253, 42];
2788
2593
  accounts: [
2789
2594
  {
2790
- name: "poolAuthority";
2595
+ name: "pool";
2596
+ writable: true;
2597
+ relations: ["firstPosition", "secondPosition"];
2598
+ },
2599
+ {
2600
+ name: "firstPosition";
2601
+ docs: ["The first position"];
2602
+ writable: true;
2603
+ },
2604
+ {
2605
+ name: "firstPositionNftAccount";
2606
+ docs: ["The token account for position nft"];
2607
+ },
2608
+ {
2609
+ name: "secondPosition";
2610
+ docs: ["The second position"];
2611
+ writable: true;
2612
+ },
2613
+ {
2614
+ name: "secondPositionNftAccount";
2615
+ docs: ["The token account for position nft"];
2616
+ },
2617
+ {
2618
+ name: "firstOwner";
2619
+ docs: ["Owner of first position"];
2620
+ signer: true;
2621
+ },
2622
+ {
2623
+ name: "secondOwner";
2624
+ docs: ["Owner of second position"];
2625
+ signer: true;
2626
+ },
2627
+ {
2628
+ name: "eventAuthority";
2791
2629
  pda: {
2792
2630
  seeds: [
2793
2631
  {
2794
2632
  kind: "const";
2795
2633
  value: [
2796
- 112,
2797
- 111,
2798
- 111,
2799
- 108,
2634
+ 95,
2635
+ 95,
2636
+ 101,
2637
+ 118,
2638
+ 101,
2639
+ 110,
2640
+ 116,
2800
2641
  95,
2801
2642
  97,
2802
2643
  117,
@@ -2812,6 +2653,29 @@ type CpAmm$1 = {
2812
2653
  ];
2813
2654
  };
2814
2655
  },
2656
+ {
2657
+ name: "program";
2658
+ }
2659
+ ];
2660
+ args: [
2661
+ {
2662
+ name: "params";
2663
+ type: {
2664
+ defined: {
2665
+ name: "splitPositionParameters";
2666
+ };
2667
+ };
2668
+ }
2669
+ ];
2670
+ },
2671
+ {
2672
+ name: "swap";
2673
+ discriminator: [248, 198, 158, 145, 225, 117, 135, 200];
2674
+ accounts: [
2675
+ {
2676
+ name: "poolAuthority";
2677
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
2678
+ },
2815
2679
  {
2816
2680
  name: "pool";
2817
2681
  docs: ["Pool account"];
@@ -2919,7 +2783,7 @@ type CpAmm$1 = {
2919
2783
  writable: true;
2920
2784
  },
2921
2785
  {
2922
- name: "admin";
2786
+ name: "signer";
2923
2787
  signer: true;
2924
2788
  },
2925
2789
  {
@@ -2975,7 +2839,7 @@ type CpAmm$1 = {
2975
2839
  writable: true;
2976
2840
  },
2977
2841
  {
2978
- name: "admin";
2842
+ name: "signer";
2979
2843
  signer: true;
2980
2844
  },
2981
2845
  {
@@ -3028,29 +2892,7 @@ type CpAmm$1 = {
3028
2892
  accounts: [
3029
2893
  {
3030
2894
  name: "poolAuthority";
3031
- pda: {
3032
- seeds: [
3033
- {
3034
- kind: "const";
3035
- value: [
3036
- 112,
3037
- 111,
3038
- 111,
3039
- 108,
3040
- 95,
3041
- 97,
3042
- 117,
3043
- 116,
3044
- 104,
3045
- 111,
3046
- 114,
3047
- 105,
3048
- 116,
3049
- 121
3050
- ];
3051
- }
3052
- ];
3053
- };
2895
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC";
3054
2896
  },
3055
2897
  {
3056
2898
  name: "pool";
@@ -3222,6 +3064,10 @@ type CpAmm$1 = {
3222
3064
  name: "evtSetPoolStatus";
3223
3065
  discriminator: [100, 213, 74, 3, 95, 91, 228, 146];
3224
3066
  },
3067
+ {
3068
+ name: "evtSplitPosition";
3069
+ discriminator: [182, 138, 42, 254, 27, 94, 82, 221];
3070
+ },
3225
3071
  {
3226
3072
  name: "evtSwap";
3227
3073
  discriminator: [27, 60, 21, 213, 138, 170, 187, 147];
@@ -3449,6 +3295,31 @@ type CpAmm$1 = {
3449
3295
  code: 6041;
3450
3296
  name: "invalidConfigType";
3451
3297
  msg: "Invalid config type";
3298
+ },
3299
+ {
3300
+ code: 6042;
3301
+ name: "invalidPoolCreator";
3302
+ msg: "Invalid pool creator";
3303
+ },
3304
+ {
3305
+ code: 6043;
3306
+ name: "rewardVaultFrozenSkipRequired";
3307
+ msg: "Reward vault is frozen, must skip reward to proceed";
3308
+ },
3309
+ {
3310
+ code: 6044;
3311
+ name: "invalidSplitPositionParameters";
3312
+ msg: "Invalid parameters for split position";
3313
+ },
3314
+ {
3315
+ code: 6045;
3316
+ name: "unsupportPositionHasVestingLock";
3317
+ msg: "Unsupported split position has vesting lock";
3318
+ },
3319
+ {
3320
+ code: 6046;
3321
+ name: "samePosition";
3322
+ msg: "Same position";
3452
3323
  }
3453
3324
  ];
3454
3325
  types: [
@@ -4207,6 +4078,18 @@ type CpAmm$1 = {
4207
4078
  {
4208
4079
  name: "transferFeeExcludedAmountIn";
4209
4080
  type: "u64";
4081
+ },
4082
+ {
4083
+ name: "rewardDurationEnd";
4084
+ type: "u64";
4085
+ },
4086
+ {
4087
+ name: "preRewardRate";
4088
+ type: "u128";
4089
+ },
4090
+ {
4091
+ name: "postRewardRate";
4092
+ type: "u128";
4210
4093
  }
4211
4094
  ];
4212
4095
  };
@@ -4324,6 +4207,10 @@ type CpAmm$1 = {
4324
4207
  name: "funder";
4325
4208
  type: "pubkey";
4326
4209
  },
4210
+ {
4211
+ name: "creator";
4212
+ type: "pubkey";
4213
+ },
4327
4214
  {
4328
4215
  name: "rewardIndex";
4329
4216
  type: "u8";
@@ -4455,6 +4342,70 @@ type CpAmm$1 = {
4455
4342
  ];
4456
4343
  };
4457
4344
  },
4345
+ {
4346
+ name: "evtSplitPosition";
4347
+ type: {
4348
+ kind: "struct";
4349
+ fields: [
4350
+ {
4351
+ name: "pool";
4352
+ type: "pubkey";
4353
+ },
4354
+ {
4355
+ name: "firstOwner";
4356
+ type: "pubkey";
4357
+ },
4358
+ {
4359
+ name: "secondOwner";
4360
+ type: "pubkey";
4361
+ },
4362
+ {
4363
+ name: "firstPosition";
4364
+ type: "pubkey";
4365
+ },
4366
+ {
4367
+ name: "secondPosition";
4368
+ type: "pubkey";
4369
+ },
4370
+ {
4371
+ name: "currentSqrtPrice";
4372
+ type: "u128";
4373
+ },
4374
+ {
4375
+ name: "amountSplits";
4376
+ type: {
4377
+ defined: {
4378
+ name: "splitAmountInfo";
4379
+ };
4380
+ };
4381
+ },
4382
+ {
4383
+ name: "firstPositionInfo";
4384
+ type: {
4385
+ defined: {
4386
+ name: "splitPositionInfo";
4387
+ };
4388
+ };
4389
+ },
4390
+ {
4391
+ name: "secondPositionInfo";
4392
+ type: {
4393
+ defined: {
4394
+ name: "splitPositionInfo";
4395
+ };
4396
+ };
4397
+ },
4398
+ {
4399
+ name: "splitPositionParameters";
4400
+ type: {
4401
+ defined: {
4402
+ name: "splitPositionParameters";
4403
+ };
4404
+ };
4405
+ }
4406
+ ];
4407
+ };
4408
+ },
4458
4409
  {
4459
4410
  name: "evtSwap";
4460
4411
  type: {
@@ -4823,11 +4774,16 @@ type CpAmm$1 = {
4823
4774
  };
4824
4775
  };
4825
4776
  },
4777
+ {
4778
+ name: "creator";
4779
+ docs: ["pool creator"];
4780
+ type: "pubkey";
4781
+ },
4826
4782
  {
4827
4783
  name: "padding1";
4828
4784
  docs: ["Padding for further use"];
4829
4785
  type: {
4830
- array: ["u64", 10];
4786
+ array: ["u64", 6];
4831
4787
  };
4832
4788
  },
4833
4789
  {
@@ -4857,25 +4813,17 @@ type CpAmm$1 = {
4857
4813
  name: "baseFee";
4858
4814
  docs: ["Base fee"];
4859
4815
  type: {
4860
- defined: {
4861
- name: "baseFeeParameters";
4862
- };
4863
- };
4864
- },
4865
- {
4866
- name: "protocolFeePercent";
4867
- docs: ["Protocol trade fee percent"];
4868
- type: "u8";
4869
- },
4870
- {
4871
- name: "partnerFeePercent";
4872
- docs: ["partner fee percent"];
4873
- type: "u8";
4816
+ defined: {
4817
+ name: "baseFeeParameters";
4818
+ };
4819
+ };
4874
4820
  },
4875
4821
  {
4876
- name: "referralFeePercent";
4877
- docs: ["referral fee percent"];
4878
- type: "u8";
4822
+ name: "padding";
4823
+ docs: ["padding"];
4824
+ type: {
4825
+ array: ["u8", 3];
4826
+ };
4879
4827
  },
4880
4828
  {
4881
4829
  name: "dynamicFee";
@@ -5282,6 +5230,123 @@ type CpAmm$1 = {
5282
5230
  ];
5283
5231
  };
5284
5232
  },
5233
+ {
5234
+ name: "splitAmountInfo";
5235
+ type: {
5236
+ kind: "struct";
5237
+ fields: [
5238
+ {
5239
+ name: "permanentLockedLiquidity";
5240
+ type: "u128";
5241
+ },
5242
+ {
5243
+ name: "unlockedLiquidity";
5244
+ type: "u128";
5245
+ },
5246
+ {
5247
+ name: "feeA";
5248
+ type: "u64";
5249
+ },
5250
+ {
5251
+ name: "feeB";
5252
+ type: "u64";
5253
+ },
5254
+ {
5255
+ name: "reward0";
5256
+ type: "u64";
5257
+ },
5258
+ {
5259
+ name: "reward1";
5260
+ type: "u64";
5261
+ }
5262
+ ];
5263
+ };
5264
+ },
5265
+ {
5266
+ name: "splitPositionInfo";
5267
+ type: {
5268
+ kind: "struct";
5269
+ fields: [
5270
+ {
5271
+ name: "liquidity";
5272
+ type: "u128";
5273
+ },
5274
+ {
5275
+ name: "feeA";
5276
+ type: "u64";
5277
+ },
5278
+ {
5279
+ name: "feeB";
5280
+ type: "u64";
5281
+ },
5282
+ {
5283
+ name: "reward0";
5284
+ type: "u64";
5285
+ },
5286
+ {
5287
+ name: "reward1";
5288
+ type: "u64";
5289
+ }
5290
+ ];
5291
+ };
5292
+ },
5293
+ {
5294
+ name: "splitPositionParameters";
5295
+ type: {
5296
+ kind: "struct";
5297
+ fields: [
5298
+ {
5299
+ name: "unlockedLiquidityPercentage";
5300
+ docs: [
5301
+ "Percentage of unlocked liquidity to split to the second position"
5302
+ ];
5303
+ type: "u8";
5304
+ },
5305
+ {
5306
+ name: "permanentLockedLiquidityPercentage";
5307
+ docs: [
5308
+ "Percentage of permanent locked liquidity to split to the second position"
5309
+ ];
5310
+ type: "u8";
5311
+ },
5312
+ {
5313
+ name: "feeAPercentage";
5314
+ docs: [
5315
+ "Percentage of fee A pending to split to the second position"
5316
+ ];
5317
+ type: "u8";
5318
+ },
5319
+ {
5320
+ name: "feeBPercentage";
5321
+ docs: [
5322
+ "Percentage of fee B pending to split to the second position"
5323
+ ];
5324
+ type: "u8";
5325
+ },
5326
+ {
5327
+ name: "reward0Percentage";
5328
+ docs: [
5329
+ "Percentage of reward 0 pending to split to the second position"
5330
+ ];
5331
+ type: "u8";
5332
+ },
5333
+ {
5334
+ name: "reward1Percentage";
5335
+ docs: [
5336
+ "Percentage of reward 1 pending to split to the second position"
5337
+ ];
5338
+ type: "u8";
5339
+ },
5340
+ {
5341
+ name: "padding";
5342
+ docs: ["padding for future"];
5343
+ type: {
5344
+ array: ["u8", 16];
5345
+ };
5346
+ }
5347
+ ];
5348
+ };
5349
+ },
5285
5350
  {
5286
5351
  name: "staticConfigParameters";
5287
5352
  type: {
@@ -5564,9 +5629,7 @@ type BaseFee = {
5564
5629
  };
5565
5630
  type PoolFeesParams = {
5566
5631
  baseFee: BaseFee;
5567
- protocolFeePercent: number;
5568
- partnerFeePercent: number;
5569
- referralFeePercent: number;
5632
+ padding: number[];
5570
5633
  dynamicFee: DynamicFee | null;
5571
5634
  };
5572
5635
  type PrepareTokenAccountParams = {
@@ -5830,6 +5893,8 @@ type GetQuoteParams = {
5830
5893
  mint: Mint;
5831
5894
  currentEpoch: number;
5832
5895
  };
5896
+ tokenADecimal: number;
5897
+ tokenBDecimal: number;
5833
5898
  };
5834
5899
  type SwapAmount = {
5835
5900
  outputAmount: BN;
@@ -5850,6 +5915,8 @@ type GetQuoteExactOutParams = {
5850
5915
  mint: Mint;
5851
5916
  currentEpoch: number;
5852
5917
  };
5918
+ tokenADecimal: number;
5919
+ tokenBDecimal: number;
5853
5920
  };
5854
5921
  type SwapResult = {
5855
5922
  outputAmount: BN;
@@ -6007,6 +6074,7 @@ type ClaimRewardParams = {
6007
6074
  positionState: PositionState;
6008
6075
  positionNftAccount: PublicKey;
6009
6076
  rewardIndex: number;
6077
+ skipReward: number;
6010
6078
  feePayer?: PublicKey;
6011
6079
  };
6012
6080
  type RefreshVestingParams = {
@@ -6068,6 +6136,21 @@ type DynamicFeeParams = {
6068
6136
  binStep: number;
6069
6137
  variableFeeControl: number;
6070
6138
  };
6139
+ type SplitPositionParams = {
6140
+ firstPositionOwner: PublicKey;
6141
+ secondPositionOwner: PublicKey;
6142
+ pool: PublicKey;
6143
+ firstPosition: PublicKey;
6144
+ firstPositionNftAccount: PublicKey;
6145
+ secondPosition: PublicKey;
6146
+ secondPositionNftAccount: PublicKey;
6147
+ permanentLockedLiquidityPercentage: number;
6148
+ unlockedLiquidityPercentage: number;
6149
+ feeAPercentage: number;
6150
+ feeBPercentage: number;
6151
+ reward0Percentage: number;
6152
+ reward1Percentage: number;
6153
+ };
6071
6154
 
6072
6155
  /**
6073
6156
  * CpAmm SDK class to interact with the DAMM-V2
@@ -6275,7 +6358,7 @@ declare class CpAmm {
6275
6358
  swapOutAmount: BN;
6276
6359
  minSwapOutAmount: BN;
6277
6360
  totalFee: BN;
6278
- priceImpact: number;
6361
+ priceImpact: Decimal;
6279
6362
  };
6280
6363
  /**
6281
6364
  * Calculates swap quote based on desired output amount and pool state.
@@ -6475,6 +6558,7 @@ declare class CpAmm {
6475
6558
  * @returns Transaction builder.
6476
6559
  */
6477
6560
  claimReward(params: ClaimRewardParams): TxBuilder;
6561
+ splitPosition(params: SplitPositionParams): TxBuilder;
6478
6562
  }
6479
6563
 
6480
6564
  declare function getFirstKey(key1: PublicKey, key2: PublicKey): Buffer<ArrayBufferLike>;
@@ -6700,12 +6784,25 @@ declare const getMaxAmountWithSlippage: (amount: BN, rate: number) => BN;
6700
6784
  declare const getMinAmountWithSlippage: (amount: BN, rate: number) => BN;
6701
6785
  /**
6702
6786
  * Calculate price impact as a percentage
6787
+ * Price impact measures how much worse the user's execution was compared to the current market price
6788
+ * @param amountIn - Input amount (in base units)
6789
+ * @param amountOut - Output amount (in base units)
6790
+ * @param currentSqrtPrice - Current pool sqrt price (spot price)
6791
+ * @param aToB - Direction of swap: true for token A to token B, false for token B to token A
6792
+ * @param tokenADecimal - Decimal places for token A
6793
+ * @param tokenBDecimal - Decimal places for token B
6794
+ * @returns Price impact as a percentage (e.g., 1.5 means 1.5% worse than spot price)
6795
+ */
6796
+ declare const getPriceImpact: (amountIn: BN, amountOut: BN, currentSqrtPrice: BN, aToB: boolean, tokenADecimal: number, tokenBDecimal: number) => Decimal;
6797
+ /**
6798
+ * Calculate price change as a percentage (old implementation)
6799
+ * This measures the percentage change in pool price after a swap
6703
6800
  * @param nextSqrtPrice sqrt price after swap
6704
6801
  * @param currentSqrtPrice current pool sqrt price
6705
- * @returns Price impact as a percentage (e.g., 1.5 means 1.5%)
6802
+ * @returns Price change as a percentage (e.g., 1.5 means 1.5% change)
6706
6803
  */
6707
- declare const getPriceImpact: (nextSqrtPrice: BN, currentSqrtPrice: BN) => number;
6708
- declare const getPriceFromSqrtPrice: (sqrtPrice: BN, tokenADecimal: number, tokenBDecimal: number) => string;
6804
+ declare const getPriceChange: (nextSqrtPrice: BN, currentSqrtPrice: BN) => number;
6805
+ declare const getPriceFromSqrtPrice: (sqrtPrice: BN, tokenADecimal: number, tokenBDecimal: number) => Decimal;
6709
6806
  declare const getSqrtPriceFromPrice: (price: string, tokenADecimal: number, tokenBDecimal: number) => BN;
6710
6807
  declare const getUnClaimReward: (poolState: PoolState, positionState: PositionState) => {
6711
6808
  feeTokenA: BN;
@@ -6761,7 +6858,7 @@ declare function decimalToQ64(num: Decimal): BN;
6761
6858
  var address = "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
6762
6859
  var metadata = {
6763
6860
  name: "cp_amm",
6764
- version: "0.1.1",
6861
+ version: "0.1.3",
6765
6862
  spec: "0.1.0",
6766
6863
  description: "Created with Anchor"
6767
6864
  };
@@ -6926,29 +7023,7 @@ var instructions = [
6926
7023
  accounts: [
6927
7024
  {
6928
7025
  name: "pool_authority",
6929
- pda: {
6930
- seeds: [
6931
- {
6932
- kind: "const",
6933
- value: [
6934
- 112,
6935
- 111,
6936
- 111,
6937
- 108,
6938
- 95,
6939
- 97,
6940
- 117,
6941
- 116,
6942
- 104,
6943
- 111,
6944
- 114,
6945
- 105,
6946
- 116,
6947
- 121
6948
- ]
6949
- }
6950
- ]
6951
- }
7026
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
6952
7027
  },
6953
7028
  {
6954
7029
  name: "pool",
@@ -7084,29 +7159,7 @@ var instructions = [
7084
7159
  accounts: [
7085
7160
  {
7086
7161
  name: "pool_authority",
7087
- pda: {
7088
- seeds: [
7089
- {
7090
- kind: "const",
7091
- value: [
7092
- 112,
7093
- 111,
7094
- 111,
7095
- 108,
7096
- 95,
7097
- 97,
7098
- 117,
7099
- 116,
7100
- 104,
7101
- 111,
7102
- 114,
7103
- 105,
7104
- 116,
7105
- 121
7106
- ]
7107
- }
7108
- ]
7109
- }
7162
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
7110
7163
  },
7111
7164
  {
7112
7165
  name: "pool",
@@ -7246,29 +7299,7 @@ var instructions = [
7246
7299
  accounts: [
7247
7300
  {
7248
7301
  name: "pool_authority",
7249
- pda: {
7250
- seeds: [
7251
- {
7252
- kind: "const",
7253
- value: [
7254
- 112,
7255
- 111,
7256
- 111,
7257
- 108,
7258
- 95,
7259
- 97,
7260
- 117,
7261
- 116,
7262
- 104,
7263
- 111,
7264
- 114,
7265
- 105,
7266
- 116,
7267
- 121
7268
- ]
7269
- }
7270
- ]
7271
- }
7302
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
7272
7303
  },
7273
7304
  {
7274
7305
  name: "pool",
@@ -7560,6 +7591,14 @@ var instructions = [
7560
7591
  }
7561
7592
  ],
7562
7593
  args: [
7594
+ {
7595
+ name: "max_amount_a",
7596
+ type: "u64"
7597
+ },
7598
+ {
7599
+ name: "max_amount_b",
7600
+ type: "u64"
7601
+ }
7563
7602
  ]
7564
7603
  },
7565
7604
  {
@@ -7577,29 +7616,7 @@ var instructions = [
7577
7616
  accounts: [
7578
7617
  {
7579
7618
  name: "pool_authority",
7580
- pda: {
7581
- seeds: [
7582
- {
7583
- kind: "const",
7584
- value: [
7585
- 112,
7586
- 111,
7587
- 111,
7588
- 108,
7589
- 95,
7590
- 97,
7591
- 117,
7592
- 116,
7593
- 104,
7594
- 111,
7595
- 114,
7596
- 105,
7597
- 116,
7598
- 121
7599
- ]
7600
- }
7601
- ]
7602
- }
7619
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
7603
7620
  },
7604
7621
  {
7605
7622
  name: "pool",
@@ -7679,6 +7696,10 @@ var instructions = [
7679
7696
  {
7680
7697
  name: "reward_index",
7681
7698
  type: "u8"
7699
+ },
7700
+ {
7701
+ name: "skip_reward",
7702
+ type: "u8"
7682
7703
  }
7683
7704
  ]
7684
7705
  },
@@ -7845,15 +7866,40 @@ var instructions = [
7845
7866
  },
7846
7867
  {
7847
7868
  name: "pool_authority",
7869
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
7870
+ },
7871
+ {
7872
+ name: "rent_receiver",
7873
+ writable: true
7874
+ },
7875
+ {
7876
+ name: "owner",
7877
+ docs: [
7878
+ "Owner of position"
7879
+ ],
7880
+ signer: true
7881
+ },
7882
+ {
7883
+ name: "token_program",
7884
+ docs: [
7885
+ "Program to create NFT mint/token account and transfer for token22 account"
7886
+ ],
7887
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
7888
+ },
7889
+ {
7890
+ name: "event_authority",
7848
7891
  pda: {
7849
7892
  seeds: [
7850
7893
  {
7851
7894
  kind: "const",
7852
7895
  value: [
7853
- 112,
7854
- 111,
7855
- 111,
7856
- 108,
7896
+ 95,
7897
+ 95,
7898
+ 101,
7899
+ 118,
7900
+ 101,
7901
+ 110,
7902
+ 116,
7857
7903
  95,
7858
7904
  97,
7859
7905
  117,
@@ -7870,22 +7916,37 @@ var instructions = [
7870
7916
  }
7871
7917
  },
7872
7918
  {
7873
- name: "rent_receiver",
7919
+ name: "program"
7920
+ }
7921
+ ],
7922
+ args: [
7923
+ ]
7924
+ },
7925
+ {
7926
+ name: "close_token_badge",
7927
+ discriminator: [
7928
+ 108,
7929
+ 146,
7930
+ 86,
7931
+ 110,
7932
+ 179,
7933
+ 254,
7934
+ 10,
7935
+ 104
7936
+ ],
7937
+ accounts: [
7938
+ {
7939
+ name: "token_badge",
7874
7940
  writable: true
7875
7941
  },
7876
7942
  {
7877
- name: "owner",
7878
- docs: [
7879
- "Owner of position"
7880
- ],
7943
+ name: "admin",
7944
+ writable: true,
7881
7945
  signer: true
7882
7946
  },
7883
7947
  {
7884
- name: "token_program",
7885
- docs: [
7886
- "Program to create NFT mint/token account and transfer for token22 account"
7887
- ],
7888
- address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
7948
+ name: "rent_receiver",
7949
+ writable: true
7889
7950
  },
7890
7951
  {
7891
7952
  name: "event_authority",
@@ -8296,29 +8357,7 @@ var instructions = [
8296
8357
  },
8297
8358
  {
8298
8359
  name: "pool_authority",
8299
- pda: {
8300
- seeds: [
8301
- {
8302
- kind: "const",
8303
- value: [
8304
- 112,
8305
- 111,
8306
- 111,
8307
- 108,
8308
- 95,
8309
- 97,
8310
- 117,
8311
- 116,
8312
- 104,
8313
- 111,
8314
- 114,
8315
- 105,
8316
- 116,
8317
- 121
8318
- ]
8319
- }
8320
- ]
8321
- }
8360
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
8322
8361
  },
8323
8362
  {
8324
8363
  name: "payer",
@@ -8621,29 +8660,7 @@ var instructions = [
8621
8660
  },
8622
8661
  {
8623
8662
  name: "pool_authority",
8624
- pda: {
8625
- seeds: [
8626
- {
8627
- kind: "const",
8628
- value: [
8629
- 112,
8630
- 111,
8631
- 111,
8632
- 108,
8633
- 95,
8634
- 97,
8635
- 117,
8636
- 116,
8637
- 104,
8638
- 111,
8639
- 114,
8640
- 105,
8641
- 116,
8642
- 121
8643
- ]
8644
- }
8645
- ]
8646
- }
8663
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
8647
8664
  },
8648
8665
  {
8649
8666
  name: "pool",
@@ -8923,29 +8940,7 @@ var instructions = [
8923
8940
  },
8924
8941
  {
8925
8942
  name: "pool_authority",
8926
- pda: {
8927
- seeds: [
8928
- {
8929
- kind: "const",
8930
- value: [
8931
- 112,
8932
- 111,
8933
- 111,
8934
- 108,
8935
- 95,
8936
- 97,
8937
- 117,
8938
- 116,
8939
- 104,
8940
- 111,
8941
- 114,
8942
- 105,
8943
- 116,
8944
- 121
8945
- ]
8946
- }
8947
- ]
8948
- }
8943
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
8949
8944
  },
8950
8945
  {
8951
8946
  name: "pool",
@@ -9229,29 +9224,7 @@ var instructions = [
9229
9224
  },
9230
9225
  {
9231
9226
  name: "pool_authority",
9232
- pda: {
9233
- seeds: [
9234
- {
9235
- kind: "const",
9236
- value: [
9237
- 112,
9238
- 111,
9239
- 111,
9240
- 108,
9241
- 95,
9242
- 97,
9243
- 117,
9244
- 116,
9245
- 104,
9246
- 111,
9247
- 114,
9248
- 105,
9249
- 116,
9250
- 121
9251
- ]
9252
- }
9253
- ]
9254
- }
9227
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
9255
9228
  },
9256
9229
  {
9257
9230
  name: "pool",
@@ -9463,29 +9436,7 @@ var instructions = [
9463
9436
  accounts: [
9464
9437
  {
9465
9438
  name: "pool_authority",
9466
- pda: {
9467
- seeds: [
9468
- {
9469
- kind: "const",
9470
- value: [
9471
- 112,
9472
- 111,
9473
- 111,
9474
- 108,
9475
- 95,
9476
- 97,
9477
- 117,
9478
- 116,
9479
- 104,
9480
- 111,
9481
- 114,
9482
- 105,
9483
- 116,
9484
- 121
9485
- ]
9486
- }
9487
- ]
9488
- }
9439
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
9489
9440
  },
9490
9441
  {
9491
9442
  name: "pool",
@@ -9528,7 +9479,11 @@ var instructions = [
9528
9479
  name: "reward_mint"
9529
9480
  },
9530
9481
  {
9531
- name: "admin",
9482
+ name: "signer",
9483
+ signer: true
9484
+ },
9485
+ {
9486
+ name: "payer",
9532
9487
  writable: true,
9533
9488
  signer: true
9534
9489
  },
@@ -9809,29 +9764,7 @@ var instructions = [
9809
9764
  accounts: [
9810
9765
  {
9811
9766
  name: "pool_authority",
9812
- pda: {
9813
- seeds: [
9814
- {
9815
- kind: "const",
9816
- value: [
9817
- 112,
9818
- 111,
9819
- 111,
9820
- 108,
9821
- 95,
9822
- 97,
9823
- 117,
9824
- 116,
9825
- 104,
9826
- 111,
9827
- 114,
9828
- 105,
9829
- 116,
9830
- 121
9831
- ]
9832
- }
9833
- ]
9834
- }
9767
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
9835
9768
  },
9836
9769
  {
9837
9770
  name: "pool",
@@ -9980,29 +9913,7 @@ var instructions = [
9980
9913
  accounts: [
9981
9914
  {
9982
9915
  name: "pool_authority",
9983
- pda: {
9984
- seeds: [
9985
- {
9986
- kind: "const",
9987
- value: [
9988
- 112,
9989
- 111,
9990
- 111,
9991
- 108,
9992
- 95,
9993
- 97,
9994
- 117,
9995
- 116,
9996
- 104,
9997
- 111,
9998
- 114,
9999
- 105,
10000
- 116,
10001
- 121
10002
- ]
10003
- }
10004
- ]
10005
- }
9916
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
10006
9917
  },
10007
9918
  {
10008
9919
  name: "pool",
@@ -10198,29 +10109,80 @@ var instructions = [
10198
10109
  ]
10199
10110
  },
10200
10111
  {
10201
- name: "swap",
10112
+ name: "split_position",
10202
10113
  discriminator: [
10203
- 248,
10204
- 198,
10205
- 158,
10206
- 145,
10207
- 225,
10208
- 117,
10209
- 135,
10210
- 200
10114
+ 172,
10115
+ 241,
10116
+ 221,
10117
+ 138,
10118
+ 161,
10119
+ 29,
10120
+ 253,
10121
+ 42
10211
10122
  ],
10212
10123
  accounts: [
10213
10124
  {
10214
- name: "pool_authority",
10125
+ name: "pool",
10126
+ writable: true,
10127
+ relations: [
10128
+ "first_position",
10129
+ "second_position"
10130
+ ]
10131
+ },
10132
+ {
10133
+ name: "first_position",
10134
+ docs: [
10135
+ "The first position"
10136
+ ],
10137
+ writable: true
10138
+ },
10139
+ {
10140
+ name: "first_position_nft_account",
10141
+ docs: [
10142
+ "The token account for position nft"
10143
+ ]
10144
+ },
10145
+ {
10146
+ name: "second_position",
10147
+ docs: [
10148
+ "The second position"
10149
+ ],
10150
+ writable: true
10151
+ },
10152
+ {
10153
+ name: "second_position_nft_account",
10154
+ docs: [
10155
+ "The token account for position nft"
10156
+ ]
10157
+ },
10158
+ {
10159
+ name: "first_owner",
10160
+ docs: [
10161
+ "Owner of first position"
10162
+ ],
10163
+ signer: true
10164
+ },
10165
+ {
10166
+ name: "second_owner",
10167
+ docs: [
10168
+ "Owner of second position"
10169
+ ],
10170
+ signer: true
10171
+ },
10172
+ {
10173
+ name: "event_authority",
10215
10174
  pda: {
10216
10175
  seeds: [
10217
10176
  {
10218
10177
  kind: "const",
10219
10178
  value: [
10220
- 112,
10221
- 111,
10222
- 111,
10223
- 108,
10179
+ 95,
10180
+ 95,
10181
+ 101,
10182
+ 118,
10183
+ 101,
10184
+ 110,
10185
+ 116,
10224
10186
  95,
10225
10187
  97,
10226
10188
  117,
@@ -10236,6 +10198,38 @@ var instructions = [
10236
10198
  ]
10237
10199
  }
10238
10200
  },
10201
+ {
10202
+ name: "program"
10203
+ }
10204
+ ],
10205
+ args: [
10206
+ {
10207
+ name: "params",
10208
+ type: {
10209
+ defined: {
10210
+ name: "SplitPositionParameters"
10211
+ }
10212
+ }
10213
+ }
10214
+ ]
10215
+ },
10216
+ {
10217
+ name: "swap",
10218
+ discriminator: [
10219
+ 248,
10220
+ 198,
10221
+ 158,
10222
+ 145,
10223
+ 225,
10224
+ 117,
10225
+ 135,
10226
+ 200
10227
+ ],
10228
+ accounts: [
10229
+ {
10230
+ name: "pool_authority",
10231
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
10232
+ },
10239
10233
  {
10240
10234
  name: "pool",
10241
10235
  docs: [
@@ -10378,7 +10372,7 @@ var instructions = [
10378
10372
  writable: true
10379
10373
  },
10380
10374
  {
10381
- name: "admin",
10375
+ name: "signer",
10382
10376
  signer: true
10383
10377
  },
10384
10378
  {
@@ -10443,7 +10437,7 @@ var instructions = [
10443
10437
  writable: true
10444
10438
  },
10445
10439
  {
10446
- name: "admin",
10440
+ name: "signer",
10447
10441
  signer: true
10448
10442
  },
10449
10443
  {
@@ -10505,29 +10499,7 @@ var instructions = [
10505
10499
  accounts: [
10506
10500
  {
10507
10501
  name: "pool_authority",
10508
- pda: {
10509
- seeds: [
10510
- {
10511
- kind: "const",
10512
- value: [
10513
- 112,
10514
- 111,
10515
- 111,
10516
- 108,
10517
- 95,
10518
- 97,
10519
- 117,
10520
- 116,
10521
- 104,
10522
- 111,
10523
- 114,
10524
- 105,
10525
- 116,
10526
- 121
10527
- ]
10528
- }
10529
- ]
10530
- }
10502
+ address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
10531
10503
  },
10532
10504
  {
10533
10505
  name: "pool",
@@ -10933,6 +10905,19 @@ var events = [
10933
10905
  146
10934
10906
  ]
10935
10907
  },
10908
+ {
10909
+ name: "EvtSplitPosition",
10910
+ discriminator: [
10911
+ 182,
10912
+ 138,
10913
+ 42,
10914
+ 254,
10915
+ 27,
10916
+ 94,
10917
+ 82,
10918
+ 221
10919
+ ]
10920
+ },
10936
10921
  {
10937
10922
  name: "EvtSwap",
10938
10923
  discriminator: [
@@ -11196,6 +11181,31 @@ var errors = [
11196
11181
  code: 6041,
11197
11182
  name: "InvalidConfigType",
11198
11183
  msg: "Invalid config type"
11184
+ },
11185
+ {
11186
+ code: 6042,
11187
+ name: "InvalidPoolCreator",
11188
+ msg: "Invalid pool creator"
11189
+ },
11190
+ {
11191
+ code: 6043,
11192
+ name: "RewardVaultFrozenSkipRequired",
11193
+ msg: "Reward vault is frozen, must skip reward to proceed"
11194
+ },
11195
+ {
11196
+ code: 6044,
11197
+ name: "InvalidSplitPositionParameters",
11198
+ msg: "Invalid parameters for split position"
11199
+ },
11200
+ {
11201
+ code: 6045,
11202
+ name: "UnsupportPositionHasVestingLock",
11203
+ msg: "Unsupported split position has vesting lock"
11204
+ },
11205
+ {
11206
+ code: 6046,
11207
+ name: "SamePosition",
11208
+ msg: "Same position"
11199
11209
  }
11200
11210
  ];
11201
11211
  var types = [
@@ -12027,6 +12037,18 @@ var types = [
12027
12037
  {
12028
12038
  name: "transfer_fee_excluded_amount_in",
12029
12039
  type: "u64"
12040
+ },
12041
+ {
12042
+ name: "reward_duration_end",
12043
+ type: "u64"
12044
+ },
12045
+ {
12046
+ name: "pre_reward_rate",
12047
+ type: "u128"
12048
+ },
12049
+ {
12050
+ name: "post_reward_rate",
12051
+ type: "u128"
12030
12052
  }
12031
12053
  ]
12032
12054
  }
@@ -12144,6 +12166,10 @@ var types = [
12144
12166
  name: "funder",
12145
12167
  type: "pubkey"
12146
12168
  },
12169
+ {
12170
+ name: "creator",
12171
+ type: "pubkey"
12172
+ },
12147
12173
  {
12148
12174
  name: "reward_index",
12149
12175
  type: "u8"
@@ -12275,6 +12301,70 @@ var types = [
12275
12301
  ]
12276
12302
  }
12277
12303
  },
12304
+ {
12305
+ name: "EvtSplitPosition",
12306
+ type: {
12307
+ kind: "struct",
12308
+ fields: [
12309
+ {
12310
+ name: "pool",
12311
+ type: "pubkey"
12312
+ },
12313
+ {
12314
+ name: "first_owner",
12315
+ type: "pubkey"
12316
+ },
12317
+ {
12318
+ name: "second_owner",
12319
+ type: "pubkey"
12320
+ },
12321
+ {
12322
+ name: "first_position",
12323
+ type: "pubkey"
12324
+ },
12325
+ {
12326
+ name: "second_position",
12327
+ type: "pubkey"
12328
+ },
12329
+ {
12330
+ name: "current_sqrt_price",
12331
+ type: "u128"
12332
+ },
12333
+ {
12334
+ name: "amount_splits",
12335
+ type: {
12336
+ defined: {
12337
+ name: "SplitAmountInfo"
12338
+ }
12339
+ }
12340
+ },
12341
+ {
12342
+ name: "first_position_info",
12343
+ type: {
12344
+ defined: {
12345
+ name: "SplitPositionInfo"
12346
+ }
12347
+ }
12348
+ },
12349
+ {
12350
+ name: "second_position_info",
12351
+ type: {
12352
+ defined: {
12353
+ name: "SplitPositionInfo"
12354
+ }
12355
+ }
12356
+ },
12357
+ {
12358
+ name: "split_position_parameters",
12359
+ type: {
12360
+ defined: {
12361
+ name: "SplitPositionParameters"
12362
+ }
12363
+ }
12364
+ }
12365
+ ]
12366
+ }
12367
+ },
12278
12368
  {
12279
12369
  name: "EvtSwap",
12280
12370
  type: {
@@ -12720,6 +12810,13 @@ var types = [
12720
12810
  }
12721
12811
  }
12722
12812
  },
12813
+ {
12814
+ name: "creator",
12815
+ docs: [
12816
+ "pool creator"
12817
+ ],
12818
+ type: "pubkey"
12819
+ },
12723
12820
  {
12724
12821
  name: "_padding_1",
12725
12822
  docs: [
@@ -12728,7 +12825,7 @@ var types = [
12728
12825
  type: {
12729
12826
  array: [
12730
12827
  "u64",
12731
- 10
12828
+ 6
12732
12829
  ]
12733
12830
  }
12734
12831
  },
@@ -12771,25 +12868,16 @@ var types = [
12771
12868
  }
12772
12869
  },
12773
12870
  {
12774
- name: "protocol_fee_percent",
12775
- docs: [
12776
- "Protocol trade fee percent"
12777
- ],
12778
- type: "u8"
12779
- },
12780
- {
12781
- name: "partner_fee_percent",
12782
- docs: [
12783
- "partner fee percent"
12784
- ],
12785
- type: "u8"
12786
- },
12787
- {
12788
- name: "referral_fee_percent",
12871
+ name: "padding",
12789
12872
  docs: [
12790
- "referral fee percent"
12873
+ "padding"
12791
12874
  ],
12792
- type: "u8"
12875
+ type: {
12876
+ array: [
12877
+ "u8",
12878
+ 3
12879
+ ]
12880
+ }
12793
12881
  },
12794
12882
  {
12795
12883
  name: "dynamic_fee",
@@ -13292,6 +13380,128 @@ var types = [
13292
13380
  ]
13293
13381
  }
13294
13382
  },
13383
+ {
13384
+ name: "SplitAmountInfo",
13385
+ type: {
13386
+ kind: "struct",
13387
+ fields: [
13388
+ {
13389
+ name: "permanent_locked_liquidity",
13390
+ type: "u128"
13391
+ },
13392
+ {
13393
+ name: "unlocked_liquidity",
13394
+ type: "u128"
13395
+ },
13396
+ {
13397
+ name: "fee_a",
13398
+ type: "u64"
13399
+ },
13400
+ {
13401
+ name: "fee_b",
13402
+ type: "u64"
13403
+ },
13404
+ {
13405
+ name: "reward_0",
13406
+ type: "u64"
13407
+ },
13408
+ {
13409
+ name: "reward_1",
13410
+ type: "u64"
13411
+ }
13412
+ ]
13413
+ }
13414
+ },
13415
+ {
13416
+ name: "SplitPositionInfo",
13417
+ type: {
13418
+ kind: "struct",
13419
+ fields: [
13420
+ {
13421
+ name: "liquidity",
13422
+ type: "u128"
13423
+ },
13424
+ {
13425
+ name: "fee_a",
13426
+ type: "u64"
13427
+ },
13428
+ {
13429
+ name: "fee_b",
13430
+ type: "u64"
13431
+ },
13432
+ {
13433
+ name: "reward_0",
13434
+ type: "u64"
13435
+ },
13436
+ {
13437
+ name: "reward_1",
13438
+ type: "u64"
13439
+ }
13440
+ ]
13441
+ }
13442
+ },
13443
+ {
13444
+ name: "SplitPositionParameters",
13445
+ type: {
13446
+ kind: "struct",
13447
+ fields: [
13448
+ {
13449
+ name: "unlocked_liquidity_percentage",
13450
+ docs: [
13451
+ "Percentage of unlocked liquidity to split to the second position"
13452
+ ],
13453
+ type: "u8"
13454
+ },
13455
+ {
13456
+ name: "permanent_locked_liquidity_percentage",
13457
+ docs: [
13458
+ "Percentage of permanent locked liquidity to split to the second position"
13459
+ ],
13460
+ type: "u8"
13461
+ },
13462
+ {
13463
+ name: "fee_a_percentage",
13464
+ docs: [
13465
+ "Percentage of fee A pending to split to the second position"
13466
+ ],
13467
+ type: "u8"
13468
+ },
13469
+ {
13470
+ name: "fee_b_percentage",
13471
+ docs: [
13472
+ "Percentage of fee B pending to split to the second position"
13473
+ ],
13474
+ type: "u8"
13475
+ },
13476
+ {
13477
+ name: "reward_0_percentage",
13478
+ docs: [
13479
+ "Percentage of reward 0 pending to split to the second position"
13480
+ ],
13481
+ type: "u8"
13482
+ },
13483
+ {
13484
+ name: "reward_1_percentage",
13485
+ docs: [
13486
+ "Percentage of reward 1 pending to split to the second position"
13487
+ ],
13488
+ type: "u8"
13489
+ },
13490
+ {
13491
+ name: "padding",
13492
+ docs: [
13493
+ "padding for future"
13494
+ ],
13495
+ type: {
13496
+ array: [
13497
+ "u8",
13498
+ 16
13499
+ ]
13500
+ }
13501
+ }
13502
+ ]
13503
+ }
13504
+ },
13295
13505
  {
13296
13506
  name: "StaticConfigParameters",
13297
13507
  type: {
@@ -13554,4 +13764,4 @@ var CpAmmIDL = {
13554
13764
  types: types
13555
13765
  };
13556
13766
 
13557
- export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, type DepositQuote, type DynamicFee, type DynamicFeeParams, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteExactOutParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type QuoteExactOutResult, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SetupFeeClaimAccountsParams, type SwapAmount, type SwapParams, type SwapQuotes, type SwapResult, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, feeNumeratorToBps, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAvailableVestingLiquidity, getBaseFeeNumerator, getBaseFeeParams, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getFeeMode, getFeeNumerator, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getNextSqrtPriceFromAmountARoundingDown, getNextSqrtPriceFromAmountBRoundingUp, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getSwapResultFromOutAmount, getTokenDecimals, getTokenProgram, getTotalLockedLiquidity, getUnClaimReward, isVestingComplete, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };
13767
+ export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, type DepositQuote, type DynamicFee, type DynamicFeeParams, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteExactOutParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type QuoteExactOutResult, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SetupFeeClaimAccountsParams, type SplitPositionParams, type SwapAmount, type SwapParams, type SwapQuotes, type SwapResult, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, feeNumeratorToBps, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAvailableVestingLiquidity, getBaseFeeNumerator, getBaseFeeParams, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getFeeMode, getFeeNumerator, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getNextSqrtPriceFromAmountARoundingDown, getNextSqrtPriceFromAmountBRoundingUp, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getSwapResultFromOutAmount, getTokenDecimals, getTokenProgram, getTotalLockedLiquidity, getUnClaimReward, isVestingComplete, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };