@meteora-ag/cp-amm-sdk 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -13,7 +13,7 @@ type CpAmm$1 = {
13
13
  address: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
14
14
  metadata: {
15
15
  name: "cpAmm";
16
- version: "0.1.0";
16
+ version: "0.1.1";
17
17
  spec: "0.1.0";
18
18
  description: "Created with Anchor";
19
19
  };
@@ -434,38 +434,38 @@ type CpAmm$1 = {
434
434
  {
435
435
  kind: "const";
436
436
  value: [
437
- 153,
438
- 10,
439
- 107,
440
- 154,
441
- 255,
442
- 249,
443
- 210,
437
+ 48,
438
+ 9,
439
+ 89,
440
+ 123,
441
+ 106,
442
+ 114,
443
+ 131,
444
+ 251,
445
+ 50,
444
446
  173,
445
- 176,
446
- 67,
447
- 220,
448
- 214,
449
- 152,
450
- 71,
451
- 46,
452
- 146,
453
- 161,
454
- 33,
447
+ 254,
448
+ 250,
449
+ 10,
450
+ 80,
451
+ 160,
452
+ 84,
453
+ 143,
454
+ 100,
455
455
  81,
456
- 148,
456
+ 249,
457
+ 134,
458
+ 112,
459
+ 30,
460
+ 213,
461
+ 50,
457
462
  166,
458
- 119,
459
- 5,
460
- 189,
461
- 142,
462
- 11,
463
- 57,
464
- 68,
465
- 162,
466
- 70,
467
- 126,
468
- 100
463
+ 239,
464
+ 78,
465
+ 53,
466
+ 175,
467
+ 188,
468
+ 85
469
469
  ];
470
470
  },
471
471
  {
@@ -525,38 +525,38 @@ type CpAmm$1 = {
525
525
  {
526
526
  kind: "const";
527
527
  value: [
528
- 153,
529
- 10,
530
- 107,
531
- 154,
532
- 255,
533
- 249,
534
- 210,
528
+ 48,
529
+ 9,
530
+ 89,
531
+ 123,
532
+ 106,
533
+ 114,
534
+ 131,
535
+ 251,
536
+ 50,
535
537
  173,
536
- 176,
537
- 67,
538
- 220,
539
- 214,
540
- 152,
541
- 71,
542
- 46,
543
- 146,
544
- 161,
545
- 33,
538
+ 254,
539
+ 250,
540
+ 10,
541
+ 80,
542
+ 160,
543
+ 84,
544
+ 143,
545
+ 100,
546
546
  81,
547
- 148,
547
+ 249,
548
+ 134,
549
+ 112,
550
+ 30,
551
+ 213,
552
+ 50,
548
553
  166,
549
- 119,
550
- 5,
551
- 189,
552
- 142,
553
- 11,
554
- 57,
555
- 68,
556
- 162,
557
- 70,
558
- 126,
559
- 100
554
+ 239,
555
+ 78,
556
+ 53,
557
+ 175,
558
+ 188,
559
+ 85
560
560
  ];
561
561
  },
562
562
  {
@@ -1049,7 +1049,84 @@ type CpAmm$1 = {
1049
1049
  },
1050
1050
  {
1051
1051
  kind: "arg";
1052
- path: "config_parameters.index";
1052
+ path: "index";
1053
+ }
1054
+ ];
1055
+ };
1056
+ },
1057
+ {
1058
+ name: "admin";
1059
+ writable: true;
1060
+ signer: true;
1061
+ },
1062
+ {
1063
+ name: "systemProgram";
1064
+ address: "11111111111111111111111111111111";
1065
+ },
1066
+ {
1067
+ name: "eventAuthority";
1068
+ pda: {
1069
+ seeds: [
1070
+ {
1071
+ kind: "const";
1072
+ value: [
1073
+ 95,
1074
+ 95,
1075
+ 101,
1076
+ 118,
1077
+ 101,
1078
+ 110,
1079
+ 116,
1080
+ 95,
1081
+ 97,
1082
+ 117,
1083
+ 116,
1084
+ 104,
1085
+ 111,
1086
+ 114,
1087
+ 105,
1088
+ 116,
1089
+ 121
1090
+ ];
1091
+ }
1092
+ ];
1093
+ };
1094
+ },
1095
+ {
1096
+ name: "program";
1097
+ }
1098
+ ];
1099
+ args: [
1100
+ {
1101
+ name: "index";
1102
+ type: "u64";
1103
+ },
1104
+ {
1105
+ name: "configParameters";
1106
+ type: {
1107
+ defined: {
1108
+ name: "staticConfigParameters";
1109
+ };
1110
+ };
1111
+ }
1112
+ ];
1113
+ },
1114
+ {
1115
+ name: "createDynamicConfig";
1116
+ discriminator: [81, 251, 122, 78, 66, 57, 208, 82];
1117
+ accounts: [
1118
+ {
1119
+ name: "config";
1120
+ writable: true;
1121
+ pda: {
1122
+ seeds: [
1123
+ {
1124
+ kind: "const";
1125
+ value: [99, 111, 110, 102, 105, 103];
1126
+ },
1127
+ {
1128
+ kind: "arg";
1129
+ path: "index";
1053
1130
  }
1054
1131
  ];
1055
1132
  };
@@ -1097,11 +1174,15 @@ type CpAmm$1 = {
1097
1174
  }
1098
1175
  ];
1099
1176
  args: [
1177
+ {
1178
+ name: "index";
1179
+ type: "u64";
1180
+ },
1100
1181
  {
1101
1182
  name: "configParameters";
1102
1183
  type: {
1103
1184
  defined: {
1104
- name: "configParameters";
1185
+ name: "dynamicConfigParameters";
1105
1186
  };
1106
1187
  };
1107
1188
  }
@@ -1857,9 +1938,71 @@ type CpAmm$1 = {
1857
1938
  ];
1858
1939
  },
1859
1940
  {
1860
- name: "initializeReward";
1861
- discriminator: [95, 135, 192, 196, 242, 129, 230, 68];
1941
+ name: "initializePoolWithDynamicConfig";
1942
+ discriminator: [149, 82, 72, 197, 253, 252, 68, 15];
1862
1943
  accounts: [
1944
+ {
1945
+ name: "creator";
1946
+ },
1947
+ {
1948
+ name: "positionNftMint";
1949
+ docs: ["positionNftMint"];
1950
+ writable: true;
1951
+ signer: true;
1952
+ },
1953
+ {
1954
+ name: "positionNftAccount";
1955
+ docs: ["position nft account"];
1956
+ writable: true;
1957
+ pda: {
1958
+ seeds: [
1959
+ {
1960
+ kind: "const";
1961
+ value: [
1962
+ 112,
1963
+ 111,
1964
+ 115,
1965
+ 105,
1966
+ 116,
1967
+ 105,
1968
+ 111,
1969
+ 110,
1970
+ 95,
1971
+ 110,
1972
+ 102,
1973
+ 116,
1974
+ 95,
1975
+ 97,
1976
+ 99,
1977
+ 99,
1978
+ 111,
1979
+ 117,
1980
+ 110,
1981
+ 116
1982
+ ];
1983
+ },
1984
+ {
1985
+ kind: "account";
1986
+ path: "positionNftMint";
1987
+ }
1988
+ ];
1989
+ };
1990
+ },
1991
+ {
1992
+ name: "payer";
1993
+ docs: ["Address paying to create the pool. Can be anyone"];
1994
+ writable: true;
1995
+ signer: true;
1996
+ },
1997
+ {
1998
+ name: "poolCreatorAuthority";
1999
+ signer: true;
2000
+ relations: ["config"];
2001
+ },
2002
+ {
2003
+ name: "config";
2004
+ docs: ["Which config the pool belongs to."];
2005
+ },
1863
2006
  {
1864
2007
  name: "poolAuthority";
1865
2008
  pda: {
@@ -1888,51 +2031,99 @@ type CpAmm$1 = {
1888
2031
  },
1889
2032
  {
1890
2033
  name: "pool";
2034
+ docs: ["Initialize an account to store the pool state"];
1891
2035
  writable: true;
1892
2036
  },
1893
2037
  {
1894
- name: "rewardVault";
2038
+ name: "position";
1895
2039
  writable: true;
1896
2040
  pda: {
1897
2041
  seeds: [
1898
2042
  {
1899
2043
  kind: "const";
1900
- value: [
1901
- 114,
1902
- 101,
1903
- 119,
1904
- 97,
1905
- 114,
1906
- 100,
1907
- 95,
1908
- 118,
1909
- 97,
1910
- 117,
1911
- 108,
1912
- 116
1913
- ];
2044
+ value: [112, 111, 115, 105, 116, 105, 111, 110];
2045
+ },
2046
+ {
2047
+ kind: "account";
2048
+ path: "positionNftMint";
2049
+ }
2050
+ ];
2051
+ };
2052
+ },
2053
+ {
2054
+ name: "tokenAMint";
2055
+ docs: ["Token a mint"];
2056
+ },
2057
+ {
2058
+ name: "tokenBMint";
2059
+ docs: ["Token b mint"];
2060
+ },
2061
+ {
2062
+ name: "tokenAVault";
2063
+ docs: ["Token a vault for the pool"];
2064
+ writable: true;
2065
+ pda: {
2066
+ seeds: [
2067
+ {
2068
+ kind: "const";
2069
+ value: [116, 111, 107, 101, 110, 95, 118, 97, 117, 108, 116];
2070
+ },
2071
+ {
2072
+ kind: "account";
2073
+ path: "tokenAMint";
1914
2074
  },
1915
2075
  {
1916
2076
  kind: "account";
1917
2077
  path: "pool";
2078
+ }
2079
+ ];
2080
+ };
2081
+ },
2082
+ {
2083
+ name: "tokenBVault";
2084
+ docs: ["Token b vault for the pool"];
2085
+ writable: true;
2086
+ pda: {
2087
+ seeds: [
2088
+ {
2089
+ kind: "const";
2090
+ value: [116, 111, 107, 101, 110, 95, 118, 97, 117, 108, 116];
1918
2091
  },
1919
2092
  {
1920
- kind: "arg";
1921
- path: "rewardIndex";
2093
+ kind: "account";
2094
+ path: "tokenBMint";
2095
+ },
2096
+ {
2097
+ kind: "account";
2098
+ path: "pool";
1922
2099
  }
1923
2100
  ];
1924
2101
  };
1925
2102
  },
1926
2103
  {
1927
- name: "rewardMint";
2104
+ name: "payerTokenA";
2105
+ docs: ["payer token a account"];
2106
+ writable: true;
1928
2107
  },
1929
2108
  {
1930
- name: "admin";
2109
+ name: "payerTokenB";
2110
+ docs: ["creator token b account"];
1931
2111
  writable: true;
1932
- signer: true;
1933
2112
  },
1934
2113
  {
1935
- name: "tokenProgram";
2114
+ name: "tokenAProgram";
2115
+ docs: ["Program to create mint account and mint tokens"];
2116
+ },
2117
+ {
2118
+ name: "tokenBProgram";
2119
+ docs: ["Program to create mint account and mint tokens"];
2120
+ },
2121
+ {
2122
+ name: "token2022Program";
2123
+ docs: [
2124
+ "Program to create NFT mint/token account and transfer for token22 account"
2125
+ ];
2126
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
1936
2127
  },
1937
2128
  {
1938
2129
  name: "systemProgram";
@@ -1973,19 +2164,145 @@ type CpAmm$1 = {
1973
2164
  ];
1974
2165
  args: [
1975
2166
  {
1976
- name: "rewardIndex";
1977
- type: "u8";
1978
- },
1979
- {
1980
- name: "rewardDuration";
1981
- type: "u64";
1982
- },
1983
- {
1984
- name: "funder";
1985
- type: "pubkey";
1986
- }
1987
- ];
1988
- },
2167
+ name: "params";
2168
+ type: {
2169
+ defined: {
2170
+ name: "initializeCustomizablePoolParameters";
2171
+ };
2172
+ };
2173
+ }
2174
+ ];
2175
+ },
2176
+ {
2177
+ name: "initializeReward";
2178
+ discriminator: [95, 135, 192, 196, 242, 129, 230, 68];
2179
+ accounts: [
2180
+ {
2181
+ name: "poolAuthority";
2182
+ pda: {
2183
+ seeds: [
2184
+ {
2185
+ kind: "const";
2186
+ value: [
2187
+ 112,
2188
+ 111,
2189
+ 111,
2190
+ 108,
2191
+ 95,
2192
+ 97,
2193
+ 117,
2194
+ 116,
2195
+ 104,
2196
+ 111,
2197
+ 114,
2198
+ 105,
2199
+ 116,
2200
+ 121
2201
+ ];
2202
+ }
2203
+ ];
2204
+ };
2205
+ },
2206
+ {
2207
+ name: "pool";
2208
+ writable: true;
2209
+ },
2210
+ {
2211
+ name: "rewardVault";
2212
+ writable: true;
2213
+ pda: {
2214
+ seeds: [
2215
+ {
2216
+ kind: "const";
2217
+ value: [
2218
+ 114,
2219
+ 101,
2220
+ 119,
2221
+ 97,
2222
+ 114,
2223
+ 100,
2224
+ 95,
2225
+ 118,
2226
+ 97,
2227
+ 117,
2228
+ 108,
2229
+ 116
2230
+ ];
2231
+ },
2232
+ {
2233
+ kind: "account";
2234
+ path: "pool";
2235
+ },
2236
+ {
2237
+ kind: "arg";
2238
+ path: "rewardIndex";
2239
+ }
2240
+ ];
2241
+ };
2242
+ },
2243
+ {
2244
+ name: "rewardMint";
2245
+ },
2246
+ {
2247
+ name: "admin";
2248
+ writable: true;
2249
+ signer: true;
2250
+ },
2251
+ {
2252
+ name: "tokenProgram";
2253
+ },
2254
+ {
2255
+ name: "systemProgram";
2256
+ address: "11111111111111111111111111111111";
2257
+ },
2258
+ {
2259
+ name: "eventAuthority";
2260
+ pda: {
2261
+ seeds: [
2262
+ {
2263
+ kind: "const";
2264
+ value: [
2265
+ 95,
2266
+ 95,
2267
+ 101,
2268
+ 118,
2269
+ 101,
2270
+ 110,
2271
+ 116,
2272
+ 95,
2273
+ 97,
2274
+ 117,
2275
+ 116,
2276
+ 104,
2277
+ 111,
2278
+ 114,
2279
+ 105,
2280
+ 116,
2281
+ 121
2282
+ ];
2283
+ }
2284
+ ];
2285
+ };
2286
+ },
2287
+ {
2288
+ name: "program";
2289
+ }
2290
+ ];
2291
+ args: [
2292
+ {
2293
+ name: "rewardIndex";
2294
+ type: "u8";
2295
+ },
2296
+ {
2297
+ name: "rewardDuration";
2298
+ type: "u64";
2299
+ },
2300
+ {
2301
+ name: "funder";
2302
+ type: "pubkey";
2303
+ }
2304
+ ];
2305
+ },
1989
2306
  {
1990
2307
  name: "lockPosition";
1991
2308
  discriminator: [227, 62, 2, 252, 247, 10, 171, 185];
@@ -2865,6 +3182,10 @@ type CpAmm$1 = {
2865
3182
  name: "evtCreateConfig";
2866
3183
  discriminator: [131, 207, 180, 174, 180, 73, 165, 54];
2867
3184
  },
3185
+ {
3186
+ name: "evtCreateDynamicConfig";
3187
+ discriminator: [231, 197, 13, 164, 248, 213, 133, 152];
3188
+ },
2868
3189
  {
2869
3190
  name: "evtCreatePosition";
2870
3191
  discriminator: [156, 15, 119, 198, 29, 181, 221, 55];
@@ -3118,6 +3439,16 @@ type CpAmm$1 = {
3118
3439
  code: 6039;
3119
3440
  name: "positionIsNotEmpty";
3120
3441
  msg: "Position is not empty";
3442
+ },
3443
+ {
3444
+ code: 6040;
3445
+ name: "invalidPoolCreatorAuthority";
3446
+ msg: "Invalid pool creator authority";
3447
+ },
3448
+ {
3449
+ code: 6041;
3450
+ name: "invalidConfigType";
3451
+ msg: "Invalid config type";
3121
3452
  }
3122
3453
  ];
3123
3454
  types: [
@@ -3317,11 +3648,16 @@ type CpAmm$1 = {
3317
3648
  docs: ["Collect fee mode"];
3318
3649
  type: "u8";
3319
3650
  },
3651
+ {
3652
+ name: "configType";
3653
+ docs: ["Config type mode, 0 for static, 1 for dynamic"];
3654
+ type: "u8";
3655
+ },
3320
3656
  {
3321
3657
  name: "padding0";
3322
3658
  docs: ["padding 0"];
3323
3659
  type: {
3324
- array: ["u8", 6];
3660
+ array: ["u8", 5];
3325
3661
  };
3326
3662
  },
3327
3663
  {
@@ -3350,45 +3686,13 @@ type CpAmm$1 = {
3350
3686
  };
3351
3687
  },
3352
3688
  {
3353
- name: "configParameters";
3689
+ name: "dynamicConfigParameters";
3354
3690
  type: {
3355
3691
  kind: "struct";
3356
3692
  fields: [
3357
- {
3358
- name: "poolFees";
3359
- type: {
3360
- defined: {
3361
- name: "poolFeeParameters";
3362
- };
3363
- };
3364
- },
3365
- {
3366
- name: "sqrtMinPrice";
3367
- type: "u128";
3368
- },
3369
- {
3370
- name: "sqrtMaxPrice";
3371
- type: "u128";
3372
- },
3373
- {
3374
- name: "vaultConfigKey";
3375
- type: "pubkey";
3376
- },
3377
3693
  {
3378
3694
  name: "poolCreatorAuthority";
3379
3695
  type: "pubkey";
3380
- },
3381
- {
3382
- name: "activationType";
3383
- type: "u8";
3384
- },
3385
- {
3386
- name: "collectFeeMode";
3387
- type: "u8";
3388
- },
3389
- {
3390
- name: "index";
3391
- type: "u64";
3392
3696
  }
3393
3697
  ];
3394
3698
  };
@@ -3770,7 +4074,7 @@ type CpAmm$1 = {
3770
4074
  },
3771
4075
  {
3772
4076
  name: "evtCreateConfig";
3773
- docs: ["Create config"];
4077
+ docs: ["Create static config"];
3774
4078
  type: {
3775
4079
  kind: "struct";
3776
4080
  fields: [
@@ -3817,6 +4121,27 @@ type CpAmm$1 = {
3817
4121
  ];
3818
4122
  };
3819
4123
  },
4124
+ {
4125
+ name: "evtCreateDynamicConfig";
4126
+ docs: ["Create dynamic config"];
4127
+ type: {
4128
+ kind: "struct";
4129
+ fields: [
4130
+ {
4131
+ name: "config";
4132
+ type: "pubkey";
4133
+ },
4134
+ {
4135
+ name: "poolCreatorAuthority";
4136
+ type: "pubkey";
4137
+ },
4138
+ {
4139
+ name: "index";
4140
+ type: "u64";
4141
+ }
4142
+ ];
4143
+ };
4144
+ },
3820
4145
  {
3821
4146
  name: "evtCreatePosition";
3822
4147
  type: {
@@ -4386,14 +4711,11 @@ type CpAmm$1 = {
4386
4711
  type: "u128";
4387
4712
  },
4388
4713
  {
4389
- name: "tokenAReserve";
4390
- docs: ["token a reserve"];
4391
- type: "u64";
4392
- },
4393
- {
4394
- name: "tokenBReserve";
4395
- docs: ["token b reserve"];
4396
- type: "u64";
4714
+ name: "padding";
4715
+ docs: [
4716
+ "padding, previous reserve amount, be careful to use that field"
4717
+ ];
4718
+ type: "u128";
4397
4719
  },
4398
4720
  {
4399
4721
  name: "protocolAFee";
@@ -4960,6 +5282,46 @@ type CpAmm$1 = {
4960
5282
  ];
4961
5283
  };
4962
5284
  },
5285
+ {
5286
+ name: "staticConfigParameters";
5287
+ type: {
5288
+ kind: "struct";
5289
+ fields: [
5290
+ {
5291
+ name: "poolFees";
5292
+ type: {
5293
+ defined: {
5294
+ name: "poolFeeParameters";
5295
+ };
5296
+ };
5297
+ },
5298
+ {
5299
+ name: "sqrtMinPrice";
5300
+ type: "u128";
5301
+ },
5302
+ {
5303
+ name: "sqrtMaxPrice";
5304
+ type: "u128";
5305
+ },
5306
+ {
5307
+ name: "vaultConfigKey";
5308
+ type: "pubkey";
5309
+ },
5310
+ {
5311
+ name: "poolCreatorAuthority";
5312
+ type: "pubkey";
5313
+ },
5314
+ {
5315
+ name: "activationType";
5316
+ type: "u8";
5317
+ },
5318
+ {
5319
+ name: "collectFeeMode";
5320
+ type: "u8";
5321
+ }
5322
+ ];
5323
+ };
5324
+ },
4963
5325
  {
4964
5326
  name: "swapParameters";
4965
5327
  type: {
@@ -5207,17 +5569,37 @@ type PoolFeesParams = {
5207
5569
  referralFeePercent: number;
5208
5570
  dynamicFee: DynamicFee | null;
5209
5571
  };
5210
- type InitializeCustomizeablePoolParams = {
5572
+ type PrepareTokenAccountParams = {
5211
5573
  payer: PublicKey;
5212
- creator: PublicKey;
5213
- positionNft: PublicKey;
5574
+ tokenAOwner: PublicKey;
5575
+ tokenBOwner: PublicKey;
5214
5576
  tokenAMint: PublicKey;
5215
5577
  tokenBMint: PublicKey;
5216
- tokenAAmount: BN;
5217
- tokenBAmount: BN;
5218
- sqrtMinPrice: BN;
5219
- sqrtMaxPrice: BN;
5220
- liquidityDelta: BN;
5578
+ tokenAProgram: PublicKey;
5579
+ tokenBProgram: PublicKey;
5580
+ };
5581
+ type PrepareCustomizablePoolParams = {
5582
+ pool: PublicKey;
5583
+ tokenAMint: PublicKey;
5584
+ tokenBMint: PublicKey;
5585
+ tokenAAmount: BN;
5586
+ tokenBAmount: BN;
5587
+ payer: PublicKey;
5588
+ positionNft: PublicKey;
5589
+ tokenAProgram: PublicKey;
5590
+ tokenBProgram: PublicKey;
5591
+ };
5592
+ type InitializeCustomizeablePoolParams = {
5593
+ payer: PublicKey;
5594
+ creator: PublicKey;
5595
+ positionNft: PublicKey;
5596
+ tokenAMint: PublicKey;
5597
+ tokenBMint: PublicKey;
5598
+ tokenAAmount: BN;
5599
+ tokenBAmount: BN;
5600
+ sqrtMinPrice: BN;
5601
+ sqrtMaxPrice: BN;
5602
+ liquidityDelta: BN;
5221
5603
  initSqrtPrice: BN;
5222
5604
  poolFees: PoolFeesParams;
5223
5605
  hasAlphaVault: boolean;
@@ -5226,6 +5608,11 @@ type InitializeCustomizeablePoolParams = {
5226
5608
  activationPoint: BN | null;
5227
5609
  tokenAProgram: PublicKey;
5228
5610
  tokenBProgram: PublicKey;
5611
+ isLockLiquidity?: boolean;
5612
+ };
5613
+ type InitializeCustomizeablePoolWithDynamicConfigParams = InitializeCustomizeablePoolParams & {
5614
+ config: PublicKey;
5615
+ poolCreatorAuthority: PublicKey;
5229
5616
  };
5230
5617
  type PreparePoolCreationParams = {
5231
5618
  tokenAAmount: BN;
@@ -5269,6 +5656,7 @@ type CreatePoolParams = {
5269
5656
  activationPoint: BN | null;
5270
5657
  tokenAProgram: PublicKey;
5271
5658
  tokenBProgram: PublicKey;
5659
+ isLockLiquidity?: boolean;
5272
5660
  };
5273
5661
  type CreatePositionParams = {
5274
5662
  owner: PublicKey;
@@ -5478,6 +5866,15 @@ type LockPositionParams = {
5478
5866
  liquidityPerPeriod: BN;
5479
5867
  numberOfPeriod: number;
5480
5868
  };
5869
+ type SetupFeeClaimAccountsParams = {
5870
+ payer: PublicKey;
5871
+ tokenAMint: PublicKey;
5872
+ tokenBMint: PublicKey;
5873
+ tokenAProgram: PublicKey;
5874
+ tokenBProgram: PublicKey;
5875
+ receiver: PublicKey;
5876
+ tempWSolAccount?: PublicKey;
5877
+ };
5481
5878
  type ClaimPositionFeeInstructionParams = {
5482
5879
  owner: PublicKey;
5483
5880
  poolAuthority: PublicKey;
@@ -5504,6 +5901,9 @@ type ClaimPositionFeeParams = {
5504
5901
  tokenBVault: PublicKey;
5505
5902
  tokenAProgram: PublicKey;
5506
5903
  tokenBProgram: PublicKey;
5904
+ receiver: PublicKey;
5905
+ feePayer?: PublicKey;
5906
+ tempWSolAccount?: PublicKey;
5507
5907
  };
5508
5908
  type ClosePositionInstructionParams = {
5509
5909
  owner: PublicKey;
@@ -5549,6 +5949,9 @@ type ClaimPartnerFeeParams = {
5549
5949
  pool: PublicKey;
5550
5950
  maxAmountA: BN;
5551
5951
  maxAmountB: BN;
5952
+ receiver: PublicKey;
5953
+ feePayer?: PublicKey;
5954
+ tempWSolAccount?: PublicKey;
5552
5955
  };
5553
5956
  type ClaimRewardParams = {
5554
5957
  user: PublicKey;
@@ -5557,6 +5960,7 @@ type ClaimRewardParams = {
5557
5960
  positionState: PositionState;
5558
5961
  positionNftAccount: PublicKey;
5559
5962
  rewardIndex: number;
5963
+ feePayer?: PublicKey;
5560
5964
  };
5561
5965
  type RefreshVestingParams = {
5562
5966
  owner: PublicKey;
@@ -5691,6 +6095,19 @@ declare class CpAmm {
5691
6095
  * @returns Transaction instruction.
5692
6096
  */
5693
6097
  private buildCreatePositionInstruction;
6098
+ /**
6099
+ * Private helper method to prepare common customizable pool creation logic
6100
+ * @param {PrepareCustomizablePoolParams} params - Common parameters for pool creation
6101
+ * @returns Prepared transaction data including instructions and accounts
6102
+ */
6103
+ private prepareCreatePoolParams;
6104
+ /**
6105
+ * Sets up token accounts and instructions for fee claim operations.
6106
+ * @private
6107
+ * @param {SetupFeeClaimAccountsParams} params - Parameters for setting up fee claim accounts.
6108
+ * @returns Token accounts and instructions for fee claiming.
6109
+ */
6110
+ private setupFeeClaimAccounts;
5694
6111
  /**
5695
6112
  * Fetches the Config state of the program.
5696
6113
  * @param config - Public key of the config account.
@@ -5868,6 +6285,11 @@ declare class CpAmm {
5868
6285
  pool: PublicKey;
5869
6286
  position: PublicKey;
5870
6287
  }>;
6288
+ createCustomPoolWithDynamicConfig(params: InitializeCustomizeablePoolWithDynamicConfigParams): Promise<{
6289
+ tx: Transaction;
6290
+ pool: PublicKey;
6291
+ position: PublicKey;
6292
+ }>;
5871
6293
  /**
5872
6294
  * Builds a transaction to create a position.
5873
6295
  * @param {CreatePositionParams} params - Parameters for position creation.
@@ -5926,12 +6348,6 @@ declare class CpAmm {
5926
6348
  * @returns Transaction builder.
5927
6349
  */
5928
6350
  refreshVesting(params: RefreshVestingParams): TxBuilder;
5929
- /**
5930
- * Builds a transaction to claim position fee rewards.
5931
- * @param {ClaimPositionFeeParams} params - Parameters for claiming position fee.
5932
- * @returns Transaction builder.
5933
- */
5934
- claimPositionFee(params: ClaimPositionFeeParams): TxBuilder;
5935
6351
  closePosition(params: ClosePositionParams): TxBuilder;
5936
6352
  /**
5937
6353
  * Builds a transaction to remove all liquidity from a position and close it.
@@ -5988,6 +6404,12 @@ declare class CpAmm {
5988
6404
  * @returns Transaction builder.
5989
6405
  */
5990
6406
  claimPartnerFee(params: ClaimPartnerFeeParams): TxBuilder;
6407
+ /**
6408
+ * Builds a transaction to claim position fee rewards.
6409
+ * @param {ClaimPositionFeeParams} params - Parameters for claiming position fee.
6410
+ * @returns Transaction builder.
6411
+ */
6412
+ claimPositionFee(params: ClaimPositionFeeParams): TxBuilder;
5991
6413
  /**
5992
6414
  * Builds a transaction to claim reward from a position.
5993
6415
  * @param {ClaimRewardParams} params - Parameters for claiming reward.
@@ -6033,7 +6455,7 @@ declare const getOrCreateATAInstruction: (connection: Connection, tokenMint: Pub
6033
6455
  ix?: TransactionInstruction;
6034
6456
  }>;
6035
6457
  declare const wrapSOLInstruction: (from: PublicKey, to: PublicKey, amount: bigint) => TransactionInstruction[];
6036
- declare const unwrapSOLInstruction: (owner: PublicKey, allowOwnerOffCurve?: boolean) => Promise<TransactionInstruction>;
6458
+ declare const unwrapSOLInstruction: (owner: PublicKey, receiver?: PublicKey, allowOwnerOffCurve?: boolean) => Promise<TransactionInstruction>;
6037
6459
  declare function getAllUserPositionNftAccount(connection: Connection, user: PublicKey): Promise<Array<{
6038
6460
  positionNft: PublicKey;
6039
6461
  positionNftAccount: PublicKey;
@@ -6236,7 +6658,7 @@ declare function decimalToQ64(num: Decimal): BN;
6236
6658
  var address = "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
6237
6659
  var metadata = {
6238
6660
  name: "cp_amm",
6239
- version: "0.1.0",
6661
+ version: "0.1.1",
6240
6662
  spec: "0.1.0",
6241
6663
  description: "Created with Anchor"
6242
6664
  };
@@ -6798,38 +7220,38 @@ var instructions = [
6798
7220
  {
6799
7221
  kind: "const",
6800
7222
  value: [
6801
- 153,
6802
- 10,
6803
- 107,
6804
- 154,
6805
- 255,
6806
- 249,
6807
- 210,
7223
+ 48,
7224
+ 9,
7225
+ 89,
7226
+ 123,
7227
+ 106,
7228
+ 114,
7229
+ 131,
7230
+ 251,
7231
+ 50,
6808
7232
  173,
6809
- 176,
6810
- 67,
6811
- 220,
6812
- 214,
6813
- 152,
6814
- 71,
6815
- 46,
6816
- 146,
6817
- 161,
6818
- 33,
7233
+ 254,
7234
+ 250,
7235
+ 10,
7236
+ 80,
7237
+ 160,
7238
+ 84,
7239
+ 143,
7240
+ 100,
6819
7241
  81,
6820
- 148,
7242
+ 249,
7243
+ 134,
7244
+ 112,
7245
+ 30,
7246
+ 213,
7247
+ 50,
6821
7248
  166,
6822
- 119,
6823
- 5,
6824
- 189,
6825
- 142,
6826
- 11,
6827
- 57,
6828
- 68,
6829
- 162,
6830
- 70,
6831
- 126,
6832
- 100
7249
+ 239,
7250
+ 78,
7251
+ 53,
7252
+ 175,
7253
+ 188,
7254
+ 85
6833
7255
  ]
6834
7256
  },
6835
7257
  {
@@ -6891,38 +7313,38 @@ var instructions = [
6891
7313
  {
6892
7314
  kind: "const",
6893
7315
  value: [
6894
- 153,
6895
- 10,
6896
- 107,
6897
- 154,
6898
- 255,
6899
- 249,
6900
- 210,
7316
+ 48,
7317
+ 9,
7318
+ 89,
7319
+ 123,
7320
+ 106,
7321
+ 114,
7322
+ 131,
7323
+ 251,
7324
+ 50,
6901
7325
  173,
6902
- 176,
6903
- 67,
6904
- 220,
6905
- 214,
6906
- 152,
6907
- 71,
6908
- 46,
6909
- 146,
6910
- 161,
6911
- 33,
7326
+ 254,
7327
+ 250,
7328
+ 10,
7329
+ 80,
7330
+ 160,
7331
+ 84,
7332
+ 143,
7333
+ 100,
6912
7334
  81,
6913
- 148,
7335
+ 249,
7336
+ 134,
7337
+ 112,
7338
+ 30,
7339
+ 213,
7340
+ 50,
6914
7341
  166,
6915
- 119,
6916
- 5,
6917
- 189,
6918
- 142,
6919
- 11,
6920
- 57,
6921
- 68,
6922
- 162,
6923
- 70,
6924
- 126,
6925
- 100
7342
+ 239,
7343
+ 78,
7344
+ 53,
7345
+ 175,
7346
+ 188,
7347
+ 85
6926
7348
  ]
6927
7349
  },
6928
7350
  {
@@ -7521,7 +7943,100 @@ var instructions = [
7521
7943
  },
7522
7944
  {
7523
7945
  kind: "arg",
7524
- path: "config_parameters.index"
7946
+ path: "index"
7947
+ }
7948
+ ]
7949
+ }
7950
+ },
7951
+ {
7952
+ name: "admin",
7953
+ writable: true,
7954
+ signer: true
7955
+ },
7956
+ {
7957
+ name: "system_program",
7958
+ address: "11111111111111111111111111111111"
7959
+ },
7960
+ {
7961
+ name: "event_authority",
7962
+ pda: {
7963
+ seeds: [
7964
+ {
7965
+ kind: "const",
7966
+ value: [
7967
+ 95,
7968
+ 95,
7969
+ 101,
7970
+ 118,
7971
+ 101,
7972
+ 110,
7973
+ 116,
7974
+ 95,
7975
+ 97,
7976
+ 117,
7977
+ 116,
7978
+ 104,
7979
+ 111,
7980
+ 114,
7981
+ 105,
7982
+ 116,
7983
+ 121
7984
+ ]
7985
+ }
7986
+ ]
7987
+ }
7988
+ },
7989
+ {
7990
+ name: "program"
7991
+ }
7992
+ ],
7993
+ args: [
7994
+ {
7995
+ name: "index",
7996
+ type: "u64"
7997
+ },
7998
+ {
7999
+ name: "config_parameters",
8000
+ type: {
8001
+ defined: {
8002
+ name: "StaticConfigParameters"
8003
+ }
8004
+ }
8005
+ }
8006
+ ]
8007
+ },
8008
+ {
8009
+ name: "create_dynamic_config",
8010
+ discriminator: [
8011
+ 81,
8012
+ 251,
8013
+ 122,
8014
+ 78,
8015
+ 66,
8016
+ 57,
8017
+ 208,
8018
+ 82
8019
+ ],
8020
+ accounts: [
8021
+ {
8022
+ name: "config",
8023
+ writable: true,
8024
+ pda: {
8025
+ seeds: [
8026
+ {
8027
+ kind: "const",
8028
+ value: [
8029
+ 99,
8030
+ 111,
8031
+ 110,
8032
+ 102,
8033
+ 105,
8034
+ 103
8035
+ ]
8036
+ },
8037
+ {
8038
+ kind: "arg",
8039
+ path: "index"
7525
8040
  }
7526
8041
  ]
7527
8042
  }
@@ -7569,11 +8084,15 @@ var instructions = [
7569
8084
  }
7570
8085
  ],
7571
8086
  args: [
8087
+ {
8088
+ name: "index",
8089
+ type: "u64"
8090
+ },
7572
8091
  {
7573
8092
  name: "config_parameters",
7574
8093
  type: {
7575
8094
  defined: {
7576
- name: "ConfigParameters"
8095
+ name: "DynamicConfigParameters"
7577
8096
  }
7578
8097
  }
7579
8098
  }
@@ -7836,46 +8355,343 @@ var instructions = [
7836
8355
  }
7837
8356
  },
7838
8357
  {
7839
- name: "program"
7840
- }
7841
- ],
7842
- args: [
7843
- ]
7844
- },
7845
- {
7846
- name: "fund_reward",
7847
- discriminator: [
7848
- 188,
7849
- 50,
7850
- 249,
7851
- 165,
7852
- 93,
7853
- 151,
7854
- 38,
7855
- 63
7856
- ],
7857
- accounts: [
7858
- {
7859
- name: "pool",
8358
+ name: "program"
8359
+ }
8360
+ ],
8361
+ args: [
8362
+ ]
8363
+ },
8364
+ {
8365
+ name: "fund_reward",
8366
+ discriminator: [
8367
+ 188,
8368
+ 50,
8369
+ 249,
8370
+ 165,
8371
+ 93,
8372
+ 151,
8373
+ 38,
8374
+ 63
8375
+ ],
8376
+ accounts: [
8377
+ {
8378
+ name: "pool",
8379
+ writable: true
8380
+ },
8381
+ {
8382
+ name: "reward_vault",
8383
+ writable: true
8384
+ },
8385
+ {
8386
+ name: "reward_mint"
8387
+ },
8388
+ {
8389
+ name: "funder_token_account",
8390
+ writable: true
8391
+ },
8392
+ {
8393
+ name: "funder",
8394
+ signer: true
8395
+ },
8396
+ {
8397
+ name: "token_program"
8398
+ },
8399
+ {
8400
+ name: "event_authority",
8401
+ pda: {
8402
+ seeds: [
8403
+ {
8404
+ kind: "const",
8405
+ value: [
8406
+ 95,
8407
+ 95,
8408
+ 101,
8409
+ 118,
8410
+ 101,
8411
+ 110,
8412
+ 116,
8413
+ 95,
8414
+ 97,
8415
+ 117,
8416
+ 116,
8417
+ 104,
8418
+ 111,
8419
+ 114,
8420
+ 105,
8421
+ 116,
8422
+ 121
8423
+ ]
8424
+ }
8425
+ ]
8426
+ }
8427
+ },
8428
+ {
8429
+ name: "program"
8430
+ }
8431
+ ],
8432
+ args: [
8433
+ {
8434
+ name: "reward_index",
8435
+ type: "u8"
8436
+ },
8437
+ {
8438
+ name: "amount",
8439
+ type: "u64"
8440
+ },
8441
+ {
8442
+ name: "carry_forward",
8443
+ type: "bool"
8444
+ }
8445
+ ]
8446
+ },
8447
+ {
8448
+ name: "initialize_customizable_pool",
8449
+ discriminator: [
8450
+ 20,
8451
+ 161,
8452
+ 241,
8453
+ 24,
8454
+ 189,
8455
+ 221,
8456
+ 180,
8457
+ 2
8458
+ ],
8459
+ accounts: [
8460
+ {
8461
+ name: "creator"
8462
+ },
8463
+ {
8464
+ name: "position_nft_mint",
8465
+ docs: [
8466
+ "position_nft_mint"
8467
+ ],
8468
+ writable: true,
8469
+ signer: true
8470
+ },
8471
+ {
8472
+ name: "position_nft_account",
8473
+ docs: [
8474
+ "position nft account"
8475
+ ],
8476
+ writable: true,
8477
+ pda: {
8478
+ seeds: [
8479
+ {
8480
+ kind: "const",
8481
+ value: [
8482
+ 112,
8483
+ 111,
8484
+ 115,
8485
+ 105,
8486
+ 116,
8487
+ 105,
8488
+ 111,
8489
+ 110,
8490
+ 95,
8491
+ 110,
8492
+ 102,
8493
+ 116,
8494
+ 95,
8495
+ 97,
8496
+ 99,
8497
+ 99,
8498
+ 111,
8499
+ 117,
8500
+ 110,
8501
+ 116
8502
+ ]
8503
+ },
8504
+ {
8505
+ kind: "account",
8506
+ path: "position_nft_mint"
8507
+ }
8508
+ ]
8509
+ }
8510
+ },
8511
+ {
8512
+ name: "payer",
8513
+ docs: [
8514
+ "Address paying to create the pool. Can be anyone"
8515
+ ],
8516
+ writable: true,
8517
+ signer: true
8518
+ },
8519
+ {
8520
+ name: "pool_authority",
8521
+ pda: {
8522
+ seeds: [
8523
+ {
8524
+ kind: "const",
8525
+ value: [
8526
+ 112,
8527
+ 111,
8528
+ 111,
8529
+ 108,
8530
+ 95,
8531
+ 97,
8532
+ 117,
8533
+ 116,
8534
+ 104,
8535
+ 111,
8536
+ 114,
8537
+ 105,
8538
+ 116,
8539
+ 121
8540
+ ]
8541
+ }
8542
+ ]
8543
+ }
8544
+ },
8545
+ {
8546
+ name: "pool",
8547
+ docs: [
8548
+ "Initialize an account to store the pool state"
8549
+ ],
8550
+ writable: true
8551
+ },
8552
+ {
8553
+ name: "position",
8554
+ writable: true,
8555
+ pda: {
8556
+ seeds: [
8557
+ {
8558
+ kind: "const",
8559
+ value: [
8560
+ 112,
8561
+ 111,
8562
+ 115,
8563
+ 105,
8564
+ 116,
8565
+ 105,
8566
+ 111,
8567
+ 110
8568
+ ]
8569
+ },
8570
+ {
8571
+ kind: "account",
8572
+ path: "position_nft_mint"
8573
+ }
8574
+ ]
8575
+ }
8576
+ },
8577
+ {
8578
+ name: "token_a_mint",
8579
+ docs: [
8580
+ "Token a mint"
8581
+ ]
8582
+ },
8583
+ {
8584
+ name: "token_b_mint",
8585
+ docs: [
8586
+ "Token b mint"
8587
+ ]
8588
+ },
8589
+ {
8590
+ name: "token_a_vault",
8591
+ docs: [
8592
+ "Token a vault for the pool"
8593
+ ],
8594
+ writable: true,
8595
+ pda: {
8596
+ seeds: [
8597
+ {
8598
+ kind: "const",
8599
+ value: [
8600
+ 116,
8601
+ 111,
8602
+ 107,
8603
+ 101,
8604
+ 110,
8605
+ 95,
8606
+ 118,
8607
+ 97,
8608
+ 117,
8609
+ 108,
8610
+ 116
8611
+ ]
8612
+ },
8613
+ {
8614
+ kind: "account",
8615
+ path: "token_a_mint"
8616
+ },
8617
+ {
8618
+ kind: "account",
8619
+ path: "pool"
8620
+ }
8621
+ ]
8622
+ }
8623
+ },
8624
+ {
8625
+ name: "token_b_vault",
8626
+ docs: [
8627
+ "Token b vault for the pool"
8628
+ ],
8629
+ writable: true,
8630
+ pda: {
8631
+ seeds: [
8632
+ {
8633
+ kind: "const",
8634
+ value: [
8635
+ 116,
8636
+ 111,
8637
+ 107,
8638
+ 101,
8639
+ 110,
8640
+ 95,
8641
+ 118,
8642
+ 97,
8643
+ 117,
8644
+ 108,
8645
+ 116
8646
+ ]
8647
+ },
8648
+ {
8649
+ kind: "account",
8650
+ path: "token_b_mint"
8651
+ },
8652
+ {
8653
+ kind: "account",
8654
+ path: "pool"
8655
+ }
8656
+ ]
8657
+ }
8658
+ },
8659
+ {
8660
+ name: "payer_token_a",
8661
+ docs: [
8662
+ "payer token a account"
8663
+ ],
7860
8664
  writable: true
7861
8665
  },
7862
8666
  {
7863
- name: "reward_vault",
8667
+ name: "payer_token_b",
8668
+ docs: [
8669
+ "creator token b account"
8670
+ ],
7864
8671
  writable: true
7865
8672
  },
7866
8673
  {
7867
- name: "reward_mint"
8674
+ name: "token_a_program",
8675
+ docs: [
8676
+ "Program to create mint account and mint tokens"
8677
+ ]
7868
8678
  },
7869
8679
  {
7870
- name: "funder_token_account",
7871
- writable: true
8680
+ name: "token_b_program",
8681
+ docs: [
8682
+ "Program to create mint account and mint tokens"
8683
+ ]
7872
8684
  },
7873
8685
  {
7874
- name: "funder",
7875
- signer: true
8686
+ name: "token_2022_program",
8687
+ docs: [
8688
+ "Program to create NFT mint/token account and transfer for token22 account"
8689
+ ],
8690
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
7876
8691
  },
7877
8692
  {
7878
- name: "token_program"
8693
+ name: "system_program",
8694
+ address: "11111111111111111111111111111111"
7879
8695
  },
7880
8696
  {
7881
8697
  name: "event_authority",
@@ -7912,30 +8728,29 @@ var instructions = [
7912
8728
  ],
7913
8729
  args: [
7914
8730
  {
7915
- name: "reward_index",
7916
- type: "u8"
7917
- },
7918
- {
7919
- name: "amount",
7920
- type: "u64"
7921
- },
7922
- {
7923
- name: "carry_forward",
7924
- type: "bool"
8731
+ name: "params",
8732
+ type: {
8733
+ defined: {
8734
+ name: "InitializeCustomizablePoolParameters"
8735
+ }
8736
+ }
7925
8737
  }
7926
8738
  ]
7927
8739
  },
7928
8740
  {
7929
- name: "initialize_customizable_pool",
8741
+ name: "initialize_pool",
8742
+ docs: [
8743
+ "USER FUNCTIONS ////"
8744
+ ],
7930
8745
  discriminator: [
7931
- 20,
7932
- 161,
7933
- 241,
7934
- 24,
7935
- 189,
7936
- 221,
8746
+ 95,
7937
8747
  180,
7938
- 2
8748
+ 10,
8749
+ 172,
8750
+ 84,
8751
+ 174,
8752
+ 232,
8753
+ 40
7939
8754
  ],
7940
8755
  accounts: [
7941
8756
  {
@@ -7997,6 +8812,12 @@ var instructions = [
7997
8812
  writable: true,
7998
8813
  signer: true
7999
8814
  },
8815
+ {
8816
+ name: "config",
8817
+ docs: [
8818
+ "Which config the pool belongs to."
8819
+ ]
8820
+ },
8000
8821
  {
8001
8822
  name: "pool_authority",
8002
8823
  pda: {
@@ -8212,26 +9033,23 @@ var instructions = [
8212
9033
  name: "params",
8213
9034
  type: {
8214
9035
  defined: {
8215
- name: "InitializeCustomizablePoolParameters"
9036
+ name: "InitializePoolParameters"
8216
9037
  }
8217
9038
  }
8218
9039
  }
8219
9040
  ]
8220
9041
  },
8221
9042
  {
8222
- name: "initialize_pool",
8223
- docs: [
8224
- "USER FUNCTIONS ////"
8225
- ],
9043
+ name: "initialize_pool_with_dynamic_config",
8226
9044
  discriminator: [
8227
- 95,
8228
- 180,
8229
- 10,
8230
- 172,
8231
- 84,
8232
- 174,
8233
- 232,
8234
- 40
9045
+ 149,
9046
+ 82,
9047
+ 72,
9048
+ 197,
9049
+ 253,
9050
+ 252,
9051
+ 68,
9052
+ 15
8235
9053
  ],
8236
9054
  accounts: [
8237
9055
  {
@@ -8293,6 +9111,13 @@ var instructions = [
8293
9111
  writable: true,
8294
9112
  signer: true
8295
9113
  },
9114
+ {
9115
+ name: "pool_creator_authority",
9116
+ signer: true,
9117
+ relations: [
9118
+ "config"
9119
+ ]
9120
+ },
8296
9121
  {
8297
9122
  name: "config",
8298
9123
  docs: [
@@ -8514,7 +9339,7 @@ var instructions = [
8514
9339
  name: "params",
8515
9340
  type: {
8516
9341
  defined: {
8517
- name: "InitializePoolParameters"
9342
+ name: "InitializeCustomizablePoolParameters"
8518
9343
  }
8519
9344
  }
8520
9345
  }
@@ -9875,6 +10700,19 @@ var events = [
9875
10700
  54
9876
10701
  ]
9877
10702
  },
10703
+ {
10704
+ name: "EvtCreateDynamicConfig",
10705
+ discriminator: [
10706
+ 231,
10707
+ 197,
10708
+ 13,
10709
+ 164,
10710
+ 248,
10711
+ 213,
10712
+ 133,
10713
+ 152
10714
+ ]
10715
+ },
9878
10716
  {
9879
10717
  name: "EvtCreatePosition",
9880
10718
  discriminator: [
@@ -10245,6 +11083,16 @@ var errors = [
10245
11083
  code: 6039,
10246
11084
  name: "PositionIsNotEmpty",
10247
11085
  msg: "Position is not empty"
11086
+ },
11087
+ {
11088
+ code: 6040,
11089
+ name: "InvalidPoolCreatorAuthority",
11090
+ msg: "Invalid pool creator authority"
11091
+ },
11092
+ {
11093
+ code: 6041,
11094
+ name: "InvalidConfigType",
11095
+ msg: "Invalid config type"
10248
11096
  }
10249
11097
  ];
10250
11098
  var types = [
@@ -10473,6 +11321,13 @@ var types = [
10473
11321
  ],
10474
11322
  type: "u8"
10475
11323
  },
11324
+ {
11325
+ name: "config_type",
11326
+ docs: [
11327
+ "Config type mode, 0 for static, 1 for dynamic"
11328
+ ],
11329
+ type: "u8"
11330
+ },
10476
11331
  {
10477
11332
  name: "_padding_0",
10478
11333
  docs: [
@@ -10481,7 +11336,7 @@ var types = [
10481
11336
  type: {
10482
11337
  array: [
10483
11338
  "u8",
10484
- 6
11339
+ 5
10485
11340
  ]
10486
11341
  }
10487
11342
  },
@@ -10523,45 +11378,13 @@ var types = [
10523
11378
  }
10524
11379
  },
10525
11380
  {
10526
- name: "ConfigParameters",
11381
+ name: "DynamicConfigParameters",
10527
11382
  type: {
10528
11383
  kind: "struct",
10529
11384
  fields: [
10530
- {
10531
- name: "pool_fees",
10532
- type: {
10533
- defined: {
10534
- name: "PoolFeeParameters"
10535
- }
10536
- }
10537
- },
10538
- {
10539
- name: "sqrt_min_price",
10540
- type: "u128"
10541
- },
10542
- {
10543
- name: "sqrt_max_price",
10544
- type: "u128"
10545
- },
10546
- {
10547
- name: "vault_config_key",
10548
- type: "pubkey"
10549
- },
10550
11385
  {
10551
11386
  name: "pool_creator_authority",
10552
11387
  type: "pubkey"
10553
- },
10554
- {
10555
- name: "activation_type",
10556
- type: "u8"
10557
- },
10558
- {
10559
- name: "collect_fee_mode",
10560
- type: "u8"
10561
- },
10562
- {
10563
- name: "index",
10564
- type: "u64"
10565
11388
  }
10566
11389
  ]
10567
11390
  }
@@ -10963,7 +11786,7 @@ var types = [
10963
11786
  {
10964
11787
  name: "EvtCreateConfig",
10965
11788
  docs: [
10966
- "Create config"
11789
+ "Create static config"
10967
11790
  ],
10968
11791
  type: {
10969
11792
  kind: "struct",
@@ -11011,6 +11834,29 @@ var types = [
11011
11834
  ]
11012
11835
  }
11013
11836
  },
11837
+ {
11838
+ name: "EvtCreateDynamicConfig",
11839
+ docs: [
11840
+ "Create dynamic config"
11841
+ ],
11842
+ type: {
11843
+ kind: "struct",
11844
+ fields: [
11845
+ {
11846
+ name: "config",
11847
+ type: "pubkey"
11848
+ },
11849
+ {
11850
+ name: "pool_creator_authority",
11851
+ type: "pubkey"
11852
+ },
11853
+ {
11854
+ name: "index",
11855
+ type: "u64"
11856
+ }
11857
+ ]
11858
+ }
11859
+ },
11014
11860
  {
11015
11861
  name: "EvtCreatePosition",
11016
11862
  type: {
@@ -11616,18 +12462,11 @@ var types = [
11616
12462
  type: "u128"
11617
12463
  },
11618
12464
  {
11619
- name: "token_a_reserve",
11620
- docs: [
11621
- "token a reserve"
11622
- ],
11623
- type: "u64"
11624
- },
11625
- {
11626
- name: "token_b_reserve",
12465
+ name: "_padding",
11627
12466
  docs: [
11628
- "token b reserve"
12467
+ "padding, previous reserve amount, be careful to use that field"
11629
12468
  ],
11630
- type: "u64"
12469
+ type: "u128"
11631
12470
  },
11632
12471
  {
11633
12472
  name: "protocol_a_fee",
@@ -12350,6 +13189,46 @@ var types = [
12350
13189
  ]
12351
13190
  }
12352
13191
  },
13192
+ {
13193
+ name: "StaticConfigParameters",
13194
+ type: {
13195
+ kind: "struct",
13196
+ fields: [
13197
+ {
13198
+ name: "pool_fees",
13199
+ type: {
13200
+ defined: {
13201
+ name: "PoolFeeParameters"
13202
+ }
13203
+ }
13204
+ },
13205
+ {
13206
+ name: "sqrt_min_price",
13207
+ type: "u128"
13208
+ },
13209
+ {
13210
+ name: "sqrt_max_price",
13211
+ type: "u128"
13212
+ },
13213
+ {
13214
+ name: "vault_config_key",
13215
+ type: "pubkey"
13216
+ },
13217
+ {
13218
+ name: "pool_creator_authority",
13219
+ type: "pubkey"
13220
+ },
13221
+ {
13222
+ name: "activation_type",
13223
+ type: "u8"
13224
+ },
13225
+ {
13226
+ name: "collect_fee_mode",
13227
+ type: "u8"
13228
+ }
13229
+ ]
13230
+ }
13231
+ },
12353
13232
  {
12354
13233
  name: "SwapParameters",
12355
13234
  type: {
@@ -12572,4 +13451,4 @@ var CpAmmIDL = {
12572
13451
  types: types
12573
13452
  };
12574
13453
 
12575
- export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, type DepositQuote, type DynamicFee, type DynamicFeeParams, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PreparedPoolCreation, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SwapParams, type SwapQuotes, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, feeNumeratorToBps, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAvailableVestingLiquidity, getBaseFeeNumerator, getBaseFeeParams, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getFeeNumerator, getFirstKey, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getOrCreateATAInstruction, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getTokenDecimals, getTokenProgram, getTotalLockedLiquidity, getUnClaimReward, isVestingComplete, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };
13454
+ export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, type DepositQuote, type DynamicFee, type DynamicFeeParams, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SetupFeeClaimAccountsParams, type SwapParams, type SwapQuotes, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, feeNumeratorToBps, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAvailableVestingLiquidity, getBaseFeeNumerator, getBaseFeeParams, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getFeeNumerator, getFirstKey, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getOrCreateATAInstruction, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getTokenDecimals, getTokenProgram, getTotalLockedLiquidity, getUnClaimReward, isVestingComplete, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };