@meteora-ag/cp-amm-sdk 1.0.2 → 1.0.4-rc.0

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;
@@ -5304,8 +5692,6 @@ type CreatePositionAndAddLiquidity = {
5304
5692
  tokenBAmountThreshold: BN;
5305
5693
  tokenAMint: PublicKey;
5306
5694
  tokenBMint: PublicKey;
5307
- tokenAVault: PublicKey;
5308
- tokenBVault: PublicKey;
5309
5695
  tokenAProgram: PublicKey;
5310
5696
  tokenBProgram: PublicKey;
5311
5697
  };
@@ -5478,6 +5864,15 @@ type LockPositionParams = {
5478
5864
  liquidityPerPeriod: BN;
5479
5865
  numberOfPeriod: number;
5480
5866
  };
5867
+ type SetupFeeClaimAccountsParams = {
5868
+ payer: PublicKey;
5869
+ tokenAMint: PublicKey;
5870
+ tokenBMint: PublicKey;
5871
+ tokenAProgram: PublicKey;
5872
+ tokenBProgram: PublicKey;
5873
+ receiver: PublicKey;
5874
+ tempWSolAccount?: PublicKey;
5875
+ };
5481
5876
  type ClaimPositionFeeInstructionParams = {
5482
5877
  owner: PublicKey;
5483
5878
  poolAuthority: PublicKey;
@@ -5504,6 +5899,9 @@ type ClaimPositionFeeParams = {
5504
5899
  tokenBVault: PublicKey;
5505
5900
  tokenAProgram: PublicKey;
5506
5901
  tokenBProgram: PublicKey;
5902
+ receiver: PublicKey;
5903
+ feePayer?: PublicKey;
5904
+ tempWSolAccount?: PublicKey;
5507
5905
  };
5508
5906
  type ClosePositionInstructionParams = {
5509
5907
  owner: PublicKey;
@@ -5549,6 +5947,9 @@ type ClaimPartnerFeeParams = {
5549
5947
  pool: PublicKey;
5550
5948
  maxAmountA: BN;
5551
5949
  maxAmountB: BN;
5950
+ receiver: PublicKey;
5951
+ feePayer?: PublicKey;
5952
+ tempWSolAccount?: PublicKey;
5552
5953
  };
5553
5954
  type ClaimRewardParams = {
5554
5955
  user: PublicKey;
@@ -5557,6 +5958,7 @@ type ClaimRewardParams = {
5557
5958
  positionState: PositionState;
5558
5959
  positionNftAccount: PublicKey;
5559
5960
  rewardIndex: number;
5961
+ feePayer?: PublicKey;
5560
5962
  };
5561
5963
  type RefreshVestingParams = {
5562
5964
  owner: PublicKey;
@@ -5691,6 +6093,19 @@ declare class CpAmm {
5691
6093
  * @returns Transaction instruction.
5692
6094
  */
5693
6095
  private buildCreatePositionInstruction;
6096
+ /**
6097
+ * Private helper method to prepare common customizable pool creation logic
6098
+ * @param {PrepareCustomizablePoolParams} params - Common parameters for pool creation
6099
+ * @returns Prepared transaction data including instructions and accounts
6100
+ */
6101
+ private prepareCreatePoolParams;
6102
+ /**
6103
+ * Sets up token accounts and instructions for fee claim operations.
6104
+ * @private
6105
+ * @param {SetupFeeClaimAccountsParams} params - Parameters for setting up fee claim accounts.
6106
+ * @returns Token accounts and instructions for fee claiming.
6107
+ */
6108
+ private setupFeeClaimAccounts;
5694
6109
  /**
5695
6110
  * Fetches the Config state of the program.
5696
6111
  * @param config - Public key of the config account.
@@ -5868,6 +6283,11 @@ declare class CpAmm {
5868
6283
  pool: PublicKey;
5869
6284
  position: PublicKey;
5870
6285
  }>;
6286
+ createCustomPoolWithDynamicConfig(params: InitializeCustomizeablePoolWithDynamicConfigParams): Promise<{
6287
+ tx: Transaction;
6288
+ pool: PublicKey;
6289
+ position: PublicKey;
6290
+ }>;
5871
6291
  /**
5872
6292
  * Builds a transaction to create a position.
5873
6293
  * @param {CreatePositionParams} params - Parameters for position creation.
@@ -5926,12 +6346,6 @@ declare class CpAmm {
5926
6346
  * @returns Transaction builder.
5927
6347
  */
5928
6348
  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
6349
  closePosition(params: ClosePositionParams): TxBuilder;
5936
6350
  /**
5937
6351
  * Builds a transaction to remove all liquidity from a position and close it.
@@ -5988,6 +6402,12 @@ declare class CpAmm {
5988
6402
  * @returns Transaction builder.
5989
6403
  */
5990
6404
  claimPartnerFee(params: ClaimPartnerFeeParams): TxBuilder;
6405
+ /**
6406
+ * Builds a transaction to claim position fee rewards.
6407
+ * @param {ClaimPositionFeeParams} params - Parameters for claiming position fee.
6408
+ * @returns Transaction builder.
6409
+ */
6410
+ claimPositionFee(params: ClaimPositionFeeParams): TxBuilder;
5991
6411
  /**
5992
6412
  * Builds a transaction to claim reward from a position.
5993
6413
  * @param {ClaimRewardParams} params - Parameters for claiming reward.
@@ -6033,7 +6453,7 @@ declare const getOrCreateATAInstruction: (connection: Connection, tokenMint: Pub
6033
6453
  ix?: TransactionInstruction;
6034
6454
  }>;
6035
6455
  declare const wrapSOLInstruction: (from: PublicKey, to: PublicKey, amount: bigint) => TransactionInstruction[];
6036
- declare const unwrapSOLInstruction: (owner: PublicKey, allowOwnerOffCurve?: boolean) => Promise<TransactionInstruction>;
6456
+ declare const unwrapSOLInstruction: (owner: PublicKey, receiver?: PublicKey, allowOwnerOffCurve?: boolean) => Promise<TransactionInstruction>;
6037
6457
  declare function getAllUserPositionNftAccount(connection: Connection, user: PublicKey): Promise<Array<{
6038
6458
  positionNft: PublicKey;
6039
6459
  positionNftAccount: PublicKey;
@@ -6236,7 +6656,7 @@ declare function decimalToQ64(num: Decimal): BN;
6236
6656
  var address = "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
6237
6657
  var metadata = {
6238
6658
  name: "cp_amm",
6239
- version: "0.1.0",
6659
+ version: "0.1.1",
6240
6660
  spec: "0.1.0",
6241
6661
  description: "Created with Anchor"
6242
6662
  };
@@ -6798,38 +7218,38 @@ var instructions = [
6798
7218
  {
6799
7219
  kind: "const",
6800
7220
  value: [
6801
- 153,
6802
- 10,
6803
- 107,
6804
- 154,
6805
- 255,
6806
- 249,
6807
- 210,
7221
+ 48,
7222
+ 9,
7223
+ 89,
7224
+ 123,
7225
+ 106,
7226
+ 114,
7227
+ 131,
7228
+ 251,
7229
+ 50,
6808
7230
  173,
6809
- 176,
6810
- 67,
6811
- 220,
6812
- 214,
6813
- 152,
6814
- 71,
6815
- 46,
6816
- 146,
6817
- 161,
6818
- 33,
7231
+ 254,
7232
+ 250,
7233
+ 10,
7234
+ 80,
7235
+ 160,
7236
+ 84,
7237
+ 143,
7238
+ 100,
6819
7239
  81,
6820
- 148,
7240
+ 249,
7241
+ 134,
7242
+ 112,
7243
+ 30,
7244
+ 213,
7245
+ 50,
6821
7246
  166,
6822
- 119,
6823
- 5,
6824
- 189,
6825
- 142,
6826
- 11,
6827
- 57,
6828
- 68,
6829
- 162,
6830
- 70,
6831
- 126,
6832
- 100
7247
+ 239,
7248
+ 78,
7249
+ 53,
7250
+ 175,
7251
+ 188,
7252
+ 85
6833
7253
  ]
6834
7254
  },
6835
7255
  {
@@ -6891,38 +7311,38 @@ var instructions = [
6891
7311
  {
6892
7312
  kind: "const",
6893
7313
  value: [
6894
- 153,
6895
- 10,
6896
- 107,
6897
- 154,
6898
- 255,
6899
- 249,
6900
- 210,
7314
+ 48,
7315
+ 9,
7316
+ 89,
7317
+ 123,
7318
+ 106,
7319
+ 114,
7320
+ 131,
7321
+ 251,
7322
+ 50,
6901
7323
  173,
6902
- 176,
6903
- 67,
6904
- 220,
6905
- 214,
6906
- 152,
6907
- 71,
6908
- 46,
6909
- 146,
6910
- 161,
6911
- 33,
7324
+ 254,
7325
+ 250,
7326
+ 10,
7327
+ 80,
7328
+ 160,
7329
+ 84,
7330
+ 143,
7331
+ 100,
6912
7332
  81,
6913
- 148,
7333
+ 249,
7334
+ 134,
7335
+ 112,
7336
+ 30,
7337
+ 213,
7338
+ 50,
6914
7339
  166,
6915
- 119,
6916
- 5,
6917
- 189,
6918
- 142,
6919
- 11,
6920
- 57,
6921
- 68,
6922
- 162,
6923
- 70,
6924
- 126,
6925
- 100
7340
+ 239,
7341
+ 78,
7342
+ 53,
7343
+ 175,
7344
+ 188,
7345
+ 85
6926
7346
  ]
6927
7347
  },
6928
7348
  {
@@ -7521,7 +7941,7 @@ var instructions = [
7521
7941
  },
7522
7942
  {
7523
7943
  kind: "arg",
7524
- path: "config_parameters.index"
7944
+ path: "index"
7525
7945
  }
7526
7946
  ]
7527
7947
  }
@@ -7569,11 +7989,108 @@ var instructions = [
7569
7989
  }
7570
7990
  ],
7571
7991
  args: [
7992
+ {
7993
+ name: "index",
7994
+ type: "u64"
7995
+ },
7572
7996
  {
7573
7997
  name: "config_parameters",
7574
7998
  type: {
7575
7999
  defined: {
7576
- name: "ConfigParameters"
8000
+ name: "StaticConfigParameters"
8001
+ }
8002
+ }
8003
+ }
8004
+ ]
8005
+ },
8006
+ {
8007
+ name: "create_dynamic_config",
8008
+ discriminator: [
8009
+ 81,
8010
+ 251,
8011
+ 122,
8012
+ 78,
8013
+ 66,
8014
+ 57,
8015
+ 208,
8016
+ 82
8017
+ ],
8018
+ accounts: [
8019
+ {
8020
+ name: "config",
8021
+ writable: true,
8022
+ pda: {
8023
+ seeds: [
8024
+ {
8025
+ kind: "const",
8026
+ value: [
8027
+ 99,
8028
+ 111,
8029
+ 110,
8030
+ 102,
8031
+ 105,
8032
+ 103
8033
+ ]
8034
+ },
8035
+ {
8036
+ kind: "arg",
8037
+ path: "index"
8038
+ }
8039
+ ]
8040
+ }
8041
+ },
8042
+ {
8043
+ name: "admin",
8044
+ writable: true,
8045
+ signer: true
8046
+ },
8047
+ {
8048
+ name: "system_program",
8049
+ address: "11111111111111111111111111111111"
8050
+ },
8051
+ {
8052
+ name: "event_authority",
8053
+ pda: {
8054
+ seeds: [
8055
+ {
8056
+ kind: "const",
8057
+ value: [
8058
+ 95,
8059
+ 95,
8060
+ 101,
8061
+ 118,
8062
+ 101,
8063
+ 110,
8064
+ 116,
8065
+ 95,
8066
+ 97,
8067
+ 117,
8068
+ 116,
8069
+ 104,
8070
+ 111,
8071
+ 114,
8072
+ 105,
8073
+ 116,
8074
+ 121
8075
+ ]
8076
+ }
8077
+ ]
8078
+ }
8079
+ },
8080
+ {
8081
+ name: "program"
8082
+ }
8083
+ ],
8084
+ args: [
8085
+ {
8086
+ name: "index",
8087
+ type: "u64"
8088
+ },
8089
+ {
8090
+ name: "config_parameters",
8091
+ type: {
8092
+ defined: {
8093
+ name: "DynamicConfigParameters"
7577
8094
  }
7578
8095
  }
7579
8096
  }
@@ -7836,46 +8353,343 @@ var instructions = [
7836
8353
  }
7837
8354
  },
7838
8355
  {
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",
8356
+ name: "program"
8357
+ }
8358
+ ],
8359
+ args: [
8360
+ ]
8361
+ },
8362
+ {
8363
+ name: "fund_reward",
8364
+ discriminator: [
8365
+ 188,
8366
+ 50,
8367
+ 249,
8368
+ 165,
8369
+ 93,
8370
+ 151,
8371
+ 38,
8372
+ 63
8373
+ ],
8374
+ accounts: [
8375
+ {
8376
+ name: "pool",
8377
+ writable: true
8378
+ },
8379
+ {
8380
+ name: "reward_vault",
8381
+ writable: true
8382
+ },
8383
+ {
8384
+ name: "reward_mint"
8385
+ },
8386
+ {
8387
+ name: "funder_token_account",
8388
+ writable: true
8389
+ },
8390
+ {
8391
+ name: "funder",
8392
+ signer: true
8393
+ },
8394
+ {
8395
+ name: "token_program"
8396
+ },
8397
+ {
8398
+ name: "event_authority",
8399
+ pda: {
8400
+ seeds: [
8401
+ {
8402
+ kind: "const",
8403
+ value: [
8404
+ 95,
8405
+ 95,
8406
+ 101,
8407
+ 118,
8408
+ 101,
8409
+ 110,
8410
+ 116,
8411
+ 95,
8412
+ 97,
8413
+ 117,
8414
+ 116,
8415
+ 104,
8416
+ 111,
8417
+ 114,
8418
+ 105,
8419
+ 116,
8420
+ 121
8421
+ ]
8422
+ }
8423
+ ]
8424
+ }
8425
+ },
8426
+ {
8427
+ name: "program"
8428
+ }
8429
+ ],
8430
+ args: [
8431
+ {
8432
+ name: "reward_index",
8433
+ type: "u8"
8434
+ },
8435
+ {
8436
+ name: "amount",
8437
+ type: "u64"
8438
+ },
8439
+ {
8440
+ name: "carry_forward",
8441
+ type: "bool"
8442
+ }
8443
+ ]
8444
+ },
8445
+ {
8446
+ name: "initialize_customizable_pool",
8447
+ discriminator: [
8448
+ 20,
8449
+ 161,
8450
+ 241,
8451
+ 24,
8452
+ 189,
8453
+ 221,
8454
+ 180,
8455
+ 2
8456
+ ],
8457
+ accounts: [
8458
+ {
8459
+ name: "creator"
8460
+ },
8461
+ {
8462
+ name: "position_nft_mint",
8463
+ docs: [
8464
+ "position_nft_mint"
8465
+ ],
8466
+ writable: true,
8467
+ signer: true
8468
+ },
8469
+ {
8470
+ name: "position_nft_account",
8471
+ docs: [
8472
+ "position nft account"
8473
+ ],
8474
+ writable: true,
8475
+ pda: {
8476
+ seeds: [
8477
+ {
8478
+ kind: "const",
8479
+ value: [
8480
+ 112,
8481
+ 111,
8482
+ 115,
8483
+ 105,
8484
+ 116,
8485
+ 105,
8486
+ 111,
8487
+ 110,
8488
+ 95,
8489
+ 110,
8490
+ 102,
8491
+ 116,
8492
+ 95,
8493
+ 97,
8494
+ 99,
8495
+ 99,
8496
+ 111,
8497
+ 117,
8498
+ 110,
8499
+ 116
8500
+ ]
8501
+ },
8502
+ {
8503
+ kind: "account",
8504
+ path: "position_nft_mint"
8505
+ }
8506
+ ]
8507
+ }
8508
+ },
8509
+ {
8510
+ name: "payer",
8511
+ docs: [
8512
+ "Address paying to create the pool. Can be anyone"
8513
+ ],
8514
+ writable: true,
8515
+ signer: true
8516
+ },
8517
+ {
8518
+ name: "pool_authority",
8519
+ pda: {
8520
+ seeds: [
8521
+ {
8522
+ kind: "const",
8523
+ value: [
8524
+ 112,
8525
+ 111,
8526
+ 111,
8527
+ 108,
8528
+ 95,
8529
+ 97,
8530
+ 117,
8531
+ 116,
8532
+ 104,
8533
+ 111,
8534
+ 114,
8535
+ 105,
8536
+ 116,
8537
+ 121
8538
+ ]
8539
+ }
8540
+ ]
8541
+ }
8542
+ },
8543
+ {
8544
+ name: "pool",
8545
+ docs: [
8546
+ "Initialize an account to store the pool state"
8547
+ ],
8548
+ writable: true
8549
+ },
8550
+ {
8551
+ name: "position",
8552
+ writable: true,
8553
+ pda: {
8554
+ seeds: [
8555
+ {
8556
+ kind: "const",
8557
+ value: [
8558
+ 112,
8559
+ 111,
8560
+ 115,
8561
+ 105,
8562
+ 116,
8563
+ 105,
8564
+ 111,
8565
+ 110
8566
+ ]
8567
+ },
8568
+ {
8569
+ kind: "account",
8570
+ path: "position_nft_mint"
8571
+ }
8572
+ ]
8573
+ }
8574
+ },
8575
+ {
8576
+ name: "token_a_mint",
8577
+ docs: [
8578
+ "Token a mint"
8579
+ ]
8580
+ },
8581
+ {
8582
+ name: "token_b_mint",
8583
+ docs: [
8584
+ "Token b mint"
8585
+ ]
8586
+ },
8587
+ {
8588
+ name: "token_a_vault",
8589
+ docs: [
8590
+ "Token a vault for the pool"
8591
+ ],
8592
+ writable: true,
8593
+ pda: {
8594
+ seeds: [
8595
+ {
8596
+ kind: "const",
8597
+ value: [
8598
+ 116,
8599
+ 111,
8600
+ 107,
8601
+ 101,
8602
+ 110,
8603
+ 95,
8604
+ 118,
8605
+ 97,
8606
+ 117,
8607
+ 108,
8608
+ 116
8609
+ ]
8610
+ },
8611
+ {
8612
+ kind: "account",
8613
+ path: "token_a_mint"
8614
+ },
8615
+ {
8616
+ kind: "account",
8617
+ path: "pool"
8618
+ }
8619
+ ]
8620
+ }
8621
+ },
8622
+ {
8623
+ name: "token_b_vault",
8624
+ docs: [
8625
+ "Token b vault for the pool"
8626
+ ],
8627
+ writable: true,
8628
+ pda: {
8629
+ seeds: [
8630
+ {
8631
+ kind: "const",
8632
+ value: [
8633
+ 116,
8634
+ 111,
8635
+ 107,
8636
+ 101,
8637
+ 110,
8638
+ 95,
8639
+ 118,
8640
+ 97,
8641
+ 117,
8642
+ 108,
8643
+ 116
8644
+ ]
8645
+ },
8646
+ {
8647
+ kind: "account",
8648
+ path: "token_b_mint"
8649
+ },
8650
+ {
8651
+ kind: "account",
8652
+ path: "pool"
8653
+ }
8654
+ ]
8655
+ }
8656
+ },
8657
+ {
8658
+ name: "payer_token_a",
8659
+ docs: [
8660
+ "payer token a account"
8661
+ ],
7860
8662
  writable: true
7861
8663
  },
7862
8664
  {
7863
- name: "reward_vault",
8665
+ name: "payer_token_b",
8666
+ docs: [
8667
+ "creator token b account"
8668
+ ],
7864
8669
  writable: true
7865
8670
  },
7866
8671
  {
7867
- name: "reward_mint"
8672
+ name: "token_a_program",
8673
+ docs: [
8674
+ "Program to create mint account and mint tokens"
8675
+ ]
7868
8676
  },
7869
8677
  {
7870
- name: "funder_token_account",
7871
- writable: true
8678
+ name: "token_b_program",
8679
+ docs: [
8680
+ "Program to create mint account and mint tokens"
8681
+ ]
7872
8682
  },
7873
8683
  {
7874
- name: "funder",
7875
- signer: true
8684
+ name: "token_2022_program",
8685
+ docs: [
8686
+ "Program to create NFT mint/token account and transfer for token22 account"
8687
+ ],
8688
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
7876
8689
  },
7877
8690
  {
7878
- name: "token_program"
8691
+ name: "system_program",
8692
+ address: "11111111111111111111111111111111"
7879
8693
  },
7880
8694
  {
7881
8695
  name: "event_authority",
@@ -7912,30 +8726,29 @@ var instructions = [
7912
8726
  ],
7913
8727
  args: [
7914
8728
  {
7915
- name: "reward_index",
7916
- type: "u8"
7917
- },
7918
- {
7919
- name: "amount",
7920
- type: "u64"
7921
- },
7922
- {
7923
- name: "carry_forward",
7924
- type: "bool"
8729
+ name: "params",
8730
+ type: {
8731
+ defined: {
8732
+ name: "InitializeCustomizablePoolParameters"
8733
+ }
8734
+ }
7925
8735
  }
7926
8736
  ]
7927
8737
  },
7928
8738
  {
7929
- name: "initialize_customizable_pool",
8739
+ name: "initialize_pool",
8740
+ docs: [
8741
+ "USER FUNCTIONS ////"
8742
+ ],
7930
8743
  discriminator: [
7931
- 20,
7932
- 161,
7933
- 241,
7934
- 24,
7935
- 189,
7936
- 221,
8744
+ 95,
7937
8745
  180,
7938
- 2
8746
+ 10,
8747
+ 172,
8748
+ 84,
8749
+ 174,
8750
+ 232,
8751
+ 40
7939
8752
  ],
7940
8753
  accounts: [
7941
8754
  {
@@ -7997,6 +8810,12 @@ var instructions = [
7997
8810
  writable: true,
7998
8811
  signer: true
7999
8812
  },
8813
+ {
8814
+ name: "config",
8815
+ docs: [
8816
+ "Which config the pool belongs to."
8817
+ ]
8818
+ },
8000
8819
  {
8001
8820
  name: "pool_authority",
8002
8821
  pda: {
@@ -8212,26 +9031,23 @@ var instructions = [
8212
9031
  name: "params",
8213
9032
  type: {
8214
9033
  defined: {
8215
- name: "InitializeCustomizablePoolParameters"
9034
+ name: "InitializePoolParameters"
8216
9035
  }
8217
9036
  }
8218
9037
  }
8219
9038
  ]
8220
9039
  },
8221
9040
  {
8222
- name: "initialize_pool",
8223
- docs: [
8224
- "USER FUNCTIONS ////"
8225
- ],
9041
+ name: "initialize_pool_with_dynamic_config",
8226
9042
  discriminator: [
8227
- 95,
8228
- 180,
8229
- 10,
8230
- 172,
8231
- 84,
8232
- 174,
8233
- 232,
8234
- 40
9043
+ 149,
9044
+ 82,
9045
+ 72,
9046
+ 197,
9047
+ 253,
9048
+ 252,
9049
+ 68,
9050
+ 15
8235
9051
  ],
8236
9052
  accounts: [
8237
9053
  {
@@ -8293,6 +9109,13 @@ var instructions = [
8293
9109
  writable: true,
8294
9110
  signer: true
8295
9111
  },
9112
+ {
9113
+ name: "pool_creator_authority",
9114
+ signer: true,
9115
+ relations: [
9116
+ "config"
9117
+ ]
9118
+ },
8296
9119
  {
8297
9120
  name: "config",
8298
9121
  docs: [
@@ -8514,7 +9337,7 @@ var instructions = [
8514
9337
  name: "params",
8515
9338
  type: {
8516
9339
  defined: {
8517
- name: "InitializePoolParameters"
9340
+ name: "InitializeCustomizablePoolParameters"
8518
9341
  }
8519
9342
  }
8520
9343
  }
@@ -9875,6 +10698,19 @@ var events = [
9875
10698
  54
9876
10699
  ]
9877
10700
  },
10701
+ {
10702
+ name: "EvtCreateDynamicConfig",
10703
+ discriminator: [
10704
+ 231,
10705
+ 197,
10706
+ 13,
10707
+ 164,
10708
+ 248,
10709
+ 213,
10710
+ 133,
10711
+ 152
10712
+ ]
10713
+ },
9878
10714
  {
9879
10715
  name: "EvtCreatePosition",
9880
10716
  discriminator: [
@@ -10245,6 +11081,16 @@ var errors = [
10245
11081
  code: 6039,
10246
11082
  name: "PositionIsNotEmpty",
10247
11083
  msg: "Position is not empty"
11084
+ },
11085
+ {
11086
+ code: 6040,
11087
+ name: "InvalidPoolCreatorAuthority",
11088
+ msg: "Invalid pool creator authority"
11089
+ },
11090
+ {
11091
+ code: 6041,
11092
+ name: "InvalidConfigType",
11093
+ msg: "Invalid config type"
10248
11094
  }
10249
11095
  ];
10250
11096
  var types = [
@@ -10473,6 +11319,13 @@ var types = [
10473
11319
  ],
10474
11320
  type: "u8"
10475
11321
  },
11322
+ {
11323
+ name: "config_type",
11324
+ docs: [
11325
+ "Config type mode, 0 for static, 1 for dynamic"
11326
+ ],
11327
+ type: "u8"
11328
+ },
10476
11329
  {
10477
11330
  name: "_padding_0",
10478
11331
  docs: [
@@ -10481,7 +11334,7 @@ var types = [
10481
11334
  type: {
10482
11335
  array: [
10483
11336
  "u8",
10484
- 6
11337
+ 5
10485
11338
  ]
10486
11339
  }
10487
11340
  },
@@ -10523,45 +11376,13 @@ var types = [
10523
11376
  }
10524
11377
  },
10525
11378
  {
10526
- name: "ConfigParameters",
11379
+ name: "DynamicConfigParameters",
10527
11380
  type: {
10528
11381
  kind: "struct",
10529
11382
  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
11383
  {
10551
11384
  name: "pool_creator_authority",
10552
11385
  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
11386
  }
10566
11387
  ]
10567
11388
  }
@@ -10963,7 +11784,7 @@ var types = [
10963
11784
  {
10964
11785
  name: "EvtCreateConfig",
10965
11786
  docs: [
10966
- "Create config"
11787
+ "Create static config"
10967
11788
  ],
10968
11789
  type: {
10969
11790
  kind: "struct",
@@ -11011,6 +11832,29 @@ var types = [
11011
11832
  ]
11012
11833
  }
11013
11834
  },
11835
+ {
11836
+ name: "EvtCreateDynamicConfig",
11837
+ docs: [
11838
+ "Create dynamic config"
11839
+ ],
11840
+ type: {
11841
+ kind: "struct",
11842
+ fields: [
11843
+ {
11844
+ name: "config",
11845
+ type: "pubkey"
11846
+ },
11847
+ {
11848
+ name: "pool_creator_authority",
11849
+ type: "pubkey"
11850
+ },
11851
+ {
11852
+ name: "index",
11853
+ type: "u64"
11854
+ }
11855
+ ]
11856
+ }
11857
+ },
11014
11858
  {
11015
11859
  name: "EvtCreatePosition",
11016
11860
  type: {
@@ -11616,18 +12460,11 @@ var types = [
11616
12460
  type: "u128"
11617
12461
  },
11618
12462
  {
11619
- name: "token_a_reserve",
11620
- docs: [
11621
- "token a reserve"
11622
- ],
11623
- type: "u64"
11624
- },
11625
- {
11626
- name: "token_b_reserve",
12463
+ name: "_padding",
11627
12464
  docs: [
11628
- "token b reserve"
12465
+ "padding, previous reserve amount, be careful to use that field"
11629
12466
  ],
11630
- type: "u64"
12467
+ type: "u128"
11631
12468
  },
11632
12469
  {
11633
12470
  name: "protocol_a_fee",
@@ -12350,6 +13187,46 @@ var types = [
12350
13187
  ]
12351
13188
  }
12352
13189
  },
13190
+ {
13191
+ name: "StaticConfigParameters",
13192
+ type: {
13193
+ kind: "struct",
13194
+ fields: [
13195
+ {
13196
+ name: "pool_fees",
13197
+ type: {
13198
+ defined: {
13199
+ name: "PoolFeeParameters"
13200
+ }
13201
+ }
13202
+ },
13203
+ {
13204
+ name: "sqrt_min_price",
13205
+ type: "u128"
13206
+ },
13207
+ {
13208
+ name: "sqrt_max_price",
13209
+ type: "u128"
13210
+ },
13211
+ {
13212
+ name: "vault_config_key",
13213
+ type: "pubkey"
13214
+ },
13215
+ {
13216
+ name: "pool_creator_authority",
13217
+ type: "pubkey"
13218
+ },
13219
+ {
13220
+ name: "activation_type",
13221
+ type: "u8"
13222
+ },
13223
+ {
13224
+ name: "collect_fee_mode",
13225
+ type: "u8"
13226
+ }
13227
+ ]
13228
+ }
13229
+ },
12353
13230
  {
12354
13231
  name: "SwapParameters",
12355
13232
  type: {
@@ -12572,4 +13449,4 @@ var CpAmmIDL = {
12572
13449
  types: types
12573
13450
  };
12574
13451
 
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 };
13452
+ 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 };