@meteora-ag/cp-amm-sdk 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PublicKey, Transaction, Connection, TransactionInstruction, AddressLookupTableAccount, Commitment, GetProgramAccountsFilter } from '@solana/web3.js';
2
- import { Program, IdlAccounts, BN, IdlTypes } from '@coral-xyz/anchor';
2
+ import { Program, IdlAccounts, IdlTypes, BN, BorshCoder } from '@coral-xyz/anchor';
3
3
  import { Mint } from '@solana/spl-token';
4
4
  import Decimal from 'decimal.js';
5
5
  import BN$1 from 'bn.js';
@@ -14,7 +14,7 @@ type CpAmm$1 = {
14
14
  address: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
15
15
  metadata: {
16
16
  name: "cpAmm";
17
- version: "0.1.5";
17
+ version: "0.1.6";
18
18
  spec: "0.1.0";
19
19
  description: "Created with Anchor";
20
20
  };
@@ -543,14 +543,14 @@ type CpAmm$1 = {
543
543
  };
544
544
  },
545
545
  {
546
- name: "claimFeeOperator";
546
+ name: "operator";
547
547
  docs: ["Claim fee operator"];
548
548
  },
549
549
  {
550
- name: "operator";
551
- docs: ["Operator"];
550
+ name: "whitelistedAddress";
551
+ docs: ["operator"];
552
552
  signer: true;
553
- relations: ["claimFeeOperator"];
553
+ relations: ["operator"];
554
554
  },
555
555
  {
556
556
  name: "tokenAProgram";
@@ -690,20 +690,24 @@ type CpAmm$1 = {
690
690
  ];
691
691
  },
692
692
  {
693
- name: "closeClaimFeeOperator";
694
- discriminator: [38, 134, 82, 216, 95, 124, 17, 99];
693
+ name: "closeConfig";
694
+ discriminator: [145, 9, 72, 157, 95, 125, 61, 85];
695
695
  accounts: [
696
696
  {
697
- name: "claimFeeOperator";
697
+ name: "config";
698
698
  writable: true;
699
699
  },
700
700
  {
701
- name: "rentReceiver";
702
- writable: true;
701
+ name: "operator";
703
702
  },
704
703
  {
705
- name: "admin";
704
+ name: "whitelistedAddress";
706
705
  signer: true;
706
+ relations: ["operator"];
707
+ },
708
+ {
709
+ name: "rentReceiver";
710
+ writable: true;
707
711
  },
708
712
  {
709
713
  name: "eventAuthority";
@@ -741,16 +745,15 @@ type CpAmm$1 = {
741
745
  args: [];
742
746
  },
743
747
  {
744
- name: "closeConfig";
745
- discriminator: [145, 9, 72, 157, 95, 125, 61, 85];
748
+ name: "closeOperatorAccount";
749
+ discriminator: [171, 9, 213, 74, 120, 23, 3, 29];
746
750
  accounts: [
747
751
  {
748
- name: "config";
752
+ name: "operator";
749
753
  writable: true;
750
754
  },
751
755
  {
752
756
  name: "admin";
753
- writable: true;
754
757
  signer: true;
755
758
  },
756
759
  {
@@ -879,9 +882,12 @@ type CpAmm$1 = {
879
882
  writable: true;
880
883
  },
881
884
  {
882
- name: "admin";
883
- writable: true;
885
+ name: "operator";
886
+ },
887
+ {
888
+ name: "whitelistedAddress";
884
889
  signer: true;
890
+ relations: ["operator"];
885
891
  },
886
892
  {
887
893
  name: "rentReceiver";
@@ -923,21 +929,22 @@ type CpAmm$1 = {
923
929
  args: [];
924
930
  },
925
931
  {
926
- name: "createClaimFeeOperator";
927
- discriminator: [169, 62, 207, 107, 58, 187, 162, 109];
932
+ name: "createConfig";
933
+ docs: ["OPERATOR FUNCTIONS /////"];
934
+ discriminator: [201, 207, 243, 114, 75, 111, 47, 189];
928
935
  accounts: [
929
936
  {
930
- name: "claimFeeOperator";
937
+ name: "config";
931
938
  writable: true;
932
939
  pda: {
933
940
  seeds: [
934
941
  {
935
942
  kind: "const";
936
- value: [99, 102, 95, 111, 112, 101, 114, 97, 116, 111, 114];
943
+ value: [99, 111, 110, 102, 105, 103];
937
944
  },
938
945
  {
939
- kind: "account";
940
- path: "operator";
946
+ kind: "arg";
947
+ path: "index";
941
948
  }
942
949
  ];
943
950
  };
@@ -946,7 +953,12 @@ type CpAmm$1 = {
946
953
  name: "operator";
947
954
  },
948
955
  {
949
- name: "admin";
956
+ name: "whitelistedAddress";
957
+ signer: true;
958
+ relations: ["operator"];
959
+ },
960
+ {
961
+ name: "payer";
950
962
  writable: true;
951
963
  signer: true;
952
964
  },
@@ -987,12 +999,24 @@ type CpAmm$1 = {
987
999
  name: "program";
988
1000
  }
989
1001
  ];
990
- args: [];
1002
+ args: [
1003
+ {
1004
+ name: "index";
1005
+ type: "u64";
1006
+ },
1007
+ {
1008
+ name: "configParameters";
1009
+ type: {
1010
+ defined: {
1011
+ name: "staticConfigParameters";
1012
+ };
1013
+ };
1014
+ }
1015
+ ];
991
1016
  },
992
1017
  {
993
- name: "createConfig";
994
- docs: ["ADMIN FUNCTIONS /////"];
995
- discriminator: [201, 207, 243, 114, 75, 111, 47, 189];
1018
+ name: "createDynamicConfig";
1019
+ discriminator: [81, 251, 122, 78, 66, 57, 208, 82];
996
1020
  accounts: [
997
1021
  {
998
1022
  name: "config";
@@ -1011,7 +1035,15 @@ type CpAmm$1 = {
1011
1035
  };
1012
1036
  },
1013
1037
  {
1014
- name: "admin";
1038
+ name: "operator";
1039
+ },
1040
+ {
1041
+ name: "whitelistedAddress";
1042
+ signer: true;
1043
+ relations: ["operator"];
1044
+ },
1045
+ {
1046
+ name: "payer";
1015
1047
  writable: true;
1016
1048
  signer: true;
1017
1049
  },
@@ -1061,34 +1093,42 @@ type CpAmm$1 = {
1061
1093
  name: "configParameters";
1062
1094
  type: {
1063
1095
  defined: {
1064
- name: "staticConfigParameters";
1096
+ name: "dynamicConfigParameters";
1065
1097
  };
1066
1098
  };
1067
1099
  }
1068
1100
  ];
1069
1101
  },
1070
1102
  {
1071
- name: "createDynamicConfig";
1072
- discriminator: [81, 251, 122, 78, 66, 57, 208, 82];
1103
+ name: "createOperatorAccount";
1104
+ docs: ["ADMIN FUNCTIONS /////"];
1105
+ discriminator: [221, 64, 246, 149, 240, 153, 229, 163];
1073
1106
  accounts: [
1074
1107
  {
1075
- name: "config";
1108
+ name: "operator";
1076
1109
  writable: true;
1077
1110
  pda: {
1078
1111
  seeds: [
1079
1112
  {
1080
1113
  kind: "const";
1081
- value: [99, 111, 110, 102, 105, 103];
1114
+ value: [111, 112, 101, 114, 97, 116, 111, 114];
1082
1115
  },
1083
1116
  {
1084
- kind: "arg";
1085
- path: "index";
1117
+ kind: "account";
1118
+ path: "whitelistedAddress";
1086
1119
  }
1087
1120
  ];
1088
1121
  };
1089
1122
  },
1123
+ {
1124
+ name: "whitelistedAddress";
1125
+ },
1090
1126
  {
1091
1127
  name: "admin";
1128
+ signer: true;
1129
+ },
1130
+ {
1131
+ name: "payer";
1092
1132
  writable: true;
1093
1133
  signer: true;
1094
1134
  },
@@ -1131,16 +1171,8 @@ type CpAmm$1 = {
1131
1171
  ];
1132
1172
  args: [
1133
1173
  {
1134
- name: "index";
1135
- type: "u64";
1136
- },
1137
- {
1138
- name: "configParameters";
1139
- type: {
1140
- defined: {
1141
- name: "dynamicConfigParameters";
1142
- };
1143
- };
1174
+ name: "permission";
1175
+ type: "u128";
1144
1176
  }
1145
1177
  ];
1146
1178
  },
@@ -1295,7 +1327,15 @@ type CpAmm$1 = {
1295
1327
  name: "tokenMint";
1296
1328
  },
1297
1329
  {
1298
- name: "admin";
1330
+ name: "operator";
1331
+ },
1332
+ {
1333
+ name: "whitelistedAddress";
1334
+ signer: true;
1335
+ relations: ["operator"];
1336
+ },
1337
+ {
1338
+ name: "payer";
1299
1339
  writable: true;
1300
1340
  signer: true;
1301
1341
  },
@@ -1338,6 +1378,31 @@ type CpAmm$1 = {
1338
1378
  ];
1339
1379
  args: [];
1340
1380
  },
1381
+ {
1382
+ name: "dummyIx";
1383
+ discriminator: [234, 95, 176, 185, 7, 42, 35, 159];
1384
+ accounts: [
1385
+ {
1386
+ name: "podAlignedFeeTimeScheduler";
1387
+ },
1388
+ {
1389
+ name: "podAlignedFeeRateLimiter";
1390
+ },
1391
+ {
1392
+ name: "podAlignedFeeMarketCapScheduler";
1393
+ }
1394
+ ];
1395
+ args: [
1396
+ {
1397
+ name: "ixs";
1398
+ type: {
1399
+ defined: {
1400
+ name: "dummyParams";
1401
+ };
1402
+ };
1403
+ }
1404
+ ];
1405
+ },
1341
1406
  {
1342
1407
  name: "fundReward";
1343
1408
  discriminator: [188, 50, 249, 165, 93, 151, 38, 63];
@@ -2545,8 +2610,12 @@ type CpAmm$1 = {
2545
2610
  writable: true;
2546
2611
  },
2547
2612
  {
2548
- name: "admin";
2613
+ name: "operator";
2614
+ },
2615
+ {
2616
+ name: "whitelistedAddress";
2549
2617
  signer: true;
2618
+ relations: ["operator"];
2550
2619
  },
2551
2620
  {
2552
2621
  name: "eventAuthority";
@@ -2958,6 +3027,66 @@ type CpAmm$1 = {
2958
3027
  }
2959
3028
  ];
2960
3029
  },
3030
+ {
3031
+ name: "updatePoolFees";
3032
+ discriminator: [118, 217, 203, 179, 60, 8, 70, 89];
3033
+ accounts: [
3034
+ {
3035
+ name: "pool";
3036
+ writable: true;
3037
+ },
3038
+ {
3039
+ name: "operator";
3040
+ },
3041
+ {
3042
+ name: "whitelistedAddress";
3043
+ signer: true;
3044
+ relations: ["operator"];
3045
+ },
3046
+ {
3047
+ name: "eventAuthority";
3048
+ pda: {
3049
+ seeds: [
3050
+ {
3051
+ kind: "const";
3052
+ value: [
3053
+ 95,
3054
+ 95,
3055
+ 101,
3056
+ 118,
3057
+ 101,
3058
+ 110,
3059
+ 116,
3060
+ 95,
3061
+ 97,
3062
+ 117,
3063
+ 116,
3064
+ 104,
3065
+ 111,
3066
+ 114,
3067
+ 105,
3068
+ 116,
3069
+ 121
3070
+ ];
3071
+ }
3072
+ ];
3073
+ };
3074
+ },
3075
+ {
3076
+ name: "program";
3077
+ }
3078
+ ];
3079
+ args: [
3080
+ {
3081
+ name: "params";
3082
+ type: {
3083
+ defined: {
3084
+ name: "updatePoolFeesParameters";
3085
+ };
3086
+ };
3087
+ }
3088
+ ];
3089
+ },
2961
3090
  {
2962
3091
  name: "updateRewardDuration";
2963
3092
  discriminator: [138, 174, 196, 169, 213, 235, 254, 107];
@@ -3142,14 +3271,26 @@ type CpAmm$1 = {
3142
3271
  }
3143
3272
  ];
3144
3273
  accounts: [
3145
- {
3146
- name: "claimFeeOperator";
3147
- discriminator: [166, 48, 134, 86, 34, 200, 188, 150];
3148
- },
3149
3274
  {
3150
3275
  name: "config";
3151
3276
  discriminator: [155, 12, 170, 224, 30, 250, 204, 130];
3152
3277
  },
3278
+ {
3279
+ name: "operator";
3280
+ discriminator: [219, 31, 188, 145, 69, 139, 204, 117];
3281
+ },
3282
+ {
3283
+ name: "podAlignedFeeMarketCapScheduler";
3284
+ discriminator: [251, 130, 208, 253, 245, 27, 145, 203];
3285
+ },
3286
+ {
3287
+ name: "podAlignedFeeRateLimiter";
3288
+ discriminator: [160, 219, 8, 251, 179, 7, 16, 117];
3289
+ },
3290
+ {
3291
+ name: "podAlignedFeeTimeScheduler";
3292
+ discriminator: [239, 132, 138, 213, 67, 154, 130, 70];
3293
+ },
3153
3294
  {
3154
3295
  name: "pool";
3155
3296
  discriminator: [241, 154, 109, 4, 17, 177, 109, 188];
@@ -3168,10 +3309,6 @@ type CpAmm$1 = {
3168
3309
  }
3169
3310
  ];
3170
3311
  events: [
3171
- {
3172
- name: "evtAddLiquidity";
3173
- discriminator: [175, 242, 8, 157, 30, 247, 185, 169];
3174
- },
3175
3312
  {
3176
3313
  name: "evtClaimPartnerFee";
3177
3314
  discriminator: [118, 99, 77, 10, 226, 1, 1, 87];
@@ -3188,10 +3325,6 @@ type CpAmm$1 = {
3188
3325
  name: "evtClaimReward";
3189
3326
  discriminator: [218, 86, 147, 200, 235, 188, 215, 231];
3190
3327
  },
3191
- {
3192
- name: "evtCloseClaimFeeOperator";
3193
- discriminator: [111, 39, 37, 55, 110, 216, 194, 23];
3194
- },
3195
3328
  {
3196
3329
  name: "evtCloseConfig";
3197
3330
  discriminator: [36, 30, 239, 45, 58, 132, 14, 5];
@@ -3200,10 +3333,6 @@ type CpAmm$1 = {
3200
3333
  name: "evtClosePosition";
3201
3334
  discriminator: [20, 145, 144, 68, 143, 142, 214, 178];
3202
3335
  },
3203
- {
3204
- name: "evtCreateClaimFeeOperator";
3205
- discriminator: [21, 6, 153, 120, 68, 116, 28, 177];
3206
- },
3207
3336
  {
3208
3337
  name: "evtCreateConfig";
3209
3338
  discriminator: [131, 207, 180, 174, 180, 73, 165, 54];
@@ -3244,10 +3373,6 @@ type CpAmm$1 = {
3244
3373
  name: "evtPermanentLockPosition";
3245
3374
  discriminator: [145, 143, 162, 218, 218, 80, 67, 11];
3246
3375
  },
3247
- {
3248
- name: "evtRemoveLiquidity";
3249
- discriminator: [87, 46, 88, 98, 175, 96, 34, 91];
3250
- },
3251
3376
  {
3252
3377
  name: "evtSetPoolStatus";
3253
3378
  discriminator: [100, 213, 74, 3, 95, 91, 228, 146];
@@ -3256,14 +3381,14 @@ type CpAmm$1 = {
3256
3381
  name: "evtSplitPosition2";
3257
3382
  discriminator: [165, 32, 203, 174, 72, 100, 233, 103];
3258
3383
  },
3259
- {
3260
- name: "evtSwap";
3261
- discriminator: [27, 60, 21, 213, 138, 170, 187, 147];
3262
- },
3263
3384
  {
3264
3385
  name: "evtSwap2";
3265
3386
  discriminator: [189, 66, 51, 168, 38, 80, 117, 153];
3266
3387
  },
3388
+ {
3389
+ name: "evtUpdatePoolFees";
3390
+ discriminator: [76, 165, 246, 102, 102, 217, 156, 44];
3391
+ },
3267
3392
  {
3268
3393
  name: "evtUpdateRewardDuration";
3269
3394
  discriminator: [149, 135, 65, 231, 129, 153, 65, 57];
@@ -3530,7 +3655,7 @@ type CpAmm$1 = {
3530
3655
  },
3531
3656
  {
3532
3657
  code: 6050;
3533
- name: "invalidFeeScheduler";
3658
+ name: "invalidFeeTimeScheduler";
3534
3659
  msg: "Invalid fee scheduler";
3535
3660
  },
3536
3661
  {
@@ -3542,6 +3667,41 @@ type CpAmm$1 = {
3542
3667
  code: 6052;
3543
3668
  name: "invalidPoolVersion";
3544
3669
  msg: "Invalid pool version";
3670
+ },
3671
+ {
3672
+ code: 6053;
3673
+ name: "invalidAuthority";
3674
+ msg: "Invalid authority to do that action";
3675
+ },
3676
+ {
3677
+ code: 6054;
3678
+ name: "invalidPermission";
3679
+ msg: "Invalid permission";
3680
+ },
3681
+ {
3682
+ code: 6055;
3683
+ name: "invalidFeeMarketCapScheduler";
3684
+ msg: "Invalid fee market cap scheduler";
3685
+ },
3686
+ {
3687
+ code: 6056;
3688
+ name: "cannotUpdateBaseFee";
3689
+ msg: "Cannot update base fee";
3690
+ },
3691
+ {
3692
+ code: 6057;
3693
+ name: "invalidDynamicFeeParameters";
3694
+ msg: "Invalid dynamic fee parameters";
3695
+ },
3696
+ {
3697
+ code: 6058;
3698
+ name: "invalidUpdatePoolFeesParameters";
3699
+ msg: "Invalid update pool fees parameters";
3700
+ },
3701
+ {
3702
+ code: 6059;
3703
+ name: "missingOperatorAccount";
3704
+ msg: "Missing operator account";
3545
3705
  }
3546
3706
  ];
3547
3707
  types: [
@@ -3569,7 +3729,7 @@ type CpAmm$1 = {
3569
3729
  };
3570
3730
  },
3571
3731
  {
3572
- name: "baseFeeConfig";
3732
+ name: "baseFeeInfo";
3573
3733
  serialization: "bytemuck";
3574
3734
  repr: {
3575
3735
  kind: "c";
@@ -3578,32 +3738,10 @@ type CpAmm$1 = {
3578
3738
  kind: "struct";
3579
3739
  fields: [
3580
3740
  {
3581
- name: "cliffFeeNumerator";
3582
- type: "u64";
3583
- },
3584
- {
3585
- name: "baseFeeMode";
3586
- type: "u8";
3587
- },
3588
- {
3589
- name: "padding";
3590
- type: {
3591
- array: ["u8", 5];
3592
- };
3593
- },
3594
- {
3595
- name: "firstFactor";
3596
- type: "u16";
3597
- },
3598
- {
3599
- name: "secondFactor";
3741
+ name: "data";
3600
3742
  type: {
3601
- array: ["u8", 8];
3743
+ array: ["u8", 32];
3602
3744
  };
3603
- },
3604
- {
3605
- name: "thirdFactor";
3606
- type: "u64";
3607
3745
  }
3608
3746
  ];
3609
3747
  };
@@ -3614,26 +3752,10 @@ type CpAmm$1 = {
3614
3752
  kind: "struct";
3615
3753
  fields: [
3616
3754
  {
3617
- name: "cliffFeeNumerator";
3618
- type: "u64";
3619
- },
3620
- {
3621
- name: "firstFactor";
3622
- type: "u16";
3623
- },
3624
- {
3625
- name: "secondFactor";
3755
+ name: "data";
3626
3756
  type: {
3627
- array: ["u8", 8];
3757
+ array: ["u8", 30];
3628
3758
  };
3629
- },
3630
- {
3631
- name: "thirdFactor";
3632
- type: "u64";
3633
- },
3634
- {
3635
- name: "baseFeeMode";
3636
- type: "u8";
3637
3759
  }
3638
3760
  ];
3639
3761
  };
@@ -3648,60 +3770,138 @@ type CpAmm$1 = {
3648
3770
  kind: "struct";
3649
3771
  fields: [
3650
3772
  {
3651
- name: "cliffFeeNumerator";
3652
- type: "u64";
3773
+ name: "baseFeeInfo";
3774
+ type: {
3775
+ defined: {
3776
+ name: "baseFeeInfo";
3777
+ };
3778
+ };
3653
3779
  },
3654
3780
  {
3655
- name: "baseFeeMode";
3781
+ name: "padding1";
3782
+ type: "u64";
3783
+ }
3784
+ ];
3785
+ };
3786
+ },
3787
+ {
3788
+ name: "borshFeeMarketCapScheduler";
3789
+ type: {
3790
+ kind: "struct";
3791
+ fields: [
3792
+ {
3793
+ name: "cliffFeeNumerator";
3794
+ type: "u64";
3795
+ },
3796
+ {
3797
+ name: "numberOfPeriod";
3798
+ type: "u16";
3799
+ },
3800
+ {
3801
+ name: "sqrtPriceStepBps";
3802
+ type: "u32";
3803
+ },
3804
+ {
3805
+ name: "schedulerExpirationDuration";
3806
+ type: "u32";
3807
+ },
3808
+ {
3809
+ name: "reductionFactor";
3810
+ type: "u64";
3811
+ },
3812
+ {
3813
+ name: "baseFeeMode";
3656
3814
  type: "u8";
3657
3815
  },
3658
3816
  {
3659
- name: "padding0";
3817
+ name: "padding";
3660
3818
  type: {
3661
- array: ["u8", 5];
3819
+ array: ["u8", 3];
3662
3820
  };
3821
+ }
3822
+ ];
3823
+ };
3824
+ },
3825
+ {
3826
+ name: "borshFeeRateLimiter";
3827
+ docs: [
3828
+ "we denote reference_amount = x0, cliff_fee_numerator = c, fee_increment = i",
3829
+ "if input_amount <= x0, then fee = input_amount * c",
3830
+ "",
3831
+ "if input_amount > x0, then input_amount = x0 + (a * x0 + b)",
3832
+ "if a < max_index",
3833
+ "then fee = x0 * c + x0 * (c + i) + .... + x0 * (c + i*a) + b * (c + i * (a+1))",
3834
+ "then fee = x0 * (c + c*a + i*a*(a+1)/2) + b * (c + i * (a+1))",
3835
+ "",
3836
+ "if a >= max_index",
3837
+ "if a = max_index + d, input_amount = x0 + max_index * x0 + (d * x0 + b)",
3838
+ "then fee = x0 * (c + c*max_index + i*max_index*(max_index+1)/2) + (d * x0 + b) * MAX_FEE"
3839
+ ];
3840
+ type: {
3841
+ kind: "struct";
3842
+ fields: [
3843
+ {
3844
+ name: "cliffFeeNumerator";
3845
+ type: "u64";
3663
3846
  },
3664
3847
  {
3665
- name: "firstFactor";
3848
+ name: "feeIncrementBps";
3666
3849
  type: "u16";
3667
3850
  },
3668
3851
  {
3669
- name: "secondFactor";
3670
- type: {
3671
- array: ["u8", 8];
3672
- };
3852
+ name: "maxLimiterDuration";
3853
+ type: "u32";
3673
3854
  },
3674
3855
  {
3675
- name: "thirdFactor";
3676
- type: "u64";
3856
+ name: "maxFeeBps";
3857
+ type: "u32";
3677
3858
  },
3678
3859
  {
3679
- name: "padding1";
3860
+ name: "referenceAmount";
3680
3861
  type: "u64";
3862
+ },
3863
+ {
3864
+ name: "baseFeeMode";
3865
+ type: "u8";
3866
+ },
3867
+ {
3868
+ name: "padding";
3869
+ type: {
3870
+ array: ["u8", 3];
3871
+ };
3681
3872
  }
3682
3873
  ];
3683
3874
  };
3684
3875
  },
3685
3876
  {
3686
- name: "claimFeeOperator";
3687
- docs: ["Parameter that set by the protocol"];
3688
- serialization: "bytemuck";
3689
- repr: {
3690
- kind: "c";
3691
- };
3877
+ name: "borshFeeTimeScheduler";
3692
3878
  type: {
3693
3879
  kind: "struct";
3694
3880
  fields: [
3695
3881
  {
3696
- name: "operator";
3697
- docs: ["operator"];
3698
- type: "pubkey";
3882
+ name: "cliffFeeNumerator";
3883
+ type: "u64";
3884
+ },
3885
+ {
3886
+ name: "numberOfPeriod";
3887
+ type: "u16";
3888
+ },
3889
+ {
3890
+ name: "periodFrequency";
3891
+ type: "u64";
3892
+ },
3893
+ {
3894
+ name: "reductionFactor";
3895
+ type: "u64";
3896
+ },
3897
+ {
3898
+ name: "baseFeeMode";
3899
+ type: "u8";
3699
3900
  },
3700
3901
  {
3701
3902
  name: "padding";
3702
- docs: ["Reserve"];
3703
3903
  type: {
3704
- array: ["u8", 128];
3904
+ array: ["u8", 3];
3705
3905
  };
3706
3906
  }
3707
3907
  ];
@@ -3784,6 +3984,38 @@ type CpAmm$1 = {
3784
3984
  ];
3785
3985
  };
3786
3986
  },
3987
+ {
3988
+ name: "dummyParams";
3989
+ type: {
3990
+ kind: "struct";
3991
+ fields: [
3992
+ {
3993
+ name: "borshFeeTimeSchedulerParams";
3994
+ type: {
3995
+ defined: {
3996
+ name: "borshFeeTimeScheduler";
3997
+ };
3998
+ };
3999
+ },
4000
+ {
4001
+ name: "borshFeeRateLimiterParams";
4002
+ type: {
4003
+ defined: {
4004
+ name: "borshFeeRateLimiter";
4005
+ };
4006
+ };
4007
+ },
4008
+ {
4009
+ name: "borshFeeMarketCapSchedulerParams";
4010
+ type: {
4011
+ defined: {
4012
+ name: "borshFeeMarketCapScheduler";
4013
+ };
4014
+ };
4015
+ }
4016
+ ];
4017
+ };
4018
+ },
3787
4019
  {
3788
4020
  name: "dynamicConfigParameters";
3789
4021
  type: {
@@ -3954,50 +4186,6 @@ type CpAmm$1 = {
3954
4186
  ];
3955
4187
  };
3956
4188
  },
3957
- {
3958
- name: "evtAddLiquidity";
3959
- type: {
3960
- kind: "struct";
3961
- fields: [
3962
- {
3963
- name: "pool";
3964
- type: "pubkey";
3965
- },
3966
- {
3967
- name: "position";
3968
- type: "pubkey";
3969
- },
3970
- {
3971
- name: "owner";
3972
- type: "pubkey";
3973
- },
3974
- {
3975
- name: "params";
3976
- type: {
3977
- defined: {
3978
- name: "addLiquidityParameters";
3979
- };
3980
- };
3981
- },
3982
- {
3983
- name: "tokenAAmount";
3984
- type: "u64";
3985
- },
3986
- {
3987
- name: "tokenBAmount";
3988
- type: "u64";
3989
- },
3990
- {
3991
- name: "totalAmountA";
3992
- type: "u64";
3993
- },
3994
- {
3995
- name: "totalAmountB";
3996
- type: "u64";
3997
- }
3998
- ];
3999
- };
4000
- },
4001
4189
  {
4002
4190
  name: "evtClaimPartnerFee";
4003
4191
  type: {
@@ -4098,23 +4286,6 @@ type CpAmm$1 = {
4098
4286
  ];
4099
4287
  };
4100
4288
  },
4101
- {
4102
- name: "evtCloseClaimFeeOperator";
4103
- docs: ["Close claim fee operator"];
4104
- type: {
4105
- kind: "struct";
4106
- fields: [
4107
- {
4108
- name: "claimFeeOperator";
4109
- type: "pubkey";
4110
- },
4111
- {
4112
- name: "operator";
4113
- type: "pubkey";
4114
- }
4115
- ];
4116
- };
4117
- },
4118
4289
  {
4119
4290
  name: "evtCloseConfig";
4120
4291
  docs: ["Close config"];
@@ -4158,19 +4329,6 @@ type CpAmm$1 = {
4158
4329
  ];
4159
4330
  };
4160
4331
  },
4161
- {
4162
- name: "evtCreateClaimFeeOperator";
4163
- docs: ["Create claim fee operator"];
4164
- type: {
4165
- kind: "struct";
4166
- fields: [
4167
- {
4168
- name: "operator";
4169
- type: "pubkey";
4170
- }
4171
- ];
4172
- };
4173
- },
4174
4332
  {
4175
4333
  name: "evtCreateConfig";
4176
4334
  docs: ["Create static config"];
@@ -4578,42 +4736,6 @@ type CpAmm$1 = {
4578
4736
  ];
4579
4737
  };
4580
4738
  },
4581
- {
4582
- name: "evtRemoveLiquidity";
4583
- type: {
4584
- kind: "struct";
4585
- fields: [
4586
- {
4587
- name: "pool";
4588
- type: "pubkey";
4589
- },
4590
- {
4591
- name: "position";
4592
- type: "pubkey";
4593
- },
4594
- {
4595
- name: "owner";
4596
- type: "pubkey";
4597
- },
4598
- {
4599
- name: "params";
4600
- type: {
4601
- defined: {
4602
- name: "removeLiquidityParameters";
4603
- };
4604
- };
4605
- },
4606
- {
4607
- name: "tokenAAmount";
4608
- type: "u64";
4609
- },
4610
- {
4611
- name: "tokenBAmount";
4612
- type: "u64";
4613
- }
4614
- ];
4615
- };
4616
- },
4617
4739
  {
4618
4740
  name: "evtSetPoolStatus";
4619
4741
  type: {
@@ -4695,7 +4817,7 @@ type CpAmm$1 = {
4695
4817
  };
4696
4818
  },
4697
4819
  {
4698
- name: "evtSwap";
4820
+ name: "evtSwap2";
4699
4821
  type: {
4700
4822
  kind: "struct";
4701
4823
  fields: [
@@ -4707,6 +4829,10 @@ type CpAmm$1 = {
4707
4829
  name: "tradeDirection";
4708
4830
  type: "u8";
4709
4831
  },
4832
+ {
4833
+ name: "collectFeeMode";
4834
+ type: "u8";
4835
+ },
4710
4836
  {
4711
4837
  name: "hasReferral";
4712
4838
  type: "bool";
@@ -4715,7 +4841,7 @@ type CpAmm$1 = {
4715
4841
  name: "params";
4716
4842
  type: {
4717
4843
  defined: {
4718
- name: "swapParameters";
4844
+ name: "swapParameters2";
4719
4845
  };
4720
4846
  };
4721
4847
  },
@@ -4723,23 +4849,39 @@ type CpAmm$1 = {
4723
4849
  name: "swapResult";
4724
4850
  type: {
4725
4851
  defined: {
4726
- name: "swapResult";
4852
+ name: "swapResult2";
4727
4853
  };
4728
4854
  };
4729
4855
  },
4730
4856
  {
4731
- name: "actualAmountIn";
4857
+ name: "includedTransferFeeAmountIn";
4858
+ type: "u64";
4859
+ },
4860
+ {
4861
+ name: "includedTransferFeeAmountOut";
4862
+ type: "u64";
4863
+ },
4864
+ {
4865
+ name: "excludedTransferFeeAmountOut";
4732
4866
  type: "u64";
4733
4867
  },
4734
4868
  {
4735
4869
  name: "currentTimestamp";
4736
4870
  type: "u64";
4871
+ },
4872
+ {
4873
+ name: "reserveAAmount";
4874
+ type: "u64";
4875
+ },
4876
+ {
4877
+ name: "reserveBAmount";
4878
+ type: "u64";
4737
4879
  }
4738
4880
  ];
4739
4881
  };
4740
4882
  },
4741
4883
  {
4742
- name: "evtSwap2";
4884
+ name: "evtUpdatePoolFees";
4743
4885
  type: {
4744
4886
  kind: "struct";
4745
4887
  fields: [
@@ -4748,56 +4890,16 @@ type CpAmm$1 = {
4748
4890
  type: "pubkey";
4749
4891
  },
4750
4892
  {
4751
- name: "tradeDirection";
4752
- type: "u8";
4753
- },
4754
- {
4755
- name: "collectFeeMode";
4756
- type: "u8";
4757
- },
4758
- {
4759
- name: "hasReferral";
4760
- type: "bool";
4893
+ name: "operator";
4894
+ type: "pubkey";
4761
4895
  },
4762
4896
  {
4763
4897
  name: "params";
4764
4898
  type: {
4765
4899
  defined: {
4766
- name: "swapParameters2";
4900
+ name: "updatePoolFeesParameters";
4767
4901
  };
4768
4902
  };
4769
- },
4770
- {
4771
- name: "swapResult";
4772
- type: {
4773
- defined: {
4774
- name: "swapResult2";
4775
- };
4776
- };
4777
- },
4778
- {
4779
- name: "includedTransferFeeAmountIn";
4780
- type: "u64";
4781
- },
4782
- {
4783
- name: "includedTransferFeeAmountOut";
4784
- type: "u64";
4785
- },
4786
- {
4787
- name: "excludedTransferFeeAmountOut";
4788
- type: "u64";
4789
- },
4790
- {
4791
- name: "currentTimestamp";
4792
- type: "u64";
4793
- },
4794
- {
4795
- name: "reserveAAmount";
4796
- type: "u64";
4797
- },
4798
- {
4799
- name: "reserveBAmount";
4800
- type: "u64";
4801
4903
  }
4802
4904
  ];
4803
4905
  };
@@ -4907,7 +5009,7 @@ type CpAmm$1 = {
4907
5009
  {
4908
5010
  name: "sqrtPrice";
4909
5011
  docs: [
4910
- "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value"
5012
+ "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value. Market cap fee scheduler minimum price will be derived from this value"
4911
5013
  ];
4912
5014
  type: "u128";
4913
5015
  },
@@ -4958,6 +5060,154 @@ type CpAmm$1 = {
4958
5060
  ];
4959
5061
  };
4960
5062
  },
5063
+ {
5064
+ name: "operator";
5065
+ serialization: "bytemuck";
5066
+ repr: {
5067
+ kind: "c";
5068
+ };
5069
+ type: {
5070
+ kind: "struct";
5071
+ fields: [
5072
+ {
5073
+ name: "whitelistedAddress";
5074
+ type: "pubkey";
5075
+ },
5076
+ {
5077
+ name: "permission";
5078
+ type: "u128";
5079
+ },
5080
+ {
5081
+ name: "padding";
5082
+ type: {
5083
+ array: ["u64", 2];
5084
+ };
5085
+ }
5086
+ ];
5087
+ };
5088
+ },
5089
+ {
5090
+ name: "podAlignedFeeMarketCapScheduler";
5091
+ serialization: "bytemuck";
5092
+ repr: {
5093
+ kind: "c";
5094
+ };
5095
+ type: {
5096
+ kind: "struct";
5097
+ fields: [
5098
+ {
5099
+ name: "cliffFeeNumerator";
5100
+ type: "u64";
5101
+ },
5102
+ {
5103
+ name: "baseFeeMode";
5104
+ type: "u8";
5105
+ },
5106
+ {
5107
+ name: "padding";
5108
+ type: {
5109
+ array: ["u8", 5];
5110
+ };
5111
+ },
5112
+ {
5113
+ name: "numberOfPeriod";
5114
+ type: "u16";
5115
+ },
5116
+ {
5117
+ name: "sqrtPriceStepBps";
5118
+ type: "u32";
5119
+ },
5120
+ {
5121
+ name: "schedulerExpirationDuration";
5122
+ type: "u32";
5123
+ },
5124
+ {
5125
+ name: "reductionFactor";
5126
+ type: "u64";
5127
+ }
5128
+ ];
5129
+ };
5130
+ },
5131
+ {
5132
+ name: "podAlignedFeeRateLimiter";
5133
+ serialization: "bytemuck";
5134
+ repr: {
5135
+ kind: "c";
5136
+ };
5137
+ type: {
5138
+ kind: "struct";
5139
+ fields: [
5140
+ {
5141
+ name: "cliffFeeNumerator";
5142
+ type: "u64";
5143
+ },
5144
+ {
5145
+ name: "baseFeeMode";
5146
+ type: "u8";
5147
+ },
5148
+ {
5149
+ name: "padding";
5150
+ type: {
5151
+ array: ["u8", 5];
5152
+ };
5153
+ },
5154
+ {
5155
+ name: "feeIncrementBps";
5156
+ type: "u16";
5157
+ },
5158
+ {
5159
+ name: "maxLimiterDuration";
5160
+ type: "u32";
5161
+ },
5162
+ {
5163
+ name: "maxFeeBps";
5164
+ type: "u32";
5165
+ },
5166
+ {
5167
+ name: "referenceAmount";
5168
+ type: "u64";
5169
+ }
5170
+ ];
5171
+ };
5172
+ },
5173
+ {
5174
+ name: "podAlignedFeeTimeScheduler";
5175
+ serialization: "bytemuck";
5176
+ repr: {
5177
+ kind: "c";
5178
+ };
5179
+ type: {
5180
+ kind: "struct";
5181
+ fields: [
5182
+ {
5183
+ name: "cliffFeeNumerator";
5184
+ type: "u64";
5185
+ },
5186
+ {
5187
+ name: "baseFeeMode";
5188
+ type: "u8";
5189
+ },
5190
+ {
5191
+ name: "padding";
5192
+ type: {
5193
+ array: ["u8", 5];
5194
+ };
5195
+ },
5196
+ {
5197
+ name: "numberOfPeriod";
5198
+ type: "u16";
5199
+ },
5200
+ {
5201
+ name: "periodFrequency";
5202
+ type: "u64";
5203
+ },
5204
+ {
5205
+ name: "reductionFactor";
5206
+ type: "u64";
5207
+ }
5208
+ ];
5209
+ };
5210
+ },
4961
5211
  {
4962
5212
  name: "pool";
4963
5213
  serialization: "bytemuck";
@@ -5083,7 +5333,7 @@ type CpAmm$1 = {
5083
5333
  {
5084
5334
  name: "collectFeeMode";
5085
5335
  docs: [
5086
- "0 is collect fee in both token, 1 only collect fee in token a, 2 only collect fee in token b"
5336
+ "0 is collect fee in both token, 1 only collect fee only in token b"
5087
5337
  ];
5088
5338
  type: "u8";
5089
5339
  },
@@ -5175,13 +5425,6 @@ type CpAmm$1 = {
5175
5425
  };
5176
5426
  };
5177
5427
  },
5178
- {
5179
- name: "padding";
5180
- docs: ["padding"];
5181
- type: {
5182
- array: ["u8", 3];
5183
- };
5184
- },
5185
5428
  {
5186
5429
  name: "dynamicFee";
5187
5430
  docs: ["dynamic fee"];
@@ -5209,7 +5452,7 @@ type CpAmm$1 = {
5209
5452
  name: "baseFee";
5210
5453
  type: {
5211
5454
  defined: {
5212
- name: "baseFeeConfig";
5455
+ name: "baseFeeInfo";
5213
5456
  };
5214
5457
  };
5215
5458
  },
@@ -5314,11 +5557,8 @@ type CpAmm$1 = {
5314
5557
  };
5315
5558
  },
5316
5559
  {
5317
- name: "padding1";
5318
- docs: ["padding"];
5319
- type: {
5320
- array: ["u64", 2];
5321
- };
5560
+ name: "initSqrtPrice";
5561
+ type: "u128";
5322
5562
  }
5323
5563
  ];
5324
5564
  };
@@ -5819,39 +6059,6 @@ type CpAmm$1 = {
5819
6059
  ];
5820
6060
  };
5821
6061
  },
5822
- {
5823
- name: "swapResult";
5824
- docs: ["Encodes all results of swapping"];
5825
- type: {
5826
- kind: "struct";
5827
- fields: [
5828
- {
5829
- name: "outputAmount";
5830
- type: "u64";
5831
- },
5832
- {
5833
- name: "nextSqrtPrice";
5834
- type: "u128";
5835
- },
5836
- {
5837
- name: "lpFee";
5838
- type: "u64";
5839
- },
5840
- {
5841
- name: "protocolFee";
5842
- type: "u64";
5843
- },
5844
- {
5845
- name: "partnerFee";
5846
- type: "u64";
5847
- },
5848
- {
5849
- name: "referralFee";
5850
- type: "u64";
5851
- }
5852
- ];
5853
- };
5854
- },
5855
6062
  {
5856
6063
  name: "swapResult2";
5857
6064
  type: {
@@ -5921,6 +6128,41 @@ type CpAmm$1 = {
5921
6128
  ];
5922
6129
  };
5923
6130
  },
6131
+ {
6132
+ name: "updatePoolFeesParameters";
6133
+ type: {
6134
+ kind: "struct";
6135
+ fields: [
6136
+ {
6137
+ name: "cliffFeeNumerator";
6138
+ docs: [
6139
+ "Base fee update mode:",
6140
+ "- None: skip base fee update",
6141
+ "- Some: update new cliff_fee_numerator if base fee is static"
6142
+ ];
6143
+ type: {
6144
+ option: "u64";
6145
+ };
6146
+ },
6147
+ {
6148
+ name: "dynamicFee";
6149
+ docs: [
6150
+ "Dynamic fee update mode:",
6151
+ "- None: skip dynamic fee update",
6152
+ "- Some(with default value): disable dynamic fee",
6153
+ "- Some(with non default value): enable dynamic fee if disabled or update dynamic fee if enabled"
6154
+ ];
6155
+ type: {
6156
+ option: {
6157
+ defined: {
6158
+ name: "dynamicFeeParameters";
6159
+ };
6160
+ };
6161
+ };
6162
+ }
6163
+ ];
6164
+ };
6165
+ },
5924
6166
  {
5925
6167
  name: "userRewardInfo";
5926
6168
  serialization: "bytemuck";
@@ -6033,26 +6275,105 @@ type CpAmm$1 = {
6033
6275
  };
6034
6276
  }
6035
6277
  ];
6036
- };
6037
-
6038
- type AmmProgram = Program<CpAmm$1>;
6039
- type TxBuilder = Promise<Transaction>;
6040
- declare enum Rounding {
6041
- Up = 0,
6042
- Down = 1
6043
- }
6044
- declare enum ActivationPoint {
6045
- Timestamp = 0,
6046
- Slot = 1
6047
- }
6048
- declare enum BaseFeeMode {
6049
- FeeSchedulerLinear = 0,
6050
- FeeSchedulerExponential = 1,
6051
- RateLimiter = 2
6052
- }
6053
- declare enum CollectFeeMode {
6054
- BothToken = 0,
6055
- OnlyB = 1
6278
+ constants: [
6279
+ {
6280
+ name: "binStepBpsDefault";
6281
+ type: "u16";
6282
+ value: "1";
6283
+ },
6284
+ {
6285
+ name: "binStepU128DefaultLeBytes";
6286
+ type: {
6287
+ array: ["u8", 16];
6288
+ };
6289
+ value: "[203, 16, 199, 186, 184, 141, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0]";
6290
+ },
6291
+ {
6292
+ name: "customizablePoolPrefix";
6293
+ type: "bytes";
6294
+ value: "[99, 112, 111, 111, 108]";
6295
+ },
6296
+ {
6297
+ name: "feeDenominator";
6298
+ docs: [
6299
+ "Default fee denominator. DO NOT simply update it as it will break logic that depends on it as default value."
6300
+ ];
6301
+ type: "u64";
6302
+ value: "1000000000";
6303
+ },
6304
+ {
6305
+ name: "maxBasisPoint";
6306
+ docs: ["Max basis point. 100% in pct"];
6307
+ type: "u64";
6308
+ value: "10000";
6309
+ },
6310
+ {
6311
+ name: "maxSqrtPriceLeBytes";
6312
+ type: {
6313
+ array: ["u8", 16];
6314
+ };
6315
+ value: "[155, 87, 105, 78, 169, 26, 92, 132, 177, 196, 254, 255, 0, 0, 0, 0]";
6316
+ },
6317
+ {
6318
+ name: "minSqrtPriceLeBytes";
6319
+ type: {
6320
+ array: ["u8", 16];
6321
+ };
6322
+ value: "[80, 59, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]";
6323
+ },
6324
+ {
6325
+ name: "poolAuthorityPrefix";
6326
+ type: "bytes";
6327
+ value: "[112, 111, 111, 108, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]";
6328
+ },
6329
+ {
6330
+ name: "poolPrefix";
6331
+ type: "bytes";
6332
+ value: "[112, 111, 111, 108]";
6333
+ },
6334
+ {
6335
+ name: "positionNftAccountPrefix";
6336
+ type: "bytes";
6337
+ value: "[112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 102, 116, 95, 97, 99, 99, 111, 117, 110, 116]";
6338
+ },
6339
+ {
6340
+ name: "positionPrefix";
6341
+ type: "bytes";
6342
+ value: "[112, 111, 115, 105, 116, 105, 111, 110]";
6343
+ },
6344
+ {
6345
+ name: "splitPositionDenominator";
6346
+ type: "u32";
6347
+ value: "1000000000";
6348
+ },
6349
+ {
6350
+ name: "tokenVaultPrefix";
6351
+ type: "bytes";
6352
+ value: "[116, 111, 107, 101, 110, 95, 118, 97, 117, 108, 116]";
6353
+ }
6354
+ ];
6355
+ };
6356
+
6357
+ type AmmProgram = Program<CpAmm$1>;
6358
+ type TxBuilder = Promise<Transaction>;
6359
+ declare enum Rounding {
6360
+ Up = 0,
6361
+ Down = 1
6362
+ }
6363
+ declare enum ActivationPoint {
6364
+ Timestamp = 0,
6365
+ Slot = 1
6366
+ }
6367
+ declare enum BaseFeeMode {
6368
+ FeeTimeSchedulerLinear = 0,
6369
+ FeeTimeSchedulerExponential = 1,
6370
+ RateLimiter = 2,
6371
+ FeeMarketCapSchedulerLinear = 3,
6372
+ FeeMarketCapSchedulerExponential = 4
6373
+ }
6374
+ declare enum CollectFeeMode {
6375
+ BothToken = 0,
6376
+ OnlyB = 1
6056
6377
  }
6057
6378
  declare enum TradeDirection {
6058
6379
  AtoB = 0,
@@ -6085,6 +6406,12 @@ type PositionState = IdlAccounts<CpAmm$1>["position"];
6085
6406
  type VestingState = IdlAccounts<CpAmm$1>["vesting"];
6086
6407
  type ConfigState = IdlAccounts<CpAmm$1>["config"];
6087
6408
  type TokenBadgeState = IdlAccounts<CpAmm$1>["tokenBadge"];
6409
+ type BorshFeeTimeScheduler = IdlTypes<CpAmm$1>["borshFeeTimeScheduler"];
6410
+ type BorshFeeMarketCapScheduler = IdlTypes<CpAmm$1>["borshFeeMarketCapScheduler"];
6411
+ type BorshFeeRateLimiter = IdlTypes<CpAmm$1>["borshFeeRateLimiter"];
6412
+ type PodAlignedFeeTimeScheduler = IdlTypes<CpAmm$1>["podAlignedFeeTimeScheduler"];
6413
+ type PodAlignedFeeMarketCapScheduler = IdlTypes<CpAmm$1>["podAlignedFeeMarketCapScheduler"];
6414
+ type PodAlignedFeeRateLimiter = IdlTypes<CpAmm$1>["podAlignedFeeRateLimiter"];
6088
6415
  type RewardInfo = IdlTypes<CpAmm$1>["rewardInfo"];
6089
6416
  type UserRewardInfo = IdlTypes<CpAmm$1>["userRewardInfo"];
6090
6417
  /**
@@ -6117,14 +6444,11 @@ type DynamicFee = IdlTypes<CpAmm$1>["dynamicFeeParameters"];
6117
6444
  type DynamicFeeStruct = IdlTypes<CpAmm$1>["dynamicFeeStruct"];
6118
6445
  /**
6119
6446
  * Base fee parameters
6120
- * @param cliffFeeNumerator
6121
- * @param firstFactor // feeScheduler: numberOfPeriod, rateLimiter: feeIncrementBps
6122
- * @param secondFactor // feeScheduler: periodFrequency, rateLimiter: maxLimiterDuration
6123
- * @param thirdFactor // feeScheduler: reductionFactor, rateLimiter: referenceAmount
6124
- * @param baseFeeMode
6447
+ * @param data // number[]
6125
6448
  */
6126
6449
  type BaseFee = IdlTypes<CpAmm$1>["baseFeeParameters"];
6127
6450
  type PoolFeesStruct = IdlTypes<CpAmm$1>["poolFeesStruct"];
6451
+ type DecodedPoolFees = PodAlignedFeeTimeScheduler | PodAlignedFeeRateLimiter | PodAlignedFeeMarketCapScheduler;
6128
6452
  type PoolFeesParams = {
6129
6453
  baseFee: BaseFee;
6130
6454
  padding: number[];
@@ -6425,7 +6749,6 @@ type SwapAmount = {
6425
6749
  outputAmount: BN;
6426
6750
  nextSqrtPrice: BN;
6427
6751
  };
6428
- type SwapResult = IdlTypes<CpAmm$1>["swapResult"];
6429
6752
  type SwapResult2 = IdlTypes<CpAmm$1>["swapResult2"];
6430
6753
  interface Quote2Result extends SwapResult2 {
6431
6754
  priceImpact: Decimal;
@@ -6702,8 +7025,10 @@ type SplitPosition2Params = {
6702
7025
  };
6703
7026
  interface BaseFeeHandler {
6704
7027
  validate(collectFeeMode: CollectFeeMode, activationType: ActivationType, poolVersion: PoolVersion): boolean;
6705
- getBaseFeeNumeratorFromIncludedFeeAmount(currentPoint: BN, activationPoint: BN, tradeDirection: TradeDirection, includedFeeAmount: BN): BN;
6706
- getBaseFeeNumeratorFromExcludedFeeAmount(currentPoint: BN, activationPoint: BN, tradeDirection: TradeDirection, excludedFeeAmount: BN): BN;
7028
+ getBaseFeeNumeratorFromIncludedFeeAmount(currentPoint: BN, activationPoint: BN, tradeDirection: TradeDirection, includedFeeAmount: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
7029
+ getBaseFeeNumeratorFromExcludedFeeAmount(currentPoint: BN, activationPoint: BN, tradeDirection: TradeDirection, excludedFeeAmount: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
7030
+ validateBaseFeeIsStatic(currentPoint: BN, activationPoint: BN): boolean;
7031
+ getMinBaseFeeNumerator(): BN;
6707
7032
  }
6708
7033
  interface FeeOnAmountResult {
6709
7034
  amount: BN;
@@ -6826,6 +7151,7 @@ declare class CpAmm {
6826
7151
  publicKey: PublicKey;
6827
7152
  account: PoolState;
6828
7153
  }>>;
7154
+ fetchPoolFees(pool: PublicKey): Promise<DecodedPoolFees | null>;
6829
7155
  /**
6830
7156
  * Fetches the Position state.
6831
7157
  * @param position - Public key of the position.
@@ -7208,6 +7534,7 @@ declare function deriveCustomizablePoolAddress(tokenAMint: PublicKey, tokenBMint
7208
7534
  declare function deriveTokenBadgeAddress(tokenMint: PublicKey): PublicKey;
7209
7535
  declare function deriveClaimFeeOperatorAddress(operator: PublicKey): PublicKey;
7210
7536
  declare function derivePositionNftAccount(positionNftMint: PublicKey): PublicKey;
7537
+ declare function deriveOperatorAddress(whitelistedAddress: PublicKey): PublicKey;
7211
7538
 
7212
7539
  declare const CP_AMM_PROGRAM_ID: PublicKey;
7213
7540
  declare const LIQUIDITY_SCALE = 128;
@@ -7241,7 +7568,8 @@ declare const U16_MAX = 65535;
7241
7568
  declare const MAX_RATE_LIMITER_DURATION_IN_SECONDS = 43200;
7242
7569
  declare const MAX_RATE_LIMITER_DURATION_IN_SLOTS = 108000;
7243
7570
  declare const SPLIT_POSITION_DENOMINATOR = 1000000000;
7244
- declare const CURRENT_POOL_VERSION = PoolVersion.V0;
7571
+ declare const CURRENT_POOL_VERSION = PoolVersion.V1;
7572
+ declare const FEE_PADDING: number[];
7245
7573
 
7246
7574
  /**
7247
7575
  * Gets the token program
@@ -7462,6 +7790,36 @@ interface TransferFeeExcludedAmount {
7462
7790
  * @returns The transfer fee excluded amount
7463
7791
  */
7464
7792
  declare function calculateTransferFeeExcludedAmount(transferFeeIncludedAmount: BN, mint: Mint, currentEpoch: number): TransferFeeExcludedAmount;
7793
+ /**
7794
+ * Interface for transfer hook extension state
7795
+ */
7796
+ interface TransferHookState {
7797
+ authority: string;
7798
+ programId: string;
7799
+ }
7800
+ /**
7801
+ * Checks if a Token 2022 mint has a transfer hook extension
7802
+ * Transfer hooks prevent permissionless pool creation as they require
7803
+ * the hook program to approve transfers, which pool creation cannot satisfy.
7804
+ *
7805
+ * @param connection - The connection to the Solana cluster
7806
+ * @param mint - The mint address to check
7807
+ * @returns Object containing whether transfer hook exists and its state if found
7808
+ */
7809
+ declare function hasTransferHookExtension(connection: Connection, mint: PublicKey): Promise<{
7810
+ hasTransferHook: boolean;
7811
+ transferHookState?: TransferHookState;
7812
+ }>;
7813
+ /**
7814
+ * Validates that tokens don't have transfer hook extensions before pool creation
7815
+ * Throws an error if either token has a transfer hook extension
7816
+ *
7817
+ * @param connection - The connection to the Solana cluster
7818
+ * @param tokenAMint - The first token mint address
7819
+ * @param tokenBMint - The second token mint address
7820
+ * @throws Error if either token has a transfer hook extension
7821
+ */
7822
+ declare function validateNoTransferHook(connection: Connection, tokenAMint: PublicKey, tokenBMint: PublicKey): Promise<void>;
7465
7823
 
7466
7824
  /**
7467
7825
  * Checks if a vesting schedule is ready for full release
@@ -7491,9 +7849,43 @@ declare function getAvailableVestingLiquidity(vestingData: VestingState, current
7491
7849
  * @param periodFrequency Period frequency
7492
7850
  * @param reductionFactor Reduction factor
7493
7851
  * @param cliffFeeNumerator Cliff fee numerator
7494
- * @returns Validation result
7852
+ * @param baseFeeMode Base fee mode
7853
+ * @param poolVersion Pool version
7854
+ * @throws Error if the fee time scheduler is invalid.
7855
+ * @returns True if the fee time scheduler is valid, otherwise false.
7856
+ */
7857
+ declare function validateFeeTimeScheduler(numberOfPeriod: number, periodFrequency: BN$1, reductionFactor: BN$1, cliffFeeNumerator: BN$1, baseFeeMode: BaseFeeMode, poolVersion: PoolVersion): boolean;
7858
+ /**
7859
+ * Validates whether the base fee is static based on the scheduler's expiration.
7860
+ * @param currentPoint - The current point as BN.
7861
+ * @param activationPoint - The activation point as BN.
7862
+ * @param numberOfPeriod - The total number of periods as BN.
7863
+ * @param periodFrequency - The period frequency as BN.
7864
+ * @returns True if the base fee is static, otherwise false.
7865
+ */
7866
+ declare function validateFeeTimeSchedulerBaseFeeIsStatic(currentPoint: BN$1, activationPoint: BN$1, numberOfPeriod: BN$1, periodFrequency: BN$1): boolean;
7867
+ /**
7868
+ * Validates the Market Cap Fee Scheduler parameters.
7869
+ * This checks for non-zero scheduler fields and validates fee fractions and limits, following the Rust logic.
7870
+ * @param cliffFeeNumerator - The cliff fee numerator as BN.
7871
+ * @param numberOfPeriod - Number of periods (number).
7872
+ * @param sqrtPriceStepBps - The sqrt price step in basis points (BN).
7873
+ * @param reductionFactor - The reduction factor as BN.
7874
+ * @param schedulerExpirationDuration - The scheduler expiration duration as BN.
7875
+ * @param feeMarketCapSchedulerMode - The fee scheduler mode (BaseFeeMode).
7876
+ * @param poolVersion - The pool version.
7877
+ * @throws Error if validation fails.
7878
+ * @returns True if the fee market cap scheduler is valid, otherwise false.
7879
+ */
7880
+ declare function validateFeeMarketCapScheduler(cliffFeeNumerator: BN$1, numberOfPeriod: number, sqrtPriceStepBps: BN$1, reductionFactor: BN$1, schedulerExpirationDuration: BN$1, feeMarketCapSchedulerMode: BaseFeeMode, poolVersion: PoolVersion): boolean;
7881
+ /**
7882
+ * Validates whether the base fee is static for market cap fee scheduler, based on scheduler's expiration
7883
+ * @param currentPoint - The current point as BN.
7884
+ * @param activationPoint - The activation point as BN.
7885
+ * @param schedulerExpirationDuration - The scheduler expiration duration as BN.
7886
+ * @returns True if the base fee is static, otherwise false.
7495
7887
  */
7496
- declare function validateFeeScheduler(numberOfPeriod: number, periodFrequency: BN$1, reductionFactor: BN$1, cliffFeeNumerator: BN$1, baseFeeMode: BaseFeeMode, poolVersion: PoolVersion): boolean;
7888
+ declare function validateFeeMarketCapBaseFeeIsStatic(currentPoint: BN$1, activationPoint: BN$1, schedulerExpirationDuration: BN$1): boolean;
7497
7889
  /**
7498
7890
  * Validate rate limiter parameters
7499
7891
  * @param cliffFeeNumerator - Cliff fee numerator
@@ -7505,6 +7897,17 @@ declare function validateFeeScheduler(numberOfPeriod: number, periodFrequency: B
7505
7897
  * @returns Validation result
7506
7898
  */
7507
7899
  declare function validateFeeRateLimiter(cliffFeeNumerator: BN$1, feeIncrementBps: number, maxFeeBps: number, maxLimiterDuration: number, referenceAmount: BN$1, collectFeeMode: CollectFeeMode, activationType: ActivationType, poolVersion: PoolVersion): boolean;
7900
+ /**
7901
+ * Validates whether the rate limiter base fee is static based on the current and activation points, as well as the maxLimiterDuration and referenceAmount.
7902
+ * @param currentPoint - The current point as BN.
7903
+ * @param activationPoint - The activation point as BN.
7904
+ * @param maxLimiterDuration - The max limiter duration as number.
7905
+ * @param referenceAmount - The reference amount as BN.
7906
+ * @param maxFeeBps - The max fee in basis points as number.
7907
+ * @param feeIncrementBps - The fee increment in basis points as number.
7908
+ * @returns True if the base fee is static, otherwise false.
7909
+ */
7910
+ declare function validateFeeRateLimiterBaseFeeIsStatic(currentPoint: BN$1, activationPoint: BN$1, maxLimiterDuration: number, referenceAmount: BN$1, maxFeeBps: number, feeIncrementBps: number): boolean;
7508
7911
  /**
7509
7912
  * Validates that the fee fraction is valid (numerator < denominator, denominator != 0)
7510
7913
  * @param numerator - The numerator of the fee fraction
@@ -7602,7 +8005,8 @@ declare function fromDecimalToBN(value: Decimal): BN$1;
7602
8005
  * @param poolVersion - The pool version
7603
8006
  * @returns The fee scheduler parameters
7604
8007
  */
7605
- declare function getFeeSchedulerParams(startingBaseFeeBps: number, endingBaseFeeBps: number, baseFeeMode: BaseFeeMode, numberOfPeriod: number, totalDuration: number): BaseFee;
8008
+ declare function getFeeTimeSchedulerParams(startingBaseFeeBps: number, endingBaseFeeBps: number, baseFeeMode: BaseFeeMode, numberOfPeriod: number, totalDuration: number): BaseFee;
8009
+ declare function getFeeMarketCapSchedulerParams(startingBaseFeeBps: number, endingBaseFeeBps: number, baseFeeMode: BaseFeeMode, numberOfPeriod: number, sqrtPriceStepBps: number, schedulerExpirationDuration: number): BaseFee;
7606
8010
  /**
7607
8011
  * Gets the rate limiter parameters
7608
8012
  * @param baseFeeBps - The base fee in basis points
@@ -7633,12 +8037,19 @@ declare function getBaseFeeParams(baseFeeParams: {
7633
8037
  maxLimiterDuration: number;
7634
8038
  maxFeeBps: number;
7635
8039
  };
7636
- feeSchedulerParam?: {
8040
+ feeTimeSchedulerParam?: {
7637
8041
  startingFeeBps: number;
7638
8042
  endingFeeBps: number;
7639
8043
  numberOfPeriod: number;
7640
8044
  totalDuration: number;
7641
8045
  };
8046
+ feeMarketCapSchedulerParam?: {
8047
+ startingFeeBps: number;
8048
+ endingFeeBps: number;
8049
+ numberOfPeriod: number;
8050
+ sqrtPriceStepBps: number;
8051
+ schedulerExpirationDuration: number;
8052
+ };
7642
8053
  }, tokenBDecimal: number, activationType: ActivationType): BaseFee;
7643
8054
  /**
7644
8055
  * Gets the dynamic fee parameters
@@ -7648,6 +8059,17 @@ declare function getBaseFeeParams(baseFeeParams: {
7648
8059
  */
7649
8060
  declare function getDynamicFeeParams(baseFeeBps: number, maxPriceChangeBps?: number): DynamicFee;
7650
8061
 
8062
+ declare const cpAmmCoder: BorshCoder<string, string>;
8063
+ declare function encodeFeeTimeSchedulerParams(cliffFeeNumerator: BN$1, numberOfPeriod: number, periodFrequency: BN$1, reductionFactor: BN$1, baseFeeMode: BaseFeeMode): Buffer;
8064
+ declare function decodeFeeTimeSchedulerParams(data: Buffer): BorshFeeTimeScheduler;
8065
+ declare function decodePodAlignedFeeTimeScheduler(data: Buffer): PodAlignedFeeTimeScheduler;
8066
+ declare function encodeFeeMarketCapSchedulerParams(cliffFeeNumerator: BN$1, numberOfPeriod: number, sqrtPriceStepBps: number, schedulerExpirationDuration: number, reductionFactor: BN$1, baseFeeMode: BaseFeeMode): Buffer;
8067
+ declare function decodeFeeMarketCapSchedulerParams(data: Buffer): BorshFeeMarketCapScheduler;
8068
+ declare function decodePodAlignedFeeMarketCapScheduler(data: Buffer): PodAlignedFeeMarketCapScheduler;
8069
+ declare function encodeFeeRateLimiterParams(cliffFeeNumerator: BN$1, feeIncrementBps: number, maxLimiterDuration: number, maxFeeBps: number, referenceAmount: BN$1): Buffer;
8070
+ declare function decodeFeeRateLimiterParams(data: Buffer): BorshFeeRateLimiter;
8071
+ declare function decodePodAlignedFeeRateLimiter(data: Buffer): PodAlignedFeeRateLimiter;
8072
+
7651
8073
  /**
7652
8074
  * Converts basis points to a numerator
7653
8075
  * @param bps - The basis points
@@ -7689,7 +8111,7 @@ declare function getTotalFeeNumerator(poolFees: PoolFeesStruct, baseFeeNumerator
7689
8111
  * @param maxFeeNumerator - The max fee numerator
7690
8112
  * @returns The total trading fee from included fee amount
7691
8113
  */
7692
- declare function getTotalTradingFeeFromIncludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, includedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN): BN;
8114
+ declare function getTotalTradingFeeFromIncludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, includedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
7693
8115
  /**
7694
8116
  * Gets the total trading fee from excluded fee amount
7695
8117
  * @param poolFees - The pool fees
@@ -7700,7 +8122,7 @@ declare function getTotalTradingFeeFromIncludedFeeAmount(poolFees: PoolFeesStruc
7700
8122
  * @param maxFeeNumerator - The max fee numerator
7701
8123
  * @returns The total trading fee from excluded fee amount
7702
8124
  */
7703
- declare function getTotalTradingFeeFromExcludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, excludedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN): BN;
8125
+ declare function getTotalTradingFeeFromExcludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, excludedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
7704
8126
  /**
7705
8127
  * Splits the fees
7706
8128
  * @param poolFees - The pool fees
@@ -7800,33 +8222,51 @@ declare class FeeRateLimiter implements BaseFeeHandler {
7800
8222
  referenceAmount: BN$1;
7801
8223
  constructor(cliffFeeNumerator: BN$1, feeIncrementBps: number, maxFeeBps: number, maxLimiterDuration: number, referenceAmount: BN$1);
7802
8224
  validate(collectFeeMode: CollectFeeMode, activationType: ActivationType, poolVersion: PoolVersion): boolean;
7803
- getBaseFeeNumeratorFromIncludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, tradeDirection: TradeDirection, includedFeeAmount: BN$1): BN$1;
7804
- getBaseFeeNumeratorFromExcludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, tradeDirection: TradeDirection, excludedFeeAmount: BN$1): BN$1;
8225
+ getBaseFeeNumeratorFromIncludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, tradeDirection: TradeDirection, includedFeeAmount: BN$1, _initSqrtPrice: BN$1, _currentSqrtPrice: BN$1): BN$1;
8226
+ getBaseFeeNumeratorFromExcludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, tradeDirection: TradeDirection, excludedFeeAmount: BN$1, _initSqrtPrice: BN$1, _currentSqrtPrice: BN$1): BN$1;
8227
+ validateBaseFeeIsStatic(currentPoint: BN$1, activationPoint: BN$1): boolean;
8228
+ getMinBaseFeeNumerator(): BN$1;
7805
8229
  }
7806
8230
  /**
7807
- * Fee Scheduler implementation
8231
+ * Fee Time Scheduler implementation
7808
8232
  */
7809
- declare class FeeScheduler implements BaseFeeHandler {
8233
+ declare class FeeTimeScheduler implements BaseFeeHandler {
7810
8234
  cliffFeeNumerator: BN$1;
7811
8235
  numberOfPeriod: number;
7812
8236
  periodFrequency: BN$1;
7813
8237
  reductionFactor: BN$1;
7814
- feeSchedulerMode: BaseFeeMode;
7815
- constructor(cliffFeeNumerator: BN$1, numberOfPeriod: number, periodFrequency: BN$1, reductionFactor: BN$1, feeSchedulerMode: BaseFeeMode);
8238
+ feeTimeSchedulerMode: BaseFeeMode;
8239
+ constructor(cliffFeeNumerator: BN$1, numberOfPeriod: number, periodFrequency: BN$1, reductionFactor: BN$1, feeTimeSchedulerMode: BaseFeeMode);
7816
8240
  validate(collectFeeMode: CollectFeeMode, activationType: ActivationType, poolVersion: PoolVersion): boolean;
7817
- getBaseFeeNumeratorFromIncludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1): BN$1;
7818
- getBaseFeeNumeratorFromExcludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1): BN$1;
8241
+ getBaseFeeNumeratorFromIncludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, _tradeDirection: TradeDirection, _includedFeeAmount: BN$1, _initSqrtPrice: BN$1, _currentSqrtPrice: BN$1): BN$1;
8242
+ getBaseFeeNumeratorFromExcludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, _tradeDirection: TradeDirection, _excludedFeeAmount: BN$1, _initSqrtPrice: BN$1, _currentSqrtPrice: BN$1): BN$1;
8243
+ validateBaseFeeIsStatic(currentPoint: BN$1, activationPoint: BN$1): boolean;
8244
+ getMinBaseFeeNumerator(): BN$1;
8245
+ }
8246
+ /**
8247
+ * Fee Market Cap Scheduler implementation
8248
+ */
8249
+ declare class FeeMarketCapScheduler implements BaseFeeHandler {
8250
+ cliffFeeNumerator: BN$1;
8251
+ numberOfPeriod: number;
8252
+ sqrtPriceStepBps: number;
8253
+ schedulerExpirationDuration: number;
8254
+ reductionFactor: BN$1;
8255
+ feeMarketCapSchedulerMode: BaseFeeMode;
8256
+ constructor(cliffFeeNumerator: BN$1, numberOfPeriod: number, sqrtPriceStepBps: number, schedulerExpirationDuration: number, reductionFactor: BN$1, feeMarketCapSchedulerMode: BaseFeeMode);
8257
+ validate(_collectFeeMode: CollectFeeMode, _activationType: ActivationType, poolVersion: PoolVersion): boolean;
8258
+ getBaseFeeNumeratorFromIncludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, _tradeDirection: TradeDirection, _includedFeeAmount: BN$1, initSqrtPrice: BN$1, currentSqrtPrice: BN$1): BN$1;
8259
+ getBaseFeeNumeratorFromExcludedFeeAmount(currentPoint: BN$1, activationPoint: BN$1, _tradeDirection: TradeDirection, _excludedFeeAmount: BN$1, initSqrtPrice: BN$1, currentSqrtPrice: BN$1): BN$1;
8260
+ validateBaseFeeIsStatic(currentPoint: BN$1, activationPoint: BN$1): boolean;
8261
+ getMinBaseFeeNumerator(): BN$1;
7819
8262
  }
7820
8263
  /**
7821
8264
  * Get base fee handler based on base fee mode
7822
- * @param cliffFeeNumerator Cliff fee numerator
7823
- * @param firstFactor First factor (feeScheduler: numberOfPeriod, rateLimiter: feeIncrementBps)
7824
- * @param secondFactor Second factor (feeScheduler: periodFrequency, rateLimiter: maxLimiterDuration)
7825
- * @param thirdFactor Third factor (feeScheduler: reductionFactor, rateLimiter: referenceAmount)
7826
- * @param baseFeeMode Base fee mode
8265
+ * @param program Program instance
8266
+ * @param rawData Raw data
7827
8267
  * @returns Base fee handler instance
7828
8268
  */
7829
- declare function getBaseFeeHandler(cliffFeeNumerator: BN$1, firstFactor: number, secondFactor: number[], thirdFactor: BN$1, baseFeeMode: BaseFeeMode): BaseFeeHandler;
8269
+ declare function getBaseFeeHandler(rawData: number[]): BaseFeeHandler;
7830
8270
 
7831
8271
  /**
7832
8272
  * Check if dynamic fee is enabled
@@ -7844,60 +8284,108 @@ declare function isDynamicFeeEnabled(dynamicFee: DynamicFeeStruct): boolean;
7844
8284
  */
7845
8285
  declare function getDynamicFeeNumerator(volatilityAccumulator: BN$1, binStep: BN$1, variableFeeControl: BN$1): BN$1;
7846
8286
 
8287
+ /**
8288
+ * Gets the fee numerator on linear fee scheduler.
8289
+ * @param cliffFeeNumerator - The cliff fee numerator.
8290
+ * @param reductionFactor - The reduction factor.
8291
+ * @param period - The period.
8292
+ * @returns The fee numerator on linear fee scheduler.
8293
+ */
8294
+ declare function getFeeNumeratorOnLinearFeeScheduler(cliffFeeNumerator: BN$1, reductionFactor: BN$1, period: number): BN$1;
8295
+ /**
8296
+ * Gets the fee numerator on exponential fee scheduler.
8297
+ * @param cliffFeeNumerator - The cliff fee numerator.
8298
+ * @param reductionFactor - The reduction factor.
8299
+ * @param period - The period.
8300
+ * @returns The fee numerator on exponential fee scheduler.
8301
+ */
8302
+ declare function getFeeNumeratorOnExponentialFeeScheduler(cliffFeeNumerator: BN$1, reductionFactor: BN$1, period: number): BN$1;
7847
8303
  /**
7848
8304
  * Gets the max base fee numerator.
7849
8305
  * @param cliffFeeNumerator - The cliff fee numerator.
7850
8306
  * @returns The max base fee numerator.
7851
8307
  */
7852
8308
  declare function getMaxBaseFeeNumerator(cliffFeeNumerator: BN$1): BN$1;
8309
+
7853
8310
  /**
7854
- * Gets the min base fee numerator.
7855
- * @param cliffFeeNumerator - The cliff fee numerator.
7856
- * @param numberOfPeriod - The number of periods.
7857
- * @param periodFrequency - The period frequency.
7858
- * @param reductionFactor - The reduction factor.
7859
- * @param feeSchedulerMode - The fee scheduler mode.
7860
- * @returns The min base fee numerator.
8311
+ * Converts a BorshFeeTimeScheduler object to a PodAlignedFeeTimeScheduler object,
8312
+ * @param borshFeeScheduler The BorshFeeTimeScheduler instance to convert.
8313
+ * @returns The corresponding PodAlignedFeeTimeScheduler object.
8314
+ */
8315
+ declare function toPodAlignedFeeTimeScheduler(borshFeeScheduler: BorshFeeTimeScheduler): PodAlignedFeeTimeScheduler;
8316
+ /**
8317
+ * Converts a PodAlignedFeeTimeScheduler object to a BorshFeeTimeScheduler object,
8318
+ * @param podAlignedFeeScheduler The PodAlignedFeeTimeScheduler instance to convert.
8319
+ * @returns The corresponding BorshFeeTimeScheduler object.
7861
8320
  */
7862
- declare function getMinBaseFeeNumerator(cliffFeeNumerator: BN$1, numberOfPeriod: number, reductionFactor: BN$1, feeSchedulerMode: BaseFeeMode): BN$1;
8321
+ declare function toBorshFeeTimeScheduler(podAlignedFeeScheduler: PodAlignedFeeTimeScheduler): BorshFeeTimeScheduler;
7863
8322
  /**
7864
- * Gets the base fee numerator by period.
8323
+ * Gets the base fee numerator by period for the time fee scheduler.
7865
8324
  * @param cliffFeeNumerator - The cliff fee numerator.
7866
8325
  * @param numberOfPeriod - The number of periods.
7867
8326
  * @param period - The period.
7868
8327
  * @param reductionFactor - The reduction factor.
7869
- * @param feeSchedulerMode - The fee scheduler mode.
8328
+ * @param feeTimeSchedulerMode - The fee scheduler mode.
7870
8329
  * @returns The base fee numerator by period.
7871
8330
  */
7872
- declare function getBaseFeeNumeratorByPeriod(cliffFeeNumerator: BN$1, numberOfPeriod: number, period: BN$1, reductionFactor: BN$1, feeSchedulerMode: BaseFeeMode): BN$1;
8331
+ declare function getFeeTimeBaseFeeNumeratorByPeriod(cliffFeeNumerator: BN$1, numberOfPeriod: number, period: BN$1, reductionFactor: BN$1, feeTimeSchedulerMode: BaseFeeMode): BN$1;
7873
8332
  /**
7874
- * Gets the fee numerator on linear fee scheduler.
8333
+ * Gets the base fee numerator.
7875
8334
  * @param cliffFeeNumerator - The cliff fee numerator.
8335
+ * @param numberOfPeriod - The number of periods.
8336
+ * @param periodFrequency - The period frequency.
7876
8337
  * @param reductionFactor - The reduction factor.
7877
- * @param period - The period.
7878
- * @returns The fee numerator on linear fee scheduler.
8338
+ * @param feeTimeSchedulerMode - The fee scheduler mode.
8339
+ * @param currentPoint - The current point.
8340
+ * @param activationPoint - The activation point.
8341
+ * @returns The base fee numerator.
7879
8342
  */
7880
- declare function getFeeNumeratorOnLinearFeeScheduler(cliffFeeNumerator: BN$1, reductionFactor: BN$1, period: number): BN$1;
8343
+ declare function getFeeTimeBaseFeeNumerator(cliffFeeNumerator: BN$1, numberOfPeriod: number, periodFrequency: BN$1, reductionFactor: BN$1, feeTimeSchedulerMode: BaseFeeMode, currentPoint: BN$1, activationPoint: BN$1): BN$1;
7881
8344
  /**
7882
- * Gets the fee numerator on exponential fee scheduler.
8345
+ * Gets the min base fee numerator.
7883
8346
  * @param cliffFeeNumerator - The cliff fee numerator.
8347
+ * @param numberOfPeriod - The number of periods.
8348
+ * @param periodFrequency - The period frequency.
7884
8349
  * @param reductionFactor - The reduction factor.
8350
+ * @param feeTimeSchedulerMode - The fee scheduler mode.
8351
+ * @returns The min base fee numerator.
8352
+ */
8353
+ declare function getFeeTimeMinBaseFeeNumerator(cliffFeeNumerator: BN$1, numberOfPeriod: number, reductionFactor: BN$1, feeTimeSchedulerMode: BaseFeeMode): BN$1;
8354
+
8355
+ /**
8356
+ * Gets the base fee numerator by period for the market cap fee scheduler.
8357
+ * @param cliffFeeNumerator - The cliff fee numerator.
8358
+ * @param numberOfPeriod - The number of periods.
7885
8359
  * @param period - The period.
7886
- * @returns The fee numerator on exponential fee scheduler.
8360
+ * @param reductionFactor - The reduction factor.
8361
+ * @param feeMarketCapSchedulerMode - The fee scheduler mode.
8362
+ * @returns The base fee numerator by period.
7887
8363
  */
7888
- declare function getFeeNumeratorOnExponentialFeeScheduler(cliffFeeNumerator: BN$1, reductionFactor: BN$1, period: number): BN$1;
8364
+ declare function getFeeMarketCapBaseFeeNumeratorByPeriod(cliffFeeNumerator: BN$1, numberOfPeriod: number, period: BN$1, reductionFactor: BN$1, feeMarketCapSchedulerMode: BaseFeeMode): BN$1;
7889
8365
  /**
7890
- * Gets the base fee numerator.
8366
+ * Gets the base fee numerator for market cap scheduler.
7891
8367
  * @param cliffFeeNumerator - The cliff fee numerator.
7892
8368
  * @param numberOfPeriod - The number of periods.
7893
- * @param periodFrequency - The period frequency.
8369
+ * @param sqrtPriceStepBps - The sqrt price step bps.
8370
+ * @param schedulerExpirationDuration - The scheduler expiration duration.
7894
8371
  * @param reductionFactor - The reduction factor.
7895
- * @param feeSchedulerMode - The fee scheduler mode.
8372
+ * @param feeMarketCapSchedulerMode - The fee scheduler mode.
7896
8373
  * @param currentPoint - The current point.
7897
8374
  * @param activationPoint - The activation point.
8375
+ * @param initSqrtPrice - The initial sqrt price.
8376
+ * @param currentSqrtPrice - The current sqrt price.
7898
8377
  * @returns The base fee numerator.
7899
8378
  */
7900
- declare function getBaseFeeNumerator(cliffFeeNumerator: BN$1, numberOfPeriod: number, periodFrequency: BN$1, reductionFactor: BN$1, feeSchedulerMode: BaseFeeMode, currentPoint: BN$1, activationPoint: BN$1): BN$1;
8379
+ declare function getFeeMarketCapBaseFeeNumerator(cliffFeeNumerator: BN$1, numberOfPeriod: number, sqrtPriceStepBps: number, schedulerExpirationDuration: number, reductionFactor: BN$1, feeMarketCapSchedulerMode: BaseFeeMode, currentPoint: BN$1, activationPoint: BN$1, initSqrtPrice: BN$1, currentSqrtPrice: BN$1): BN$1;
8380
+ /**
8381
+ * Gets the min base fee numerator for market cap scheduler.
8382
+ * @param cliffFeeNumerator - The cliff fee numerator.
8383
+ * @param numberOfPeriod - The number of periods.
8384
+ * @param reductionFactor - The reduction factor.
8385
+ * @param feeMarketCapSchedulerMode - The fee scheduler mode.
8386
+ * @returns The min base fee numerator.
8387
+ */
8388
+ declare function getFeeMarketCapMinBaseFeeNumerator(cliffFeeNumerator: BN$1, numberOfPeriod: number, reductionFactor: BN$1, feeMarketCapSchedulerMode: BaseFeeMode): BN$1;
7901
8389
 
7902
8390
  /**
7903
8391
  * Checks if the rate limiter is zero.
@@ -7990,7 +8478,7 @@ declare function getFeeNumeratorFromExcludedFeeAmount(excludedFeeAmount: BN$1, r
7990
8478
  * @param currentPoint - The current point
7991
8479
  * @returns The swap result from exact input
7992
8480
  */
7993
- declare function getSwapResultFromExactInput(poolState: PoolState, amountIn: BN$1, feeMode: FeeMode, tradeDirection: TradeDirection, currentPoint: BN$1): SwapResult2;
8481
+ declare function getSwapResultFromExactInput(program: Program<CpAmm$1>, poolState: PoolState, amountIn: BN$1, feeMode: FeeMode, tradeDirection: TradeDirection, currentPoint: BN$1): SwapResult2;
7994
8482
  /**
7995
8483
  * Calculates the swap result from exact input
7996
8484
  * @param poolState - The pool state
@@ -8022,7 +8510,7 @@ declare function calculateBtoAFromAmountIn(poolState: PoolState, amountIn: BN$1)
8022
8510
  * @param currentPoint - The current point
8023
8511
  * @returns The swap result from partial input
8024
8512
  */
8025
- declare function getSwapResultFromPartialInput(poolState: PoolState, amountIn: BN$1, feeMode: FeeMode, tradeDirection: TradeDirection, currentPoint: BN$1): SwapResult2;
8513
+ declare function getSwapResultFromPartialInput(program: Program<CpAmm$1>, poolState: PoolState, amountIn: BN$1, feeMode: FeeMode, tradeDirection: TradeDirection, currentPoint: BN$1): SwapResult2;
8026
8514
  /**
8027
8515
  * Calculates the swap result from partial input
8028
8516
  * @param poolState - The pool state
@@ -8054,7 +8542,7 @@ declare function calculateBtoAFromPartialAmountIn(poolState: PoolState, amountIn
8054
8542
  * @param currentPoint - The current point
8055
8543
  * @returns The swap result from exact output
8056
8544
  */
8057
- declare function getSwapResultFromExactOutput(poolState: PoolState, amountOut: BN$1, feeMode: FeeMode, tradeDirection: TradeDirection, currentPoint: BN$1): SwapResult2;
8545
+ declare function getSwapResultFromExactOutput(program: Program<CpAmm$1>, poolState: PoolState, amountOut: BN$1, feeMode: FeeMode, tradeDirection: TradeDirection, currentPoint: BN$1): SwapResult2;
8058
8546
  /**
8059
8547
  * Calculates the swap result from exact output
8060
8548
  * @param poolState - The pool state
@@ -8089,7 +8577,7 @@ declare function calculateBtoAFromAmountOut(poolState: PoolState, amountOut: BN$
8089
8577
  * @param outputTokenInfo - The output token info
8090
8578
  * @returns The swap quote exact input
8091
8579
  */
8092
- declare function swapQuoteExactInput(pool: PoolState, currentPoint: BN$1, amountIn: BN$1, slippage: number, aToB: boolean, hasReferral: boolean, tokenADecimal: number, tokenBDecimal: number, inputTokenInfo?: {
8580
+ declare function swapQuoteExactInput(program: Program<CpAmm$1>, pool: PoolState, currentPoint: BN$1, amountIn: BN$1, slippage: number, aToB: boolean, hasReferral: boolean, tokenADecimal: number, tokenBDecimal: number, inputTokenInfo?: {
8093
8581
  mint: Mint;
8094
8582
  currentEpoch: number;
8095
8583
  }, outputTokenInfo?: {
@@ -8110,7 +8598,7 @@ declare function swapQuoteExactInput(pool: PoolState, currentPoint: BN$1, amount
8110
8598
  * @param outputTokenInfo - The output token info
8111
8599
  * @returns The swap quote exact output
8112
8600
  */
8113
- declare function swapQuoteExactOutput(pool: PoolState, currentPoint: BN$1, amountOut: BN$1, slippage: number, aToB: boolean, hasReferral: boolean, tokenADecimal: number, tokenBDecimal: number, inputTokenInfo?: {
8601
+ declare function swapQuoteExactOutput(program: Program<CpAmm$1>, pool: PoolState, currentPoint: BN$1, amountOut: BN$1, slippage: number, aToB: boolean, hasReferral: boolean, tokenADecimal: number, tokenBDecimal: number, inputTokenInfo?: {
8114
8602
  mint: Mint;
8115
8603
  currentEpoch: number;
8116
8604
  }, outputTokenInfo?: {
@@ -8131,7 +8619,7 @@ declare function swapQuoteExactOutput(pool: PoolState, currentPoint: BN$1, amoun
8131
8619
  * @param outputTokenInfo - The output token info
8132
8620
  * @returns The swap quote partial input
8133
8621
  */
8134
- declare function swapQuotePartialInput(pool: PoolState, currentPoint: BN$1, amountIn: BN$1, slippage: number, aToB: boolean, hasReferral: boolean, tokenADecimal: number, tokenBDecimal: number, inputTokenInfo?: {
8622
+ declare function swapQuotePartialInput(program: Program<CpAmm$1>, pool: PoolState, currentPoint: BN$1, amountIn: BN$1, slippage: number, aToB: boolean, hasReferral: boolean, tokenADecimal: number, tokenBDecimal: number, inputTokenInfo?: {
8135
8623
  mint: Mint;
8136
8624
  currentEpoch: number;
8137
8625
  }, outputTokenInfo?: {
@@ -8256,7 +8744,7 @@ declare function calculateInitSqrtPrice(tokenAAmount: BN, tokenBAmount: BN, minS
8256
8744
  var address = "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
8257
8745
  var metadata = {
8258
8746
  name: "cp_amm",
8259
- version: "0.1.5",
8747
+ version: "0.1.6",
8260
8748
  spec: "0.1.0",
8261
8749
  description: "Created with Anchor"
8262
8750
  };
@@ -8928,19 +9416,19 @@ var instructions = [
8928
9416
  }
8929
9417
  },
8930
9418
  {
8931
- name: "claim_fee_operator",
9419
+ name: "operator",
8932
9420
  docs: [
8933
9421
  "Claim fee operator"
8934
9422
  ]
8935
9423
  },
8936
9424
  {
8937
- name: "operator",
9425
+ name: "whitelisted_address",
8938
9426
  docs: [
8939
9427
  "Operator"
8940
9428
  ],
8941
9429
  signer: true,
8942
9430
  relations: [
8943
- "claim_fee_operator"
9431
+ "operator"
8944
9432
  ]
8945
9433
  },
8946
9434
  {
@@ -9102,29 +9590,35 @@ var instructions = [
9102
9590
  ]
9103
9591
  },
9104
9592
  {
9105
- name: "close_claim_fee_operator",
9593
+ name: "close_config",
9106
9594
  discriminator: [
9107
- 38,
9108
- 134,
9109
- 82,
9110
- 216,
9595
+ 145,
9596
+ 9,
9597
+ 72,
9598
+ 157,
9111
9599
  95,
9112
- 124,
9113
- 17,
9114
- 99
9600
+ 125,
9601
+ 61,
9602
+ 85
9115
9603
  ],
9116
9604
  accounts: [
9117
9605
  {
9118
- name: "claim_fee_operator",
9606
+ name: "config",
9119
9607
  writable: true
9120
9608
  },
9121
9609
  {
9122
- name: "rent_receiver",
9123
- writable: true
9610
+ name: "operator"
9124
9611
  },
9125
9612
  {
9126
- name: "admin",
9127
- signer: true
9613
+ name: "whitelisted_address",
9614
+ signer: true,
9615
+ relations: [
9616
+ "operator"
9617
+ ]
9618
+ },
9619
+ {
9620
+ name: "rent_receiver",
9621
+ writable: true
9128
9622
  },
9129
9623
  {
9130
9624
  name: "event_authority",
@@ -9163,25 +9657,24 @@ var instructions = [
9163
9657
  ]
9164
9658
  },
9165
9659
  {
9166
- name: "close_config",
9660
+ name: "close_operator_account",
9167
9661
  discriminator: [
9168
- 145,
9662
+ 171,
9169
9663
  9,
9170
- 72,
9171
- 157,
9172
- 95,
9173
- 125,
9174
- 61,
9175
- 85
9664
+ 213,
9665
+ 74,
9666
+ 120,
9667
+ 23,
9668
+ 3,
9669
+ 29
9176
9670
  ],
9177
9671
  accounts: [
9178
9672
  {
9179
- name: "config",
9673
+ name: "operator",
9180
9674
  writable: true
9181
9675
  },
9182
9676
  {
9183
9677
  name: "admin",
9184
- writable: true,
9185
9678
  signer: true
9186
9679
  },
9187
9680
  {
@@ -9338,9 +9831,14 @@ var instructions = [
9338
9831
  writable: true
9339
9832
  },
9340
9833
  {
9341
- name: "admin",
9342
- writable: true,
9343
- signer: true
9834
+ name: "operator"
9835
+ },
9836
+ {
9837
+ name: "whitelisted_address",
9838
+ signer: true,
9839
+ relations: [
9840
+ "operator"
9841
+ ]
9344
9842
  },
9345
9843
  {
9346
9844
  name: "rent_receiver",
@@ -9383,20 +9881,23 @@ var instructions = [
9383
9881
  ]
9384
9882
  },
9385
9883
  {
9386
- name: "create_claim_fee_operator",
9884
+ name: "create_config",
9885
+ docs: [
9886
+ "OPERATOR FUNCTIONS /////"
9887
+ ],
9387
9888
  discriminator: [
9388
- 169,
9389
- 62,
9889
+ 201,
9390
9890
  207,
9391
- 107,
9392
- 58,
9393
- 187,
9394
- 162,
9395
- 109
9891
+ 243,
9892
+ 114,
9893
+ 75,
9894
+ 111,
9895
+ 47,
9896
+ 189
9396
9897
  ],
9397
9898
  accounts: [
9398
9899
  {
9399
- name: "claim_fee_operator",
9900
+ name: "config",
9400
9901
  writable: true,
9401
9902
  pda: {
9402
9903
  seeds: [
@@ -9404,21 +9905,16 @@ var instructions = [
9404
9905
  kind: "const",
9405
9906
  value: [
9406
9907
  99,
9407
- 102,
9408
- 95,
9409
- 111,
9410
- 112,
9411
- 101,
9412
- 114,
9413
- 97,
9414
- 116,
9415
9908
  111,
9416
- 114
9909
+ 110,
9910
+ 102,
9911
+ 105,
9912
+ 103
9417
9913
  ]
9418
9914
  },
9419
9915
  {
9420
- kind: "account",
9421
- path: "operator"
9916
+ kind: "arg",
9917
+ path: "index"
9422
9918
  }
9423
9919
  ]
9424
9920
  }
@@ -9427,7 +9923,14 @@ var instructions = [
9427
9923
  name: "operator"
9428
9924
  },
9429
9925
  {
9430
- name: "admin",
9926
+ name: "whitelisted_address",
9927
+ signer: true,
9928
+ relations: [
9929
+ "operator"
9930
+ ]
9931
+ },
9932
+ {
9933
+ name: "payer",
9431
9934
  writable: true,
9432
9935
  signer: true
9433
9936
  },
@@ -9469,22 +9972,31 @@ var instructions = [
9469
9972
  }
9470
9973
  ],
9471
9974
  args: [
9975
+ {
9976
+ name: "index",
9977
+ type: "u64"
9978
+ },
9979
+ {
9980
+ name: "config_parameters",
9981
+ type: {
9982
+ defined: {
9983
+ name: "StaticConfigParameters"
9984
+ }
9985
+ }
9986
+ }
9472
9987
  ]
9473
9988
  },
9474
9989
  {
9475
- name: "create_config",
9476
- docs: [
9477
- "ADMIN FUNCTIONS /////"
9478
- ],
9990
+ name: "create_dynamic_config",
9479
9991
  discriminator: [
9480
- 201,
9481
- 207,
9482
- 243,
9483
- 114,
9484
- 75,
9485
- 111,
9486
- 47,
9487
- 189
9992
+ 81,
9993
+ 251,
9994
+ 122,
9995
+ 78,
9996
+ 66,
9997
+ 57,
9998
+ 208,
9999
+ 82
9488
10000
  ],
9489
10001
  accounts: [
9490
10002
  {
@@ -9511,7 +10023,17 @@ var instructions = [
9511
10023
  }
9512
10024
  },
9513
10025
  {
9514
- name: "admin",
10026
+ name: "operator"
10027
+ },
10028
+ {
10029
+ name: "whitelisted_address",
10030
+ signer: true,
10031
+ relations: [
10032
+ "operator"
10033
+ ]
10034
+ },
10035
+ {
10036
+ name: "payer",
9515
10037
  writable: true,
9516
10038
  signer: true
9517
10039
  },
@@ -9561,50 +10083,62 @@ var instructions = [
9561
10083
  name: "config_parameters",
9562
10084
  type: {
9563
10085
  defined: {
9564
- name: "StaticConfigParameters"
10086
+ name: "DynamicConfigParameters"
9565
10087
  }
9566
10088
  }
9567
10089
  }
9568
10090
  ]
9569
10091
  },
9570
10092
  {
9571
- name: "create_dynamic_config",
10093
+ name: "create_operator_account",
10094
+ docs: [
10095
+ "ADMIN FUNCTIONS /////"
10096
+ ],
9572
10097
  discriminator: [
9573
- 81,
9574
- 251,
9575
- 122,
9576
- 78,
9577
- 66,
9578
- 57,
9579
- 208,
9580
- 82
10098
+ 221,
10099
+ 64,
10100
+ 246,
10101
+ 149,
10102
+ 240,
10103
+ 153,
10104
+ 229,
10105
+ 163
9581
10106
  ],
9582
10107
  accounts: [
9583
10108
  {
9584
- name: "config",
10109
+ name: "operator",
9585
10110
  writable: true,
9586
10111
  pda: {
9587
10112
  seeds: [
9588
10113
  {
9589
10114
  kind: "const",
9590
10115
  value: [
9591
- 99,
9592
10116
  111,
9593
- 110,
9594
- 102,
9595
- 105,
9596
- 103
10117
+ 112,
10118
+ 101,
10119
+ 114,
10120
+ 97,
10121
+ 116,
10122
+ 111,
10123
+ 114
9597
10124
  ]
9598
10125
  },
9599
10126
  {
9600
- kind: "arg",
9601
- path: "index"
10127
+ kind: "account",
10128
+ path: "whitelisted_address"
9602
10129
  }
9603
10130
  ]
9604
10131
  }
9605
10132
  },
10133
+ {
10134
+ name: "whitelisted_address"
10135
+ },
9606
10136
  {
9607
10137
  name: "admin",
10138
+ signer: true
10139
+ },
10140
+ {
10141
+ name: "payer",
9608
10142
  writable: true,
9609
10143
  signer: true
9610
10144
  },
@@ -9647,16 +10181,8 @@ var instructions = [
9647
10181
  ],
9648
10182
  args: [
9649
10183
  {
9650
- name: "index",
9651
- type: "u64"
9652
- },
9653
- {
9654
- name: "config_parameters",
9655
- type: {
9656
- defined: {
9657
- name: "DynamicConfigParameters"
9658
- }
9659
- }
10184
+ name: "permission",
10185
+ type: "u128"
9660
10186
  }
9661
10187
  ]
9662
10188
  },
@@ -9857,7 +10383,17 @@ var instructions = [
9857
10383
  name: "token_mint"
9858
10384
  },
9859
10385
  {
9860
- name: "admin",
10386
+ name: "operator"
10387
+ },
10388
+ {
10389
+ name: "whitelisted_address",
10390
+ signer: true,
10391
+ relations: [
10392
+ "operator"
10393
+ ]
10394
+ },
10395
+ {
10396
+ name: "payer",
9861
10397
  writable: true,
9862
10398
  signer: true
9863
10399
  },
@@ -9901,6 +10437,40 @@ var instructions = [
9901
10437
  args: [
9902
10438
  ]
9903
10439
  },
10440
+ {
10441
+ name: "dummy_ix",
10442
+ discriminator: [
10443
+ 234,
10444
+ 95,
10445
+ 176,
10446
+ 185,
10447
+ 7,
10448
+ 42,
10449
+ 35,
10450
+ 159
10451
+ ],
10452
+ accounts: [
10453
+ {
10454
+ name: "pod_aligned_fee_time_scheduler"
10455
+ },
10456
+ {
10457
+ name: "pod_aligned_fee_rate_limiter"
10458
+ },
10459
+ {
10460
+ name: "pod_aligned_fee_market_cap_scheduler"
10461
+ }
10462
+ ],
10463
+ args: [
10464
+ {
10465
+ name: "_ixs",
10466
+ type: {
10467
+ defined: {
10468
+ name: "DummyParams"
10469
+ }
10470
+ }
10471
+ }
10472
+ ]
10473
+ },
9904
10474
  {
9905
10475
  name: "fund_reward",
9906
10476
  discriminator: [
@@ -11463,8 +12033,14 @@ var instructions = [
11463
12033
  writable: true
11464
12034
  },
11465
12035
  {
11466
- name: "admin",
11467
- signer: true
12036
+ name: "operator"
12037
+ },
12038
+ {
12039
+ name: "whitelisted_address",
12040
+ signer: true,
12041
+ relations: [
12042
+ "operator"
12043
+ ]
11468
12044
  },
11469
12045
  {
11470
12046
  name: "event_authority",
@@ -11844,7 +12420,7 @@ var instructions = [
11844
12420
  ],
11845
12421
  args: [
11846
12422
  {
11847
- name: "params",
12423
+ name: "_params",
11848
12424
  type: {
11849
12425
  defined: {
11850
12426
  name: "SwapParameters"
@@ -11985,7 +12561,7 @@ var instructions = [
11985
12561
  ],
11986
12562
  args: [
11987
12563
  {
11988
- name: "params",
12564
+ name: "_params",
11989
12565
  type: {
11990
12566
  defined: {
11991
12567
  name: "SwapParameters2"
@@ -11994,6 +12570,77 @@ var instructions = [
11994
12570
  }
11995
12571
  ]
11996
12572
  },
12573
+ {
12574
+ name: "update_pool_fees",
12575
+ discriminator: [
12576
+ 118,
12577
+ 217,
12578
+ 203,
12579
+ 179,
12580
+ 60,
12581
+ 8,
12582
+ 70,
12583
+ 89
12584
+ ],
12585
+ accounts: [
12586
+ {
12587
+ name: "pool",
12588
+ writable: true
12589
+ },
12590
+ {
12591
+ name: "operator"
12592
+ },
12593
+ {
12594
+ name: "whitelisted_address",
12595
+ signer: true,
12596
+ relations: [
12597
+ "operator"
12598
+ ]
12599
+ },
12600
+ {
12601
+ name: "event_authority",
12602
+ pda: {
12603
+ seeds: [
12604
+ {
12605
+ kind: "const",
12606
+ value: [
12607
+ 95,
12608
+ 95,
12609
+ 101,
12610
+ 118,
12611
+ 101,
12612
+ 110,
12613
+ 116,
12614
+ 95,
12615
+ 97,
12616
+ 117,
12617
+ 116,
12618
+ 104,
12619
+ 111,
12620
+ 114,
12621
+ 105,
12622
+ 116,
12623
+ 121
12624
+ ]
12625
+ }
12626
+ ]
12627
+ }
12628
+ },
12629
+ {
12630
+ name: "program"
12631
+ }
12632
+ ],
12633
+ args: [
12634
+ {
12635
+ name: "params",
12636
+ type: {
12637
+ defined: {
12638
+ name: "UpdatePoolFeesParameters"
12639
+ }
12640
+ }
12641
+ }
12642
+ ]
12643
+ },
11997
12644
  {
11998
12645
  name: "update_reward_duration",
11999
12646
  discriminator: [
@@ -12205,19 +12852,6 @@ var instructions = [
12205
12852
  }
12206
12853
  ];
12207
12854
  var accounts = [
12208
- {
12209
- name: "ClaimFeeOperator",
12210
- discriminator: [
12211
- 166,
12212
- 48,
12213
- 134,
12214
- 86,
12215
- 34,
12216
- 200,
12217
- 188,
12218
- 150
12219
- ]
12220
- },
12221
12855
  {
12222
12856
  name: "Config",
12223
12857
  discriminator: [
@@ -12231,6 +12865,58 @@ var accounts = [
12231
12865
  130
12232
12866
  ]
12233
12867
  },
12868
+ {
12869
+ name: "Operator",
12870
+ discriminator: [
12871
+ 219,
12872
+ 31,
12873
+ 188,
12874
+ 145,
12875
+ 69,
12876
+ 139,
12877
+ 204,
12878
+ 117
12879
+ ]
12880
+ },
12881
+ {
12882
+ name: "PodAlignedFeeMarketCapScheduler",
12883
+ discriminator: [
12884
+ 251,
12885
+ 130,
12886
+ 208,
12887
+ 253,
12888
+ 245,
12889
+ 27,
12890
+ 145,
12891
+ 203
12892
+ ]
12893
+ },
12894
+ {
12895
+ name: "PodAlignedFeeRateLimiter",
12896
+ discriminator: [
12897
+ 160,
12898
+ 219,
12899
+ 8,
12900
+ 251,
12901
+ 179,
12902
+ 7,
12903
+ 16,
12904
+ 117
12905
+ ]
12906
+ },
12907
+ {
12908
+ name: "PodAlignedFeeTimeScheduler",
12909
+ discriminator: [
12910
+ 239,
12911
+ 132,
12912
+ 138,
12913
+ 213,
12914
+ 67,
12915
+ 154,
12916
+ 130,
12917
+ 70
12918
+ ]
12919
+ },
12234
12920
  {
12235
12921
  name: "Pool",
12236
12922
  discriminator: [
@@ -12285,19 +12971,6 @@ var accounts = [
12285
12971
  }
12286
12972
  ];
12287
12973
  var events = [
12288
- {
12289
- name: "EvtAddLiquidity",
12290
- discriminator: [
12291
- 175,
12292
- 242,
12293
- 8,
12294
- 157,
12295
- 30,
12296
- 247,
12297
- 185,
12298
- 169
12299
- ]
12300
- },
12301
12974
  {
12302
12975
  name: "EvtClaimPartnerFee",
12303
12976
  discriminator: [
@@ -12350,19 +13023,6 @@ var events = [
12350
13023
  231
12351
13024
  ]
12352
13025
  },
12353
- {
12354
- name: "EvtCloseClaimFeeOperator",
12355
- discriminator: [
12356
- 111,
12357
- 39,
12358
- 37,
12359
- 55,
12360
- 110,
12361
- 216,
12362
- 194,
12363
- 23
12364
- ]
12365
- },
12366
13026
  {
12367
13027
  name: "EvtCloseConfig",
12368
13028
  discriminator: [
@@ -12390,20 +13050,7 @@ var events = [
12390
13050
  ]
12391
13051
  },
12392
13052
  {
12393
- name: "EvtCreateClaimFeeOperator",
12394
- discriminator: [
12395
- 21,
12396
- 6,
12397
- 153,
12398
- 120,
12399
- 68,
12400
- 116,
12401
- 28,
12402
- 177
12403
- ]
12404
- },
12405
- {
12406
- name: "EvtCreateConfig",
13053
+ name: "EvtCreateConfig",
12407
13054
  discriminator: [
12408
13055
  131,
12409
13056
  207,
@@ -12532,19 +13179,6 @@ var events = [
12532
13179
  11
12533
13180
  ]
12534
13181
  },
12535
- {
12536
- name: "EvtRemoveLiquidity",
12537
- discriminator: [
12538
- 87,
12539
- 46,
12540
- 88,
12541
- 98,
12542
- 175,
12543
- 96,
12544
- 34,
12545
- 91
12546
- ]
12547
- },
12548
13182
  {
12549
13183
  name: "EvtSetPoolStatus",
12550
13184
  discriminator: [
@@ -12571,19 +13205,6 @@ var events = [
12571
13205
  103
12572
13206
  ]
12573
13207
  },
12574
- {
12575
- name: "EvtSwap",
12576
- discriminator: [
12577
- 27,
12578
- 60,
12579
- 21,
12580
- 213,
12581
- 138,
12582
- 170,
12583
- 187,
12584
- 147
12585
- ]
12586
- },
12587
13208
  {
12588
13209
  name: "EvtSwap2",
12589
13210
  discriminator: [
@@ -12597,6 +13218,19 @@ var events = [
12597
13218
  153
12598
13219
  ]
12599
13220
  },
13221
+ {
13222
+ name: "EvtUpdatePoolFees",
13223
+ discriminator: [
13224
+ 76,
13225
+ 165,
13226
+ 246,
13227
+ 102,
13228
+ 102,
13229
+ 217,
13230
+ 156,
13231
+ 44
13232
+ ]
13233
+ },
12600
13234
  {
12601
13235
  name: "EvtUpdateRewardDuration",
12602
13236
  discriminator: [
@@ -12890,7 +13524,7 @@ var errors = [
12890
13524
  },
12891
13525
  {
12892
13526
  code: 6050,
12893
- name: "InvalidFeeScheduler",
13527
+ name: "InvalidFeeTimeScheduler",
12894
13528
  msg: "Invalid fee scheduler"
12895
13529
  },
12896
13530
  {
@@ -12902,6 +13536,41 @@ var errors = [
12902
13536
  code: 6052,
12903
13537
  name: "InvalidPoolVersion",
12904
13538
  msg: "Invalid pool version"
13539
+ },
13540
+ {
13541
+ code: 6053,
13542
+ name: "InvalidAuthority",
13543
+ msg: "Invalid authority to do that action"
13544
+ },
13545
+ {
13546
+ code: 6054,
13547
+ name: "InvalidPermission",
13548
+ msg: "Invalid permission"
13549
+ },
13550
+ {
13551
+ code: 6055,
13552
+ name: "InvalidFeeMarketCapScheduler",
13553
+ msg: "Invalid fee market cap scheduler"
13554
+ },
13555
+ {
13556
+ code: 6056,
13557
+ name: "CannotUpdateBaseFee",
13558
+ msg: "Cannot update base fee"
13559
+ },
13560
+ {
13561
+ code: 6057,
13562
+ name: "InvalidDynamicFeeParameters",
13563
+ msg: "Invalid dynamic fee parameters"
13564
+ },
13565
+ {
13566
+ code: 6058,
13567
+ name: "InvalidUpdatePoolFeesParameters",
13568
+ msg: "Invalid update pool fees parameters"
13569
+ },
13570
+ {
13571
+ code: 6059,
13572
+ name: "MissingOperatorAccount",
13573
+ msg: "Missing operator account"
12905
13574
  }
12906
13575
  ];
12907
13576
  var types = [
@@ -12935,7 +13604,7 @@ var types = [
12935
13604
  }
12936
13605
  },
12937
13606
  {
12938
- name: "BaseFeeConfig",
13607
+ name: "BaseFeeInfo",
12939
13608
  serialization: "bytemuck",
12940
13609
  repr: {
12941
13610
  kind: "c"
@@ -12944,44 +13613,60 @@ var types = [
12944
13613
  kind: "struct",
12945
13614
  fields: [
12946
13615
  {
12947
- name: "cliff_fee_numerator",
12948
- type: "u64"
12949
- },
12950
- {
12951
- name: "base_fee_mode",
12952
- type: "u8"
12953
- },
12954
- {
12955
- name: "padding",
13616
+ name: "data",
12956
13617
  type: {
12957
13618
  array: [
12958
13619
  "u8",
12959
- 5
13620
+ 32
12960
13621
  ]
12961
13622
  }
12962
- },
12963
- {
12964
- name: "first_factor",
12965
- type: "u16"
12966
- },
13623
+ }
13624
+ ]
13625
+ }
13626
+ },
13627
+ {
13628
+ name: "BaseFeeParameters",
13629
+ type: {
13630
+ kind: "struct",
13631
+ fields: [
12967
13632
  {
12968
- name: "second_factor",
13633
+ name: "data",
12969
13634
  type: {
12970
13635
  array: [
12971
13636
  "u8",
12972
- 8
13637
+ 30
12973
13638
  ]
12974
13639
  }
13640
+ }
13641
+ ]
13642
+ }
13643
+ },
13644
+ {
13645
+ name: "BaseFeeStruct",
13646
+ serialization: "bytemuck",
13647
+ repr: {
13648
+ kind: "c"
13649
+ },
13650
+ type: {
13651
+ kind: "struct",
13652
+ fields: [
13653
+ {
13654
+ name: "base_fee_info",
13655
+ type: {
13656
+ defined: {
13657
+ name: "BaseFeeInfo"
13658
+ }
13659
+ }
12975
13660
  },
12976
13661
  {
12977
- name: "third_factor",
13662
+ name: "padding_1",
12978
13663
  type: "u64"
12979
13664
  }
12980
13665
  ]
12981
13666
  }
12982
13667
  },
12983
13668
  {
12984
- name: "BaseFeeParameters",
13669
+ name: "BorshFeeMarketCapScheduler",
12985
13670
  type: {
12986
13671
  kind: "struct",
12987
13672
  fields: [
@@ -12990,35 +13675,52 @@ var types = [
12990
13675
  type: "u64"
12991
13676
  },
12992
13677
  {
12993
- name: "first_factor",
13678
+ name: "number_of_period",
12994
13679
  type: "u16"
12995
13680
  },
12996
13681
  {
12997
- name: "second_factor",
12998
- type: {
12999
- array: [
13000
- "u8",
13001
- 8
13002
- ]
13003
- }
13682
+ name: "sqrt_price_step_bps",
13683
+ type: "u32"
13684
+ },
13685
+ {
13686
+ name: "scheduler_expiration_duration",
13687
+ type: "u32"
13004
13688
  },
13005
13689
  {
13006
- name: "third_factor",
13690
+ name: "reduction_factor",
13007
13691
  type: "u64"
13008
13692
  },
13009
13693
  {
13010
13694
  name: "base_fee_mode",
13011
13695
  type: "u8"
13696
+ },
13697
+ {
13698
+ name: "padding",
13699
+ type: {
13700
+ array: [
13701
+ "u8",
13702
+ 3
13703
+ ]
13704
+ }
13012
13705
  }
13013
13706
  ]
13014
13707
  }
13015
13708
  },
13016
13709
  {
13017
- name: "BaseFeeStruct",
13018
- serialization: "bytemuck",
13019
- repr: {
13020
- kind: "c"
13021
- },
13710
+ name: "BorshFeeRateLimiter",
13711
+ docs: [
13712
+ "we denote reference_amount = x0, cliff_fee_numerator = c, fee_increment = i",
13713
+ "if input_amount <= x0, then fee = input_amount * c",
13714
+ "",
13715
+ "if input_amount > x0, then input_amount = x0 + (a * x0 + b)",
13716
+ "if a < max_index",
13717
+ "then fee = x0 * c + x0 * (c + i) + .... + x0 * (c + i*a) + b * (c + i * (a+1))",
13718
+ "then fee = x0 * (c + c*a + i*a*(a+1)/2) + b * (c + i * (a+1))",
13719
+ "",
13720
+ "if a >= max_index",
13721
+ "if a = max_index + d, input_amount = x0 + max_index * x0 + (d * x0 + b)",
13722
+ "then fee = x0 * (c + c*max_index + i*max_index*(max_index+1)/2) + (d * x0 + b) * MAX_FEE"
13723
+ ],
13022
13724
  type: {
13023
13725
  kind: "struct",
13024
13726
  fields: [
@@ -13027,70 +13729,68 @@ var types = [
13027
13729
  type: "u64"
13028
13730
  },
13029
13731
  {
13030
- name: "base_fee_mode",
13031
- type: "u8"
13732
+ name: "fee_increment_bps",
13733
+ type: "u16"
13032
13734
  },
13033
13735
  {
13034
- name: "padding_0",
13035
- type: {
13036
- array: [
13037
- "u8",
13038
- 5
13039
- ]
13040
- }
13736
+ name: "max_limiter_duration",
13737
+ type: "u32"
13041
13738
  },
13042
13739
  {
13043
- name: "first_factor",
13044
- type: "u16"
13740
+ name: "max_fee_bps",
13741
+ type: "u32"
13045
13742
  },
13046
13743
  {
13047
- name: "second_factor",
13744
+ name: "reference_amount",
13745
+ type: "u64"
13746
+ },
13747
+ {
13748
+ name: "base_fee_mode",
13749
+ type: "u8"
13750
+ },
13751
+ {
13752
+ name: "padding",
13048
13753
  type: {
13049
13754
  array: [
13050
13755
  "u8",
13051
- 8
13756
+ 3
13052
13757
  ]
13053
13758
  }
13054
- },
13055
- {
13056
- name: "third_factor",
13057
- type: "u64"
13058
- },
13059
- {
13060
- name: "padding_1",
13061
- type: "u64"
13062
13759
  }
13063
13760
  ]
13064
13761
  }
13065
13762
  },
13066
13763
  {
13067
- name: "ClaimFeeOperator",
13068
- docs: [
13069
- "Parameter that set by the protocol"
13070
- ],
13071
- serialization: "bytemuck",
13072
- repr: {
13073
- kind: "c"
13074
- },
13764
+ name: "BorshFeeTimeScheduler",
13075
13765
  type: {
13076
13766
  kind: "struct",
13077
13767
  fields: [
13078
13768
  {
13079
- name: "operator",
13080
- docs: [
13081
- "operator"
13082
- ],
13083
- type: "pubkey"
13769
+ name: "cliff_fee_numerator",
13770
+ type: "u64"
13084
13771
  },
13085
13772
  {
13086
- name: "_padding",
13087
- docs: [
13088
- "Reserve"
13089
- ],
13773
+ name: "number_of_period",
13774
+ type: "u16"
13775
+ },
13776
+ {
13777
+ name: "period_frequency",
13778
+ type: "u64"
13779
+ },
13780
+ {
13781
+ name: "reduction_factor",
13782
+ type: "u64"
13783
+ },
13784
+ {
13785
+ name: "base_fee_mode",
13786
+ type: "u8"
13787
+ },
13788
+ {
13789
+ name: "padding",
13090
13790
  type: {
13091
13791
  array: [
13092
13792
  "u8",
13093
- 128
13793
+ 3
13094
13794
  ]
13095
13795
  }
13096
13796
  }
@@ -13201,6 +13901,38 @@ var types = [
13201
13901
  ]
13202
13902
  }
13203
13903
  },
13904
+ {
13905
+ name: "DummyParams",
13906
+ type: {
13907
+ kind: "struct",
13908
+ fields: [
13909
+ {
13910
+ name: "borsh_fee_time_scheduler_params",
13911
+ type: {
13912
+ defined: {
13913
+ name: "BorshFeeTimeScheduler"
13914
+ }
13915
+ }
13916
+ },
13917
+ {
13918
+ name: "borsh_fee_rate_limiter_params",
13919
+ type: {
13920
+ defined: {
13921
+ name: "BorshFeeRateLimiter"
13922
+ }
13923
+ }
13924
+ },
13925
+ {
13926
+ name: "borsh_fee_market_cap_scheduler_params",
13927
+ type: {
13928
+ defined: {
13929
+ name: "BorshFeeMarketCapScheduler"
13930
+ }
13931
+ }
13932
+ }
13933
+ ]
13934
+ }
13935
+ },
13204
13936
  {
13205
13937
  name: "DynamicConfigParameters",
13206
13938
  type: {
@@ -13380,50 +14112,6 @@ var types = [
13380
14112
  ]
13381
14113
  }
13382
14114
  },
13383
- {
13384
- name: "EvtAddLiquidity",
13385
- type: {
13386
- kind: "struct",
13387
- fields: [
13388
- {
13389
- name: "pool",
13390
- type: "pubkey"
13391
- },
13392
- {
13393
- name: "position",
13394
- type: "pubkey"
13395
- },
13396
- {
13397
- name: "owner",
13398
- type: "pubkey"
13399
- },
13400
- {
13401
- name: "params",
13402
- type: {
13403
- defined: {
13404
- name: "AddLiquidityParameters"
13405
- }
13406
- }
13407
- },
13408
- {
13409
- name: "token_a_amount",
13410
- type: "u64"
13411
- },
13412
- {
13413
- name: "token_b_amount",
13414
- type: "u64"
13415
- },
13416
- {
13417
- name: "total_amount_a",
13418
- type: "u64"
13419
- },
13420
- {
13421
- name: "total_amount_b",
13422
- type: "u64"
13423
- }
13424
- ]
13425
- }
13426
- },
13427
14115
  {
13428
14116
  name: "EvtClaimPartnerFee",
13429
14117
  type: {
@@ -13524,25 +14212,6 @@ var types = [
13524
14212
  ]
13525
14213
  }
13526
14214
  },
13527
- {
13528
- name: "EvtCloseClaimFeeOperator",
13529
- docs: [
13530
- "Close claim fee operator"
13531
- ],
13532
- type: {
13533
- kind: "struct",
13534
- fields: [
13535
- {
13536
- name: "claim_fee_operator",
13537
- type: "pubkey"
13538
- },
13539
- {
13540
- name: "operator",
13541
- type: "pubkey"
13542
- }
13543
- ]
13544
- }
13545
- },
13546
14215
  {
13547
14216
  name: "EvtCloseConfig",
13548
14217
  docs: [
@@ -13592,21 +14261,6 @@ var types = [
13592
14261
  ]
13593
14262
  }
13594
14263
  },
13595
- {
13596
- name: "EvtCreateClaimFeeOperator",
13597
- docs: [
13598
- "Create claim fee operator"
13599
- ],
13600
- type: {
13601
- kind: "struct",
13602
- fields: [
13603
- {
13604
- name: "operator",
13605
- type: "pubkey"
13606
- }
13607
- ]
13608
- }
13609
- },
13610
14264
  {
13611
14265
  name: "EvtCreateConfig",
13612
14266
  docs: [
@@ -14020,42 +14674,6 @@ var types = [
14020
14674
  ]
14021
14675
  }
14022
14676
  },
14023
- {
14024
- name: "EvtRemoveLiquidity",
14025
- type: {
14026
- kind: "struct",
14027
- fields: [
14028
- {
14029
- name: "pool",
14030
- type: "pubkey"
14031
- },
14032
- {
14033
- name: "position",
14034
- type: "pubkey"
14035
- },
14036
- {
14037
- name: "owner",
14038
- type: "pubkey"
14039
- },
14040
- {
14041
- name: "params",
14042
- type: {
14043
- defined: {
14044
- name: "RemoveLiquidityParameters"
14045
- }
14046
- }
14047
- },
14048
- {
14049
- name: "token_a_amount",
14050
- type: "u64"
14051
- },
14052
- {
14053
- name: "token_b_amount",
14054
- type: "u64"
14055
- }
14056
- ]
14057
- }
14058
- },
14059
14677
  {
14060
14678
  name: "EvtSetPoolStatus",
14061
14679
  type: {
@@ -14136,50 +14754,6 @@ var types = [
14136
14754
  ]
14137
14755
  }
14138
14756
  },
14139
- {
14140
- name: "EvtSwap",
14141
- type: {
14142
- kind: "struct",
14143
- fields: [
14144
- {
14145
- name: "pool",
14146
- type: "pubkey"
14147
- },
14148
- {
14149
- name: "trade_direction",
14150
- type: "u8"
14151
- },
14152
- {
14153
- name: "has_referral",
14154
- type: "bool"
14155
- },
14156
- {
14157
- name: "params",
14158
- type: {
14159
- defined: {
14160
- name: "SwapParameters"
14161
- }
14162
- }
14163
- },
14164
- {
14165
- name: "swap_result",
14166
- type: {
14167
- defined: {
14168
- name: "SwapResult"
14169
- }
14170
- }
14171
- },
14172
- {
14173
- name: "actual_amount_in",
14174
- type: "u64"
14175
- },
14176
- {
14177
- name: "current_timestamp",
14178
- type: "u64"
14179
- }
14180
- ]
14181
- }
14182
- },
14183
14757
  {
14184
14758
  name: "EvtSwap2",
14185
14759
  type: {
@@ -14244,6 +14818,30 @@ var types = [
14244
14818
  ]
14245
14819
  }
14246
14820
  },
14821
+ {
14822
+ name: "EvtUpdatePoolFees",
14823
+ type: {
14824
+ kind: "struct",
14825
+ fields: [
14826
+ {
14827
+ name: "pool",
14828
+ type: "pubkey"
14829
+ },
14830
+ {
14831
+ name: "operator",
14832
+ type: "pubkey"
14833
+ },
14834
+ {
14835
+ name: "params",
14836
+ type: {
14837
+ defined: {
14838
+ name: "UpdatePoolFeesParameters"
14839
+ }
14840
+ }
14841
+ }
14842
+ ]
14843
+ }
14844
+ },
14247
14845
  {
14248
14846
  name: "EvtUpdateRewardDuration",
14249
14847
  type: {
@@ -14298,124 +14896,284 @@ var types = [
14298
14896
  kind: "struct",
14299
14897
  fields: [
14300
14898
  {
14301
- name: "pool",
14302
- type: "pubkey"
14899
+ name: "pool",
14900
+ type: "pubkey"
14901
+ },
14902
+ {
14903
+ name: "reward_mint",
14904
+ type: "pubkey"
14905
+ },
14906
+ {
14907
+ name: "amount",
14908
+ type: "u64"
14909
+ }
14910
+ ]
14911
+ }
14912
+ },
14913
+ {
14914
+ name: "InitializeCustomizablePoolParameters",
14915
+ type: {
14916
+ kind: "struct",
14917
+ fields: [
14918
+ {
14919
+ name: "pool_fees",
14920
+ docs: [
14921
+ "pool fees"
14922
+ ],
14923
+ type: {
14924
+ defined: {
14925
+ name: "PoolFeeParameters"
14926
+ }
14927
+ }
14928
+ },
14929
+ {
14930
+ name: "sqrt_min_price",
14931
+ docs: [
14932
+ "sqrt min price"
14933
+ ],
14934
+ type: "u128"
14935
+ },
14936
+ {
14937
+ name: "sqrt_max_price",
14938
+ docs: [
14939
+ "sqrt max price"
14940
+ ],
14941
+ type: "u128"
14942
+ },
14943
+ {
14944
+ name: "has_alpha_vault",
14945
+ docs: [
14946
+ "has alpha vault"
14947
+ ],
14948
+ type: "bool"
14949
+ },
14950
+ {
14951
+ name: "liquidity",
14952
+ docs: [
14953
+ "initialize liquidity"
14954
+ ],
14955
+ type: "u128"
14956
+ },
14957
+ {
14958
+ name: "sqrt_price",
14959
+ docs: [
14960
+ "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value. Market cap fee scheduler minimum price will be derived from this value"
14961
+ ],
14962
+ type: "u128"
14963
+ },
14964
+ {
14965
+ name: "activation_type",
14966
+ docs: [
14967
+ "activation type"
14968
+ ],
14969
+ type: "u8"
14970
+ },
14971
+ {
14972
+ name: "collect_fee_mode",
14973
+ docs: [
14974
+ "collect fee mode"
14975
+ ],
14976
+ type: "u8"
14977
+ },
14978
+ {
14979
+ name: "activation_point",
14980
+ docs: [
14981
+ "activation point"
14982
+ ],
14983
+ type: {
14984
+ option: "u64"
14985
+ }
14986
+ }
14987
+ ]
14988
+ }
14989
+ },
14990
+ {
14991
+ name: "InitializePoolParameters",
14992
+ type: {
14993
+ kind: "struct",
14994
+ fields: [
14995
+ {
14996
+ name: "liquidity",
14997
+ docs: [
14998
+ "initialize liquidity"
14999
+ ],
15000
+ type: "u128"
15001
+ },
15002
+ {
15003
+ name: "sqrt_price",
15004
+ docs: [
15005
+ "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value"
15006
+ ],
15007
+ type: "u128"
15008
+ },
15009
+ {
15010
+ name: "activation_point",
15011
+ docs: [
15012
+ "activation point"
15013
+ ],
15014
+ type: {
15015
+ option: "u64"
15016
+ }
15017
+ }
15018
+ ]
15019
+ }
15020
+ },
15021
+ {
15022
+ name: "Operator",
15023
+ serialization: "bytemuck",
15024
+ repr: {
15025
+ kind: "c"
15026
+ },
15027
+ type: {
15028
+ kind: "struct",
15029
+ fields: [
15030
+ {
15031
+ name: "whitelisted_address",
15032
+ type: "pubkey"
15033
+ },
15034
+ {
15035
+ name: "permission",
15036
+ type: "u128"
15037
+ },
15038
+ {
15039
+ name: "padding",
15040
+ type: {
15041
+ array: [
15042
+ "u64",
15043
+ 2
15044
+ ]
15045
+ }
15046
+ }
15047
+ ]
15048
+ }
15049
+ },
15050
+ {
15051
+ name: "PodAlignedFeeMarketCapScheduler",
15052
+ serialization: "bytemuck",
15053
+ repr: {
15054
+ kind: "c"
15055
+ },
15056
+ type: {
15057
+ kind: "struct",
15058
+ fields: [
15059
+ {
15060
+ name: "cliff_fee_numerator",
15061
+ type: "u64"
15062
+ },
15063
+ {
15064
+ name: "base_fee_mode",
15065
+ type: "u8"
15066
+ },
15067
+ {
15068
+ name: "padding",
15069
+ type: {
15070
+ array: [
15071
+ "u8",
15072
+ 5
15073
+ ]
15074
+ }
15075
+ },
15076
+ {
15077
+ name: "number_of_period",
15078
+ type: "u16"
14303
15079
  },
14304
15080
  {
14305
- name: "reward_mint",
14306
- type: "pubkey"
15081
+ name: "sqrt_price_step_bps",
15082
+ type: "u32"
14307
15083
  },
14308
15084
  {
14309
- name: "amount",
15085
+ name: "scheduler_expiration_duration",
15086
+ type: "u32"
15087
+ },
15088
+ {
15089
+ name: "reduction_factor",
14310
15090
  type: "u64"
14311
15091
  }
14312
15092
  ]
14313
15093
  }
14314
15094
  },
14315
15095
  {
14316
- name: "InitializeCustomizablePoolParameters",
15096
+ name: "PodAlignedFeeRateLimiter",
15097
+ serialization: "bytemuck",
15098
+ repr: {
15099
+ kind: "c"
15100
+ },
14317
15101
  type: {
14318
15102
  kind: "struct",
14319
15103
  fields: [
14320
15104
  {
14321
- name: "pool_fees",
14322
- docs: [
14323
- "pool fees"
14324
- ],
14325
- type: {
14326
- defined: {
14327
- name: "PoolFeeParameters"
14328
- }
14329
- }
14330
- },
14331
- {
14332
- name: "sqrt_min_price",
14333
- docs: [
14334
- "sqrt min price"
14335
- ],
14336
- type: "u128"
14337
- },
14338
- {
14339
- name: "sqrt_max_price",
14340
- docs: [
14341
- "sqrt max price"
14342
- ],
14343
- type: "u128"
15105
+ name: "cliff_fee_numerator",
15106
+ type: "u64"
14344
15107
  },
14345
15108
  {
14346
- name: "has_alpha_vault",
14347
- docs: [
14348
- "has alpha vault"
14349
- ],
14350
- type: "bool"
15109
+ name: "base_fee_mode",
15110
+ type: "u8"
14351
15111
  },
14352
15112
  {
14353
- name: "liquidity",
14354
- docs: [
14355
- "initialize liquidity"
14356
- ],
14357
- type: "u128"
15113
+ name: "padding",
15114
+ type: {
15115
+ array: [
15116
+ "u8",
15117
+ 5
15118
+ ]
15119
+ }
14358
15120
  },
14359
15121
  {
14360
- name: "sqrt_price",
14361
- docs: [
14362
- "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value"
14363
- ],
14364
- type: "u128"
15122
+ name: "fee_increment_bps",
15123
+ type: "u16"
14365
15124
  },
14366
15125
  {
14367
- name: "activation_type",
14368
- docs: [
14369
- "activation type"
14370
- ],
14371
- type: "u8"
15126
+ name: "max_limiter_duration",
15127
+ type: "u32"
14372
15128
  },
14373
15129
  {
14374
- name: "collect_fee_mode",
14375
- docs: [
14376
- "collect fee mode"
14377
- ],
14378
- type: "u8"
15130
+ name: "max_fee_bps",
15131
+ type: "u32"
14379
15132
  },
14380
15133
  {
14381
- name: "activation_point",
14382
- docs: [
14383
- "activation point"
14384
- ],
14385
- type: {
14386
- option: "u64"
14387
- }
15134
+ name: "reference_amount",
15135
+ type: "u64"
14388
15136
  }
14389
15137
  ]
14390
15138
  }
14391
15139
  },
14392
15140
  {
14393
- name: "InitializePoolParameters",
15141
+ name: "PodAlignedFeeTimeScheduler",
15142
+ serialization: "bytemuck",
15143
+ repr: {
15144
+ kind: "c"
15145
+ },
14394
15146
  type: {
14395
15147
  kind: "struct",
14396
15148
  fields: [
14397
15149
  {
14398
- name: "liquidity",
14399
- docs: [
14400
- "initialize liquidity"
14401
- ],
14402
- type: "u128"
15150
+ name: "cliff_fee_numerator",
15151
+ type: "u64"
14403
15152
  },
14404
15153
  {
14405
- name: "sqrt_price",
14406
- docs: [
14407
- "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value"
14408
- ],
14409
- type: "u128"
15154
+ name: "base_fee_mode",
15155
+ type: "u8"
14410
15156
  },
14411
15157
  {
14412
- name: "activation_point",
14413
- docs: [
14414
- "activation point"
14415
- ],
15158
+ name: "padding",
14416
15159
  type: {
14417
- option: "u64"
15160
+ array: [
15161
+ "u8",
15162
+ 5
15163
+ ]
14418
15164
  }
15165
+ },
15166
+ {
15167
+ name: "number_of_period",
15168
+ type: "u16"
15169
+ },
15170
+ {
15171
+ name: "period_frequency",
15172
+ type: "u64"
15173
+ },
15174
+ {
15175
+ name: "reduction_factor",
15176
+ type: "u64"
14419
15177
  }
14420
15178
  ]
14421
15179
  }
@@ -14583,7 +15341,7 @@ var types = [
14583
15341
  {
14584
15342
  name: "collect_fee_mode",
14585
15343
  docs: [
14586
- "0 is collect fee in both token, 1 only collect fee in token a, 2 only collect fee in token b"
15344
+ "0 is collect fee in both token, 1 only collect fee only in token b"
14587
15345
  ],
14588
15346
  type: "u8"
14589
15347
  },
@@ -14704,18 +15462,6 @@ var types = [
14704
15462
  }
14705
15463
  }
14706
15464
  },
14707
- {
14708
- name: "padding",
14709
- docs: [
14710
- "padding"
14711
- ],
14712
- type: {
14713
- array: [
14714
- "u8",
14715
- 3
14716
- ]
14717
- }
14718
- },
14719
15465
  {
14720
15466
  name: "dynamic_fee",
14721
15467
  docs: [
@@ -14745,7 +15491,7 @@ var types = [
14745
15491
  name: "base_fee",
14746
15492
  type: {
14747
15493
  defined: {
14748
- name: "BaseFeeConfig"
15494
+ name: "BaseFeeInfo"
14749
15495
  }
14750
15496
  }
14751
15497
  },
@@ -14867,16 +15613,8 @@ var types = [
14867
15613
  }
14868
15614
  },
14869
15615
  {
14870
- name: "padding_1",
14871
- docs: [
14872
- "padding"
14873
- ],
14874
- type: {
14875
- array: [
14876
- "u64",
14877
- 2
14878
- ]
14879
- }
15616
+ name: "init_sqrt_price",
15617
+ type: "u128"
14880
15618
  }
14881
15619
  ]
14882
15620
  }
@@ -15456,41 +16194,6 @@ var types = [
15456
16194
  ]
15457
16195
  }
15458
16196
  },
15459
- {
15460
- name: "SwapResult",
15461
- docs: [
15462
- "Encodes all results of swapping"
15463
- ],
15464
- type: {
15465
- kind: "struct",
15466
- fields: [
15467
- {
15468
- name: "output_amount",
15469
- type: "u64"
15470
- },
15471
- {
15472
- name: "next_sqrt_price",
15473
- type: "u128"
15474
- },
15475
- {
15476
- name: "lp_fee",
15477
- type: "u64"
15478
- },
15479
- {
15480
- name: "protocol_fee",
15481
- type: "u64"
15482
- },
15483
- {
15484
- name: "partner_fee",
15485
- type: "u64"
15486
- },
15487
- {
15488
- name: "referral_fee",
15489
- type: "u64"
15490
- }
15491
- ]
15492
- }
15493
- },
15494
16197
  {
15495
16198
  name: "SwapResult2",
15496
16199
  type: {
@@ -15569,6 +16272,41 @@ var types = [
15569
16272
  ]
15570
16273
  }
15571
16274
  },
16275
+ {
16276
+ name: "UpdatePoolFeesParameters",
16277
+ type: {
16278
+ kind: "struct",
16279
+ fields: [
16280
+ {
16281
+ name: "cliff_fee_numerator",
16282
+ docs: [
16283
+ "Base fee update mode:",
16284
+ "- None: skip base fee update",
16285
+ "- Some: update new cliff_fee_numerator if base fee is static"
16286
+ ],
16287
+ type: {
16288
+ option: "u64"
16289
+ }
16290
+ },
16291
+ {
16292
+ name: "dynamic_fee",
16293
+ docs: [
16294
+ "Dynamic fee update mode:",
16295
+ "- None: skip dynamic fee update",
16296
+ "- Some(with default value): disable dynamic fee",
16297
+ "- Some(with non default value): enable dynamic fee if disabled or update dynamic fee if enabled"
16298
+ ],
16299
+ type: {
16300
+ option: {
16301
+ defined: {
16302
+ name: "DynamicFeeParameters"
16303
+ }
16304
+ }
16305
+ }
16306
+ }
16307
+ ]
16308
+ }
16309
+ },
15572
16310
  {
15573
16311
  name: "UserRewardInfo",
15574
16312
  serialization: "bytemuck",
@@ -15696,6 +16434,94 @@ var types = [
15696
16434
  }
15697
16435
  }
15698
16436
  ];
16437
+ var constants = [
16438
+ {
16439
+ name: "BIN_STEP_BPS_DEFAULT",
16440
+ type: "u16",
16441
+ value: "1"
16442
+ },
16443
+ {
16444
+ name: "BIN_STEP_U128_DEFAULT_LE_BYTES",
16445
+ type: {
16446
+ array: [
16447
+ "u8",
16448
+ 16
16449
+ ]
16450
+ },
16451
+ value: "[203, 16, 199, 186, 184, 141, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0]"
16452
+ },
16453
+ {
16454
+ name: "CUSTOMIZABLE_POOL_PREFIX",
16455
+ type: "bytes",
16456
+ value: "[99, 112, 111, 111, 108]"
16457
+ },
16458
+ {
16459
+ name: "FEE_DENOMINATOR",
16460
+ docs: [
16461
+ "Default fee denominator. DO NOT simply update it as it will break logic that depends on it as default value."
16462
+ ],
16463
+ type: "u64",
16464
+ value: "1000000000"
16465
+ },
16466
+ {
16467
+ name: "MAX_BASIS_POINT",
16468
+ docs: [
16469
+ "Max basis point. 100% in pct"
16470
+ ],
16471
+ type: "u64",
16472
+ value: "10000"
16473
+ },
16474
+ {
16475
+ name: "MAX_SQRT_PRICE_LE_BYTES",
16476
+ type: {
16477
+ array: [
16478
+ "u8",
16479
+ 16
16480
+ ]
16481
+ },
16482
+ value: "[155, 87, 105, 78, 169, 26, 92, 132, 177, 196, 254, 255, 0, 0, 0, 0]"
16483
+ },
16484
+ {
16485
+ name: "MIN_SQRT_PRICE_LE_BYTES",
16486
+ type: {
16487
+ array: [
16488
+ "u8",
16489
+ 16
16490
+ ]
16491
+ },
16492
+ value: "[80, 59, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"
16493
+ },
16494
+ {
16495
+ name: "POOL_AUTHORITY_PREFIX",
16496
+ type: "bytes",
16497
+ value: "[112, 111, 111, 108, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]"
16498
+ },
16499
+ {
16500
+ name: "POOL_PREFIX",
16501
+ type: "bytes",
16502
+ value: "[112, 111, 111, 108]"
16503
+ },
16504
+ {
16505
+ name: "POSITION_NFT_ACCOUNT_PREFIX",
16506
+ type: "bytes",
16507
+ value: "[112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 102, 116, 95, 97, 99, 99, 111, 117, 110, 116]"
16508
+ },
16509
+ {
16510
+ name: "POSITION_PREFIX",
16511
+ type: "bytes",
16512
+ value: "[112, 111, 115, 105, 116, 105, 111, 110]"
16513
+ },
16514
+ {
16515
+ name: "SPLIT_POSITION_DENOMINATOR",
16516
+ type: "u32",
16517
+ value: "1000000000"
16518
+ },
16519
+ {
16520
+ name: "TOKEN_VAULT_PREFIX",
16521
+ type: "bytes",
16522
+ value: "[116, 111, 107, 101, 110, 95, 118, 97, 117, 108, 116]"
16523
+ }
16524
+ ];
15699
16525
  var cp_amm = {
15700
16526
  address: address,
15701
16527
  metadata: metadata,
@@ -15703,7 +16529,8 @@ var cp_amm = {
15703
16529
  accounts: accounts,
15704
16530
  events: events,
15705
16531
  errors: errors,
15706
- types: types
16532
+ types: types,
16533
+ constants: constants
15707
16534
  };
15708
16535
 
15709
- export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, 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, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult, type SwapResult2, type TokenBadgeState, TradeDirection, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, decimalToQ64, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeNumerator, getBaseFeeNumeratorByPeriod, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getMinBaseFeeNumerator, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toNumerator, unwrapSOLInstruction, validateFeeFraction, validateFeeRateLimiter, validateFeeScheduler, vestingByPositionFilter, wrapSOLInstruction };
16536
+ export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BorshFeeMarketCapScheduler, type BorshFeeRateLimiter, type BorshFeeTimeScheduler, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, 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, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DecodedPoolFees, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, FEE_PADDING, FeeMarketCapScheduler, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeTimeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PodAlignedFeeMarketCapScheduler, type PodAlignedFeeRateLimiter, type PodAlignedFeeTimeScheduler, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult2, type TokenBadgeState, TradeDirection, type TransferHookState, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, cpAmmCoder, decimalToQ64, decodeFeeMarketCapSchedulerParams, decodeFeeRateLimiterParams, decodeFeeTimeSchedulerParams, decodePodAlignedFeeMarketCapScheduler, decodePodAlignedFeeRateLimiter, decodePodAlignedFeeTimeScheduler, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, deriveOperatorAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, encodeFeeMarketCapSchedulerParams, encodeFeeRateLimiterParams, encodeFeeTimeSchedulerParams, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMarketCapBaseFeeNumerator, getFeeMarketCapBaseFeeNumeratorByPeriod, getFeeMarketCapMinBaseFeeNumerator, getFeeMarketCapSchedulerParams, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeTimeBaseFeeNumerator, getFeeTimeBaseFeeNumeratorByPeriod, getFeeTimeMinBaseFeeNumerator, getFeeTimeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, hasTransferHookExtension, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toBorshFeeTimeScheduler, toNumerator, toPodAlignedFeeTimeScheduler, unwrapSOLInstruction, validateFeeFraction, validateFeeMarketCapBaseFeeIsStatic, validateFeeMarketCapScheduler, validateFeeRateLimiter, validateFeeRateLimiterBaseFeeIsStatic, validateFeeTimeScheduler, validateFeeTimeSchedulerBaseFeeIsStatic, validateNoTransferHook, vestingByPositionFilter, wrapSOLInstruction };