@meteora-ag/cp-amm-sdk 1.0.12-rc.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +862 -652
- package/dist/index.d.ts +862 -652
- package/dist/index.js +529 -335
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +528 -334
- package/dist/index.mjs.map +1 -1
- package/package.json +42 -40
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var cp_amm_default = {
|
|
|
30
30
|
address: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG",
|
|
31
31
|
metadata: {
|
|
32
32
|
name: "cp_amm",
|
|
33
|
-
version: "0.1.
|
|
33
|
+
version: "0.1.3",
|
|
34
34
|
spec: "0.1.0",
|
|
35
35
|
description: "Created with Anchor"
|
|
36
36
|
},
|
|
@@ -195,29 +195,7 @@ var cp_amm_default = {
|
|
|
195
195
|
accounts: [
|
|
196
196
|
{
|
|
197
197
|
name: "pool_authority",
|
|
198
|
-
|
|
199
|
-
seeds: [
|
|
200
|
-
{
|
|
201
|
-
kind: "const",
|
|
202
|
-
value: [
|
|
203
|
-
112,
|
|
204
|
-
111,
|
|
205
|
-
111,
|
|
206
|
-
108,
|
|
207
|
-
95,
|
|
208
|
-
97,
|
|
209
|
-
117,
|
|
210
|
-
116,
|
|
211
|
-
104,
|
|
212
|
-
111,
|
|
213
|
-
114,
|
|
214
|
-
105,
|
|
215
|
-
116,
|
|
216
|
-
121
|
|
217
|
-
]
|
|
218
|
-
}
|
|
219
|
-
]
|
|
220
|
-
}
|
|
198
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
221
199
|
},
|
|
222
200
|
{
|
|
223
201
|
name: "pool",
|
|
@@ -353,29 +331,7 @@ var cp_amm_default = {
|
|
|
353
331
|
accounts: [
|
|
354
332
|
{
|
|
355
333
|
name: "pool_authority",
|
|
356
|
-
|
|
357
|
-
seeds: [
|
|
358
|
-
{
|
|
359
|
-
kind: "const",
|
|
360
|
-
value: [
|
|
361
|
-
112,
|
|
362
|
-
111,
|
|
363
|
-
111,
|
|
364
|
-
108,
|
|
365
|
-
95,
|
|
366
|
-
97,
|
|
367
|
-
117,
|
|
368
|
-
116,
|
|
369
|
-
104,
|
|
370
|
-
111,
|
|
371
|
-
114,
|
|
372
|
-
105,
|
|
373
|
-
116,
|
|
374
|
-
121
|
|
375
|
-
]
|
|
376
|
-
}
|
|
377
|
-
]
|
|
378
|
-
}
|
|
334
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
379
335
|
},
|
|
380
336
|
{
|
|
381
337
|
name: "pool",
|
|
@@ -514,29 +470,7 @@ var cp_amm_default = {
|
|
|
514
470
|
accounts: [
|
|
515
471
|
{
|
|
516
472
|
name: "pool_authority",
|
|
517
|
-
|
|
518
|
-
seeds: [
|
|
519
|
-
{
|
|
520
|
-
kind: "const",
|
|
521
|
-
value: [
|
|
522
|
-
112,
|
|
523
|
-
111,
|
|
524
|
-
111,
|
|
525
|
-
108,
|
|
526
|
-
95,
|
|
527
|
-
97,
|
|
528
|
-
117,
|
|
529
|
-
116,
|
|
530
|
-
104,
|
|
531
|
-
111,
|
|
532
|
-
114,
|
|
533
|
-
105,
|
|
534
|
-
116,
|
|
535
|
-
121
|
|
536
|
-
]
|
|
537
|
-
}
|
|
538
|
-
]
|
|
539
|
-
}
|
|
473
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
540
474
|
},
|
|
541
475
|
{
|
|
542
476
|
name: "pool",
|
|
@@ -827,7 +761,16 @@ var cp_amm_default = {
|
|
|
827
761
|
name: "program"
|
|
828
762
|
}
|
|
829
763
|
],
|
|
830
|
-
args: [
|
|
764
|
+
args: [
|
|
765
|
+
{
|
|
766
|
+
name: "max_amount_a",
|
|
767
|
+
type: "u64"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: "max_amount_b",
|
|
771
|
+
type: "u64"
|
|
772
|
+
}
|
|
773
|
+
]
|
|
831
774
|
},
|
|
832
775
|
{
|
|
833
776
|
name: "claim_reward",
|
|
@@ -844,29 +787,7 @@ var cp_amm_default = {
|
|
|
844
787
|
accounts: [
|
|
845
788
|
{
|
|
846
789
|
name: "pool_authority",
|
|
847
|
-
|
|
848
|
-
seeds: [
|
|
849
|
-
{
|
|
850
|
-
kind: "const",
|
|
851
|
-
value: [
|
|
852
|
-
112,
|
|
853
|
-
111,
|
|
854
|
-
111,
|
|
855
|
-
108,
|
|
856
|
-
95,
|
|
857
|
-
97,
|
|
858
|
-
117,
|
|
859
|
-
116,
|
|
860
|
-
104,
|
|
861
|
-
111,
|
|
862
|
-
114,
|
|
863
|
-
105,
|
|
864
|
-
116,
|
|
865
|
-
121
|
|
866
|
-
]
|
|
867
|
-
}
|
|
868
|
-
]
|
|
869
|
-
}
|
|
790
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
870
791
|
},
|
|
871
792
|
{
|
|
872
793
|
name: "pool",
|
|
@@ -946,6 +867,10 @@ var cp_amm_default = {
|
|
|
946
867
|
{
|
|
947
868
|
name: "reward_index",
|
|
948
869
|
type: "u8"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
name: "skip_reward",
|
|
873
|
+
type: "u8"
|
|
949
874
|
}
|
|
950
875
|
]
|
|
951
876
|
},
|
|
@@ -1110,15 +1035,40 @@ var cp_amm_default = {
|
|
|
1110
1035
|
},
|
|
1111
1036
|
{
|
|
1112
1037
|
name: "pool_authority",
|
|
1038
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
name: "rent_receiver",
|
|
1042
|
+
writable: true
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
name: "owner",
|
|
1046
|
+
docs: [
|
|
1047
|
+
"Owner of position"
|
|
1048
|
+
],
|
|
1049
|
+
signer: true
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
name: "token_program",
|
|
1053
|
+
docs: [
|
|
1054
|
+
"Program to create NFT mint/token account and transfer for token22 account"
|
|
1055
|
+
],
|
|
1056
|
+
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
name: "event_authority",
|
|
1113
1060
|
pda: {
|
|
1114
1061
|
seeds: [
|
|
1115
1062
|
{
|
|
1116
1063
|
kind: "const",
|
|
1117
1064
|
value: [
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1065
|
+
95,
|
|
1066
|
+
95,
|
|
1067
|
+
101,
|
|
1068
|
+
118,
|
|
1069
|
+
101,
|
|
1070
|
+
110,
|
|
1071
|
+
116,
|
|
1122
1072
|
95,
|
|
1123
1073
|
97,
|
|
1124
1074
|
117,
|
|
@@ -1135,22 +1085,36 @@ var cp_amm_default = {
|
|
|
1135
1085
|
}
|
|
1136
1086
|
},
|
|
1137
1087
|
{
|
|
1138
|
-
name: "
|
|
1088
|
+
name: "program"
|
|
1089
|
+
}
|
|
1090
|
+
],
|
|
1091
|
+
args: []
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
name: "close_token_badge",
|
|
1095
|
+
discriminator: [
|
|
1096
|
+
108,
|
|
1097
|
+
146,
|
|
1098
|
+
86,
|
|
1099
|
+
110,
|
|
1100
|
+
179,
|
|
1101
|
+
254,
|
|
1102
|
+
10,
|
|
1103
|
+
104
|
|
1104
|
+
],
|
|
1105
|
+
accounts: [
|
|
1106
|
+
{
|
|
1107
|
+
name: "token_badge",
|
|
1139
1108
|
writable: true
|
|
1140
1109
|
},
|
|
1141
1110
|
{
|
|
1142
|
-
name: "
|
|
1143
|
-
|
|
1144
|
-
"Owner of position"
|
|
1145
|
-
],
|
|
1111
|
+
name: "admin",
|
|
1112
|
+
writable: true,
|
|
1146
1113
|
signer: true
|
|
1147
1114
|
},
|
|
1148
1115
|
{
|
|
1149
|
-
name: "
|
|
1150
|
-
|
|
1151
|
-
"Program to create NFT mint/token account and transfer for token22 account"
|
|
1152
|
-
],
|
|
1153
|
-
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
1116
|
+
name: "rent_receiver",
|
|
1117
|
+
writable: true
|
|
1154
1118
|
},
|
|
1155
1119
|
{
|
|
1156
1120
|
name: "event_authority",
|
|
@@ -1559,29 +1523,7 @@ var cp_amm_default = {
|
|
|
1559
1523
|
},
|
|
1560
1524
|
{
|
|
1561
1525
|
name: "pool_authority",
|
|
1562
|
-
|
|
1563
|
-
seeds: [
|
|
1564
|
-
{
|
|
1565
|
-
kind: "const",
|
|
1566
|
-
value: [
|
|
1567
|
-
112,
|
|
1568
|
-
111,
|
|
1569
|
-
111,
|
|
1570
|
-
108,
|
|
1571
|
-
95,
|
|
1572
|
-
97,
|
|
1573
|
-
117,
|
|
1574
|
-
116,
|
|
1575
|
-
104,
|
|
1576
|
-
111,
|
|
1577
|
-
114,
|
|
1578
|
-
105,
|
|
1579
|
-
116,
|
|
1580
|
-
121
|
|
1581
|
-
]
|
|
1582
|
-
}
|
|
1583
|
-
]
|
|
1584
|
-
}
|
|
1526
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
1585
1527
|
},
|
|
1586
1528
|
{
|
|
1587
1529
|
name: "payer",
|
|
@@ -1882,29 +1824,7 @@ var cp_amm_default = {
|
|
|
1882
1824
|
},
|
|
1883
1825
|
{
|
|
1884
1826
|
name: "pool_authority",
|
|
1885
|
-
|
|
1886
|
-
seeds: [
|
|
1887
|
-
{
|
|
1888
|
-
kind: "const",
|
|
1889
|
-
value: [
|
|
1890
|
-
112,
|
|
1891
|
-
111,
|
|
1892
|
-
111,
|
|
1893
|
-
108,
|
|
1894
|
-
95,
|
|
1895
|
-
97,
|
|
1896
|
-
117,
|
|
1897
|
-
116,
|
|
1898
|
-
104,
|
|
1899
|
-
111,
|
|
1900
|
-
114,
|
|
1901
|
-
105,
|
|
1902
|
-
116,
|
|
1903
|
-
121
|
|
1904
|
-
]
|
|
1905
|
-
}
|
|
1906
|
-
]
|
|
1907
|
-
}
|
|
1827
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
1908
1828
|
},
|
|
1909
1829
|
{
|
|
1910
1830
|
name: "pool",
|
|
@@ -2184,29 +2104,7 @@ var cp_amm_default = {
|
|
|
2184
2104
|
},
|
|
2185
2105
|
{
|
|
2186
2106
|
name: "pool_authority",
|
|
2187
|
-
|
|
2188
|
-
seeds: [
|
|
2189
|
-
{
|
|
2190
|
-
kind: "const",
|
|
2191
|
-
value: [
|
|
2192
|
-
112,
|
|
2193
|
-
111,
|
|
2194
|
-
111,
|
|
2195
|
-
108,
|
|
2196
|
-
95,
|
|
2197
|
-
97,
|
|
2198
|
-
117,
|
|
2199
|
-
116,
|
|
2200
|
-
104,
|
|
2201
|
-
111,
|
|
2202
|
-
114,
|
|
2203
|
-
105,
|
|
2204
|
-
116,
|
|
2205
|
-
121
|
|
2206
|
-
]
|
|
2207
|
-
}
|
|
2208
|
-
]
|
|
2209
|
-
}
|
|
2107
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
2210
2108
|
},
|
|
2211
2109
|
{
|
|
2212
2110
|
name: "pool",
|
|
@@ -2490,29 +2388,7 @@ var cp_amm_default = {
|
|
|
2490
2388
|
},
|
|
2491
2389
|
{
|
|
2492
2390
|
name: "pool_authority",
|
|
2493
|
-
|
|
2494
|
-
seeds: [
|
|
2495
|
-
{
|
|
2496
|
-
kind: "const",
|
|
2497
|
-
value: [
|
|
2498
|
-
112,
|
|
2499
|
-
111,
|
|
2500
|
-
111,
|
|
2501
|
-
108,
|
|
2502
|
-
95,
|
|
2503
|
-
97,
|
|
2504
|
-
117,
|
|
2505
|
-
116,
|
|
2506
|
-
104,
|
|
2507
|
-
111,
|
|
2508
|
-
114,
|
|
2509
|
-
105,
|
|
2510
|
-
116,
|
|
2511
|
-
121
|
|
2512
|
-
]
|
|
2513
|
-
}
|
|
2514
|
-
]
|
|
2515
|
-
}
|
|
2391
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
2516
2392
|
},
|
|
2517
2393
|
{
|
|
2518
2394
|
name: "pool",
|
|
@@ -2724,29 +2600,7 @@ var cp_amm_default = {
|
|
|
2724
2600
|
accounts: [
|
|
2725
2601
|
{
|
|
2726
2602
|
name: "pool_authority",
|
|
2727
|
-
|
|
2728
|
-
seeds: [
|
|
2729
|
-
{
|
|
2730
|
-
kind: "const",
|
|
2731
|
-
value: [
|
|
2732
|
-
112,
|
|
2733
|
-
111,
|
|
2734
|
-
111,
|
|
2735
|
-
108,
|
|
2736
|
-
95,
|
|
2737
|
-
97,
|
|
2738
|
-
117,
|
|
2739
|
-
116,
|
|
2740
|
-
104,
|
|
2741
|
-
111,
|
|
2742
|
-
114,
|
|
2743
|
-
105,
|
|
2744
|
-
116,
|
|
2745
|
-
121
|
|
2746
|
-
]
|
|
2747
|
-
}
|
|
2748
|
-
]
|
|
2749
|
-
}
|
|
2603
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
2750
2604
|
},
|
|
2751
2605
|
{
|
|
2752
2606
|
name: "pool",
|
|
@@ -2789,7 +2643,11 @@ var cp_amm_default = {
|
|
|
2789
2643
|
name: "reward_mint"
|
|
2790
2644
|
},
|
|
2791
2645
|
{
|
|
2792
|
-
name: "
|
|
2646
|
+
name: "signer",
|
|
2647
|
+
signer: true
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
name: "payer",
|
|
2793
2651
|
writable: true,
|
|
2794
2652
|
signer: true
|
|
2795
2653
|
},
|
|
@@ -3069,29 +2927,7 @@ var cp_amm_default = {
|
|
|
3069
2927
|
accounts: [
|
|
3070
2928
|
{
|
|
3071
2929
|
name: "pool_authority",
|
|
3072
|
-
|
|
3073
|
-
seeds: [
|
|
3074
|
-
{
|
|
3075
|
-
kind: "const",
|
|
3076
|
-
value: [
|
|
3077
|
-
112,
|
|
3078
|
-
111,
|
|
3079
|
-
111,
|
|
3080
|
-
108,
|
|
3081
|
-
95,
|
|
3082
|
-
97,
|
|
3083
|
-
117,
|
|
3084
|
-
116,
|
|
3085
|
-
104,
|
|
3086
|
-
111,
|
|
3087
|
-
114,
|
|
3088
|
-
105,
|
|
3089
|
-
116,
|
|
3090
|
-
121
|
|
3091
|
-
]
|
|
3092
|
-
}
|
|
3093
|
-
]
|
|
3094
|
-
}
|
|
2930
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
3095
2931
|
},
|
|
3096
2932
|
{
|
|
3097
2933
|
name: "pool",
|
|
@@ -3240,29 +3076,7 @@ var cp_amm_default = {
|
|
|
3240
3076
|
accounts: [
|
|
3241
3077
|
{
|
|
3242
3078
|
name: "pool_authority",
|
|
3243
|
-
|
|
3244
|
-
seeds: [
|
|
3245
|
-
{
|
|
3246
|
-
kind: "const",
|
|
3247
|
-
value: [
|
|
3248
|
-
112,
|
|
3249
|
-
111,
|
|
3250
|
-
111,
|
|
3251
|
-
108,
|
|
3252
|
-
95,
|
|
3253
|
-
97,
|
|
3254
|
-
117,
|
|
3255
|
-
116,
|
|
3256
|
-
104,
|
|
3257
|
-
111,
|
|
3258
|
-
114,
|
|
3259
|
-
105,
|
|
3260
|
-
116,
|
|
3261
|
-
121
|
|
3262
|
-
]
|
|
3263
|
-
}
|
|
3264
|
-
]
|
|
3265
|
-
}
|
|
3079
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
3266
3080
|
},
|
|
3267
3081
|
{
|
|
3268
3082
|
name: "pool",
|
|
@@ -3458,29 +3272,80 @@ var cp_amm_default = {
|
|
|
3458
3272
|
]
|
|
3459
3273
|
},
|
|
3460
3274
|
{
|
|
3461
|
-
name: "
|
|
3275
|
+
name: "split_position",
|
|
3462
3276
|
discriminator: [
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3277
|
+
172,
|
|
3278
|
+
241,
|
|
3279
|
+
221,
|
|
3280
|
+
138,
|
|
3281
|
+
161,
|
|
3282
|
+
29,
|
|
3283
|
+
253,
|
|
3284
|
+
42
|
|
3471
3285
|
],
|
|
3472
3286
|
accounts: [
|
|
3473
3287
|
{
|
|
3474
|
-
name: "
|
|
3288
|
+
name: "pool",
|
|
3289
|
+
writable: true,
|
|
3290
|
+
relations: [
|
|
3291
|
+
"first_position",
|
|
3292
|
+
"second_position"
|
|
3293
|
+
]
|
|
3294
|
+
},
|
|
3295
|
+
{
|
|
3296
|
+
name: "first_position",
|
|
3297
|
+
docs: [
|
|
3298
|
+
"The first position"
|
|
3299
|
+
],
|
|
3300
|
+
writable: true
|
|
3301
|
+
},
|
|
3302
|
+
{
|
|
3303
|
+
name: "first_position_nft_account",
|
|
3304
|
+
docs: [
|
|
3305
|
+
"The token account for position nft"
|
|
3306
|
+
]
|
|
3307
|
+
},
|
|
3308
|
+
{
|
|
3309
|
+
name: "second_position",
|
|
3310
|
+
docs: [
|
|
3311
|
+
"The second position"
|
|
3312
|
+
],
|
|
3313
|
+
writable: true
|
|
3314
|
+
},
|
|
3315
|
+
{
|
|
3316
|
+
name: "second_position_nft_account",
|
|
3317
|
+
docs: [
|
|
3318
|
+
"The token account for position nft"
|
|
3319
|
+
]
|
|
3320
|
+
},
|
|
3321
|
+
{
|
|
3322
|
+
name: "first_owner",
|
|
3323
|
+
docs: [
|
|
3324
|
+
"Owner of first position"
|
|
3325
|
+
],
|
|
3326
|
+
signer: true
|
|
3327
|
+
},
|
|
3328
|
+
{
|
|
3329
|
+
name: "second_owner",
|
|
3330
|
+
docs: [
|
|
3331
|
+
"Owner of second position"
|
|
3332
|
+
],
|
|
3333
|
+
signer: true
|
|
3334
|
+
},
|
|
3335
|
+
{
|
|
3336
|
+
name: "event_authority",
|
|
3475
3337
|
pda: {
|
|
3476
3338
|
seeds: [
|
|
3477
3339
|
{
|
|
3478
3340
|
kind: "const",
|
|
3479
3341
|
value: [
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3342
|
+
95,
|
|
3343
|
+
95,
|
|
3344
|
+
101,
|
|
3345
|
+
118,
|
|
3346
|
+
101,
|
|
3347
|
+
110,
|
|
3348
|
+
116,
|
|
3484
3349
|
95,
|
|
3485
3350
|
97,
|
|
3486
3351
|
117,
|
|
@@ -3496,6 +3361,38 @@ var cp_amm_default = {
|
|
|
3496
3361
|
]
|
|
3497
3362
|
}
|
|
3498
3363
|
},
|
|
3364
|
+
{
|
|
3365
|
+
name: "program"
|
|
3366
|
+
}
|
|
3367
|
+
],
|
|
3368
|
+
args: [
|
|
3369
|
+
{
|
|
3370
|
+
name: "params",
|
|
3371
|
+
type: {
|
|
3372
|
+
defined: {
|
|
3373
|
+
name: "SplitPositionParameters"
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
]
|
|
3378
|
+
},
|
|
3379
|
+
{
|
|
3380
|
+
name: "swap",
|
|
3381
|
+
discriminator: [
|
|
3382
|
+
248,
|
|
3383
|
+
198,
|
|
3384
|
+
158,
|
|
3385
|
+
145,
|
|
3386
|
+
225,
|
|
3387
|
+
117,
|
|
3388
|
+
135,
|
|
3389
|
+
200
|
|
3390
|
+
],
|
|
3391
|
+
accounts: [
|
|
3392
|
+
{
|
|
3393
|
+
name: "pool_authority",
|
|
3394
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
3395
|
+
},
|
|
3499
3396
|
{
|
|
3500
3397
|
name: "pool",
|
|
3501
3398
|
docs: [
|
|
@@ -3638,7 +3535,7 @@ var cp_amm_default = {
|
|
|
3638
3535
|
writable: true
|
|
3639
3536
|
},
|
|
3640
3537
|
{
|
|
3641
|
-
name: "
|
|
3538
|
+
name: "signer",
|
|
3642
3539
|
signer: true
|
|
3643
3540
|
},
|
|
3644
3541
|
{
|
|
@@ -3703,7 +3600,7 @@ var cp_amm_default = {
|
|
|
3703
3600
|
writable: true
|
|
3704
3601
|
},
|
|
3705
3602
|
{
|
|
3706
|
-
name: "
|
|
3603
|
+
name: "signer",
|
|
3707
3604
|
signer: true
|
|
3708
3605
|
},
|
|
3709
3606
|
{
|
|
@@ -3765,29 +3662,7 @@ var cp_amm_default = {
|
|
|
3765
3662
|
accounts: [
|
|
3766
3663
|
{
|
|
3767
3664
|
name: "pool_authority",
|
|
3768
|
-
|
|
3769
|
-
seeds: [
|
|
3770
|
-
{
|
|
3771
|
-
kind: "const",
|
|
3772
|
-
value: [
|
|
3773
|
-
112,
|
|
3774
|
-
111,
|
|
3775
|
-
111,
|
|
3776
|
-
108,
|
|
3777
|
-
95,
|
|
3778
|
-
97,
|
|
3779
|
-
117,
|
|
3780
|
-
116,
|
|
3781
|
-
104,
|
|
3782
|
-
111,
|
|
3783
|
-
114,
|
|
3784
|
-
105,
|
|
3785
|
-
116,
|
|
3786
|
-
121
|
|
3787
|
-
]
|
|
3788
|
-
}
|
|
3789
|
-
]
|
|
3790
|
-
}
|
|
3665
|
+
address: "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC"
|
|
3791
3666
|
},
|
|
3792
3667
|
{
|
|
3793
3668
|
name: "pool",
|
|
@@ -4193,6 +4068,19 @@ var cp_amm_default = {
|
|
|
4193
4068
|
146
|
|
4194
4069
|
]
|
|
4195
4070
|
},
|
|
4071
|
+
{
|
|
4072
|
+
name: "EvtSplitPosition",
|
|
4073
|
+
discriminator: [
|
|
4074
|
+
182,
|
|
4075
|
+
138,
|
|
4076
|
+
42,
|
|
4077
|
+
254,
|
|
4078
|
+
27,
|
|
4079
|
+
94,
|
|
4080
|
+
82,
|
|
4081
|
+
221
|
|
4082
|
+
]
|
|
4083
|
+
},
|
|
4196
4084
|
{
|
|
4197
4085
|
name: "EvtSwap",
|
|
4198
4086
|
discriminator: [
|
|
@@ -4456,6 +4344,31 @@ var cp_amm_default = {
|
|
|
4456
4344
|
code: 6041,
|
|
4457
4345
|
name: "InvalidConfigType",
|
|
4458
4346
|
msg: "Invalid config type"
|
|
4347
|
+
},
|
|
4348
|
+
{
|
|
4349
|
+
code: 6042,
|
|
4350
|
+
name: "InvalidPoolCreator",
|
|
4351
|
+
msg: "Invalid pool creator"
|
|
4352
|
+
},
|
|
4353
|
+
{
|
|
4354
|
+
code: 6043,
|
|
4355
|
+
name: "RewardVaultFrozenSkipRequired",
|
|
4356
|
+
msg: "Reward vault is frozen, must skip reward to proceed"
|
|
4357
|
+
},
|
|
4358
|
+
{
|
|
4359
|
+
code: 6044,
|
|
4360
|
+
name: "InvalidSplitPositionParameters",
|
|
4361
|
+
msg: "Invalid parameters for split position"
|
|
4362
|
+
},
|
|
4363
|
+
{
|
|
4364
|
+
code: 6045,
|
|
4365
|
+
name: "UnsupportPositionHasVestingLock",
|
|
4366
|
+
msg: "Unsupported split position has vesting lock"
|
|
4367
|
+
},
|
|
4368
|
+
{
|
|
4369
|
+
code: 6046,
|
|
4370
|
+
name: "SamePosition",
|
|
4371
|
+
msg: "Same position"
|
|
4459
4372
|
}
|
|
4460
4373
|
],
|
|
4461
4374
|
types: [
|
|
@@ -5287,6 +5200,18 @@ var cp_amm_default = {
|
|
|
5287
5200
|
{
|
|
5288
5201
|
name: "transfer_fee_excluded_amount_in",
|
|
5289
5202
|
type: "u64"
|
|
5203
|
+
},
|
|
5204
|
+
{
|
|
5205
|
+
name: "reward_duration_end",
|
|
5206
|
+
type: "u64"
|
|
5207
|
+
},
|
|
5208
|
+
{
|
|
5209
|
+
name: "pre_reward_rate",
|
|
5210
|
+
type: "u128"
|
|
5211
|
+
},
|
|
5212
|
+
{
|
|
5213
|
+
name: "post_reward_rate",
|
|
5214
|
+
type: "u128"
|
|
5290
5215
|
}
|
|
5291
5216
|
]
|
|
5292
5217
|
}
|
|
@@ -5404,6 +5329,10 @@ var cp_amm_default = {
|
|
|
5404
5329
|
name: "funder",
|
|
5405
5330
|
type: "pubkey"
|
|
5406
5331
|
},
|
|
5332
|
+
{
|
|
5333
|
+
name: "creator",
|
|
5334
|
+
type: "pubkey"
|
|
5335
|
+
},
|
|
5407
5336
|
{
|
|
5408
5337
|
name: "reward_index",
|
|
5409
5338
|
type: "u8"
|
|
@@ -5535,6 +5464,70 @@ var cp_amm_default = {
|
|
|
5535
5464
|
]
|
|
5536
5465
|
}
|
|
5537
5466
|
},
|
|
5467
|
+
{
|
|
5468
|
+
name: "EvtSplitPosition",
|
|
5469
|
+
type: {
|
|
5470
|
+
kind: "struct",
|
|
5471
|
+
fields: [
|
|
5472
|
+
{
|
|
5473
|
+
name: "pool",
|
|
5474
|
+
type: "pubkey"
|
|
5475
|
+
},
|
|
5476
|
+
{
|
|
5477
|
+
name: "first_owner",
|
|
5478
|
+
type: "pubkey"
|
|
5479
|
+
},
|
|
5480
|
+
{
|
|
5481
|
+
name: "second_owner",
|
|
5482
|
+
type: "pubkey"
|
|
5483
|
+
},
|
|
5484
|
+
{
|
|
5485
|
+
name: "first_position",
|
|
5486
|
+
type: "pubkey"
|
|
5487
|
+
},
|
|
5488
|
+
{
|
|
5489
|
+
name: "second_position",
|
|
5490
|
+
type: "pubkey"
|
|
5491
|
+
},
|
|
5492
|
+
{
|
|
5493
|
+
name: "current_sqrt_price",
|
|
5494
|
+
type: "u128"
|
|
5495
|
+
},
|
|
5496
|
+
{
|
|
5497
|
+
name: "amount_splits",
|
|
5498
|
+
type: {
|
|
5499
|
+
defined: {
|
|
5500
|
+
name: "SplitAmountInfo"
|
|
5501
|
+
}
|
|
5502
|
+
}
|
|
5503
|
+
},
|
|
5504
|
+
{
|
|
5505
|
+
name: "first_position_info",
|
|
5506
|
+
type: {
|
|
5507
|
+
defined: {
|
|
5508
|
+
name: "SplitPositionInfo"
|
|
5509
|
+
}
|
|
5510
|
+
}
|
|
5511
|
+
},
|
|
5512
|
+
{
|
|
5513
|
+
name: "second_position_info",
|
|
5514
|
+
type: {
|
|
5515
|
+
defined: {
|
|
5516
|
+
name: "SplitPositionInfo"
|
|
5517
|
+
}
|
|
5518
|
+
}
|
|
5519
|
+
},
|
|
5520
|
+
{
|
|
5521
|
+
name: "split_position_parameters",
|
|
5522
|
+
type: {
|
|
5523
|
+
defined: {
|
|
5524
|
+
name: "SplitPositionParameters"
|
|
5525
|
+
}
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
]
|
|
5529
|
+
}
|
|
5530
|
+
},
|
|
5538
5531
|
{
|
|
5539
5532
|
name: "EvtSwap",
|
|
5540
5533
|
type: {
|
|
@@ -5980,6 +5973,13 @@ var cp_amm_default = {
|
|
|
5980
5973
|
}
|
|
5981
5974
|
}
|
|
5982
5975
|
},
|
|
5976
|
+
{
|
|
5977
|
+
name: "creator",
|
|
5978
|
+
docs: [
|
|
5979
|
+
"pool creator"
|
|
5980
|
+
],
|
|
5981
|
+
type: "pubkey"
|
|
5982
|
+
},
|
|
5983
5983
|
{
|
|
5984
5984
|
name: "_padding_1",
|
|
5985
5985
|
docs: [
|
|
@@ -5988,7 +5988,7 @@ var cp_amm_default = {
|
|
|
5988
5988
|
type: {
|
|
5989
5989
|
array: [
|
|
5990
5990
|
"u64",
|
|
5991
|
-
|
|
5991
|
+
6
|
|
5992
5992
|
]
|
|
5993
5993
|
}
|
|
5994
5994
|
},
|
|
@@ -6031,25 +6031,16 @@ var cp_amm_default = {
|
|
|
6031
6031
|
}
|
|
6032
6032
|
},
|
|
6033
6033
|
{
|
|
6034
|
-
name: "
|
|
6035
|
-
docs: [
|
|
6036
|
-
"Protocol trade fee percent"
|
|
6037
|
-
],
|
|
6038
|
-
type: "u8"
|
|
6039
|
-
},
|
|
6040
|
-
{
|
|
6041
|
-
name: "partner_fee_percent",
|
|
6042
|
-
docs: [
|
|
6043
|
-
"partner fee percent"
|
|
6044
|
-
],
|
|
6045
|
-
type: "u8"
|
|
6046
|
-
},
|
|
6047
|
-
{
|
|
6048
|
-
name: "referral_fee_percent",
|
|
6034
|
+
name: "padding",
|
|
6049
6035
|
docs: [
|
|
6050
|
-
"
|
|
6036
|
+
"padding"
|
|
6051
6037
|
],
|
|
6052
|
-
type:
|
|
6038
|
+
type: {
|
|
6039
|
+
array: [
|
|
6040
|
+
"u8",
|
|
6041
|
+
3
|
|
6042
|
+
]
|
|
6043
|
+
}
|
|
6053
6044
|
},
|
|
6054
6045
|
{
|
|
6055
6046
|
name: "dynamic_fee",
|
|
@@ -6552,6 +6543,128 @@ var cp_amm_default = {
|
|
|
6552
6543
|
]
|
|
6553
6544
|
}
|
|
6554
6545
|
},
|
|
6546
|
+
{
|
|
6547
|
+
name: "SplitAmountInfo",
|
|
6548
|
+
type: {
|
|
6549
|
+
kind: "struct",
|
|
6550
|
+
fields: [
|
|
6551
|
+
{
|
|
6552
|
+
name: "permanent_locked_liquidity",
|
|
6553
|
+
type: "u128"
|
|
6554
|
+
},
|
|
6555
|
+
{
|
|
6556
|
+
name: "unlocked_liquidity",
|
|
6557
|
+
type: "u128"
|
|
6558
|
+
},
|
|
6559
|
+
{
|
|
6560
|
+
name: "fee_a",
|
|
6561
|
+
type: "u64"
|
|
6562
|
+
},
|
|
6563
|
+
{
|
|
6564
|
+
name: "fee_b",
|
|
6565
|
+
type: "u64"
|
|
6566
|
+
},
|
|
6567
|
+
{
|
|
6568
|
+
name: "reward_0",
|
|
6569
|
+
type: "u64"
|
|
6570
|
+
},
|
|
6571
|
+
{
|
|
6572
|
+
name: "reward_1",
|
|
6573
|
+
type: "u64"
|
|
6574
|
+
}
|
|
6575
|
+
]
|
|
6576
|
+
}
|
|
6577
|
+
},
|
|
6578
|
+
{
|
|
6579
|
+
name: "SplitPositionInfo",
|
|
6580
|
+
type: {
|
|
6581
|
+
kind: "struct",
|
|
6582
|
+
fields: [
|
|
6583
|
+
{
|
|
6584
|
+
name: "liquidity",
|
|
6585
|
+
type: "u128"
|
|
6586
|
+
},
|
|
6587
|
+
{
|
|
6588
|
+
name: "fee_a",
|
|
6589
|
+
type: "u64"
|
|
6590
|
+
},
|
|
6591
|
+
{
|
|
6592
|
+
name: "fee_b",
|
|
6593
|
+
type: "u64"
|
|
6594
|
+
},
|
|
6595
|
+
{
|
|
6596
|
+
name: "reward_0",
|
|
6597
|
+
type: "u64"
|
|
6598
|
+
},
|
|
6599
|
+
{
|
|
6600
|
+
name: "reward_1",
|
|
6601
|
+
type: "u64"
|
|
6602
|
+
}
|
|
6603
|
+
]
|
|
6604
|
+
}
|
|
6605
|
+
},
|
|
6606
|
+
{
|
|
6607
|
+
name: "SplitPositionParameters",
|
|
6608
|
+
type: {
|
|
6609
|
+
kind: "struct",
|
|
6610
|
+
fields: [
|
|
6611
|
+
{
|
|
6612
|
+
name: "unlocked_liquidity_percentage",
|
|
6613
|
+
docs: [
|
|
6614
|
+
"Percentage of unlocked liquidity to split to the second position"
|
|
6615
|
+
],
|
|
6616
|
+
type: "u8"
|
|
6617
|
+
},
|
|
6618
|
+
{
|
|
6619
|
+
name: "permanent_locked_liquidity_percentage",
|
|
6620
|
+
docs: [
|
|
6621
|
+
"Percentage of permanent locked liquidity to split to the second position"
|
|
6622
|
+
],
|
|
6623
|
+
type: "u8"
|
|
6624
|
+
},
|
|
6625
|
+
{
|
|
6626
|
+
name: "fee_a_percentage",
|
|
6627
|
+
docs: [
|
|
6628
|
+
"Percentage of fee A pending to split to the second position"
|
|
6629
|
+
],
|
|
6630
|
+
type: "u8"
|
|
6631
|
+
},
|
|
6632
|
+
{
|
|
6633
|
+
name: "fee_b_percentage",
|
|
6634
|
+
docs: [
|
|
6635
|
+
"Percentage of fee B pending to split to the second position"
|
|
6636
|
+
],
|
|
6637
|
+
type: "u8"
|
|
6638
|
+
},
|
|
6639
|
+
{
|
|
6640
|
+
name: "reward_0_percentage",
|
|
6641
|
+
docs: [
|
|
6642
|
+
"Percentage of reward 0 pending to split to the second position"
|
|
6643
|
+
],
|
|
6644
|
+
type: "u8"
|
|
6645
|
+
},
|
|
6646
|
+
{
|
|
6647
|
+
name: "reward_1_percentage",
|
|
6648
|
+
docs: [
|
|
6649
|
+
"Percentage of reward 1 pending to split to the second position"
|
|
6650
|
+
],
|
|
6651
|
+
type: "u8"
|
|
6652
|
+
},
|
|
6653
|
+
{
|
|
6654
|
+
name: "padding",
|
|
6655
|
+
docs: [
|
|
6656
|
+
"padding for future"
|
|
6657
|
+
],
|
|
6658
|
+
type: {
|
|
6659
|
+
array: [
|
|
6660
|
+
"u8",
|
|
6661
|
+
16
|
|
6662
|
+
]
|
|
6663
|
+
}
|
|
6664
|
+
}
|
|
6665
|
+
]
|
|
6666
|
+
}
|
|
6667
|
+
},
|
|
6555
6668
|
{
|
|
6556
6669
|
name: "StaticConfigParameters",
|
|
6557
6670
|
type: {
|
|
@@ -7736,13 +7849,41 @@ var getMinAmountWithSlippage = (amount, rate) => {
|
|
|
7736
7849
|
const slippage = (100 - rate) / 100 * BASIS_POINT_MAX;
|
|
7737
7850
|
return amount.mul(new (0, _anchor.BN)(slippage)).div(new (0, _anchor.BN)(BASIS_POINT_MAX));
|
|
7738
7851
|
};
|
|
7739
|
-
var getPriceImpact = (
|
|
7852
|
+
var getPriceImpact = (amountIn, amountOut, currentSqrtPrice, aToB, tokenADecimal, tokenBDecimal) => {
|
|
7853
|
+
if (amountIn.eq(new (0, _anchor.BN)(0))) {
|
|
7854
|
+
return new (0, _decimaljs2.default)(0);
|
|
7855
|
+
}
|
|
7856
|
+
if (amountOut.eq(new (0, _anchor.BN)(0))) {
|
|
7857
|
+
throw new Error("Amount out must be greater than 0");
|
|
7858
|
+
}
|
|
7859
|
+
const spotPrice = getPriceFromSqrtPrice(
|
|
7860
|
+
currentSqrtPrice,
|
|
7861
|
+
tokenADecimal,
|
|
7862
|
+
tokenBDecimal
|
|
7863
|
+
);
|
|
7864
|
+
const executionPrice = new (0, _decimaljs2.default)(amountIn.toString()).div(new (0, _decimaljs2.default)(amountOut.toString())).mul(
|
|
7865
|
+
_decimaljs2.default.pow(
|
|
7866
|
+
10,
|
|
7867
|
+
aToB ? tokenBDecimal - tokenADecimal : tokenADecimal - tokenBDecimal
|
|
7868
|
+
)
|
|
7869
|
+
);
|
|
7870
|
+
let priceImpact;
|
|
7871
|
+
let actualExecutionPrice;
|
|
7872
|
+
if (aToB) {
|
|
7873
|
+
actualExecutionPrice = new (0, _decimaljs2.default)(1).div(executionPrice);
|
|
7874
|
+
} else {
|
|
7875
|
+
actualExecutionPrice = executionPrice;
|
|
7876
|
+
}
|
|
7877
|
+
priceImpact = actualExecutionPrice.sub(spotPrice).abs().div(spotPrice).mul(100);
|
|
7878
|
+
return priceImpact;
|
|
7879
|
+
};
|
|
7880
|
+
var getPriceChange = (nextSqrtPrice, currentSqrtPrice) => {
|
|
7740
7881
|
const diff = nextSqrtPrice.pow(new (0, _anchor.BN)(2)).sub(currentSqrtPrice.pow(new (0, _anchor.BN)(2))).abs();
|
|
7741
7882
|
return new (0, _decimaljs2.default)(diff.toString()).div(new (0, _decimaljs2.default)(currentSqrtPrice.pow(new (0, _anchor.BN)(2)).toString())).mul(100).toNumber();
|
|
7742
7883
|
};
|
|
7743
7884
|
var getPriceFromSqrtPrice = (sqrtPrice, tokenADecimal, tokenBDecimal) => {
|
|
7744
7885
|
const decimalSqrtPrice = new (0, _decimaljs2.default)(sqrtPrice.toString());
|
|
7745
|
-
const price = decimalSqrtPrice.mul(decimalSqrtPrice).mul(new (0, _decimaljs2.default)(__pow(10, tokenADecimal - tokenBDecimal))).div(_decimaljs2.default.pow(2, 128))
|
|
7886
|
+
const price = decimalSqrtPrice.mul(decimalSqrtPrice).mul(new (0, _decimaljs2.default)(__pow(10, tokenADecimal - tokenBDecimal))).div(_decimaljs2.default.pow(2, 128));
|
|
7746
7887
|
return price;
|
|
7747
7888
|
};
|
|
7748
7889
|
var getSqrtPriceFromPrice = (price, tokenADecimal, tokenBDecimal) => {
|
|
@@ -8724,7 +8865,14 @@ var CpAmm = class {
|
|
|
8724
8865
|
swapOutAmount: actualAmountOut,
|
|
8725
8866
|
minSwapOutAmount,
|
|
8726
8867
|
totalFee,
|
|
8727
|
-
priceImpact: getPriceImpact(
|
|
8868
|
+
priceImpact: getPriceImpact(
|
|
8869
|
+
actualAmountIn,
|
|
8870
|
+
actualAmountOut,
|
|
8871
|
+
sqrtPriceQ64,
|
|
8872
|
+
aToB,
|
|
8873
|
+
params.tokenADecimal,
|
|
8874
|
+
params.tokenBDecimal
|
|
8875
|
+
)
|
|
8728
8876
|
};
|
|
8729
8877
|
}
|
|
8730
8878
|
/**
|
|
@@ -8785,7 +8933,15 @@ var CpAmm = class {
|
|
|
8785
8933
|
const maxInputAmount = new (0, _anchor.BN)(
|
|
8786
8934
|
Math.ceil(actualInputAmount.toNumber() * (1 + slippage / 100))
|
|
8787
8935
|
);
|
|
8788
|
-
const priceImpact = getPriceImpact(
|
|
8936
|
+
const priceImpact = getPriceImpact(
|
|
8937
|
+
actualInputAmount,
|
|
8938
|
+
actualAmountOut,
|
|
8939
|
+
sqrtPriceQ64,
|
|
8940
|
+
!bToA,
|
|
8941
|
+
// aToB is the opposite of bToA
|
|
8942
|
+
params.tokenADecimal,
|
|
8943
|
+
params.tokenBDecimal
|
|
8944
|
+
).toNumber();
|
|
8789
8945
|
return {
|
|
8790
8946
|
swapResult,
|
|
8791
8947
|
inputAmount: actualInputAmount,
|
|
@@ -9993,7 +10149,7 @@ var CpAmm = class {
|
|
|
9993
10149
|
const { pool, admin, rewardIndex, newDuration } = params;
|
|
9994
10150
|
return yield this._program.methods.updateRewardDuration(rewardIndex, newDuration).accountsPartial({
|
|
9995
10151
|
pool,
|
|
9996
|
-
admin
|
|
10152
|
+
signer: admin
|
|
9997
10153
|
}).transaction();
|
|
9998
10154
|
});
|
|
9999
10155
|
}
|
|
@@ -10007,7 +10163,7 @@ var CpAmm = class {
|
|
|
10007
10163
|
const { pool, admin, rewardIndex, newFunder } = params;
|
|
10008
10164
|
return yield this._program.methods.updateRewardFunder(rewardIndex, newFunder).accountsPartial({
|
|
10009
10165
|
pool,
|
|
10010
|
-
admin
|
|
10166
|
+
signer: admin
|
|
10011
10167
|
}).transaction();
|
|
10012
10168
|
});
|
|
10013
10169
|
}
|
|
@@ -10284,6 +10440,7 @@ var CpAmm = class {
|
|
|
10284
10440
|
position,
|
|
10285
10441
|
positionNftAccount,
|
|
10286
10442
|
rewardIndex,
|
|
10443
|
+
skipReward,
|
|
10287
10444
|
poolState,
|
|
10288
10445
|
positionState
|
|
10289
10446
|
} = params;
|
|
@@ -10304,7 +10461,7 @@ var CpAmm = class {
|
|
|
10304
10461
|
const closeWrappedSOLIx = yield unwrapSOLInstruction(user);
|
|
10305
10462
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
10306
10463
|
}
|
|
10307
|
-
return yield this._program.methods.claimReward(rewardIndex).accountsPartial({
|
|
10464
|
+
return yield this._program.methods.claimReward(rewardIndex, skipReward).accountsPartial({
|
|
10308
10465
|
pool: positionState.pool,
|
|
10309
10466
|
positionNftAccount,
|
|
10310
10467
|
rewardVault: rewardInfo.vault,
|
|
@@ -10317,6 +10474,42 @@ var CpAmm = class {
|
|
|
10317
10474
|
}).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
10318
10475
|
});
|
|
10319
10476
|
}
|
|
10477
|
+
splitPosition(params) {
|
|
10478
|
+
return __async(this, null, function* () {
|
|
10479
|
+
const {
|
|
10480
|
+
firstPositionOwner,
|
|
10481
|
+
secondPositionOwner,
|
|
10482
|
+
pool,
|
|
10483
|
+
firstPosition,
|
|
10484
|
+
firstPositionNftAccount,
|
|
10485
|
+
secondPosition,
|
|
10486
|
+
secondPositionNftAccount,
|
|
10487
|
+
permanentLockedLiquidityPercentage,
|
|
10488
|
+
unlockedLiquidityPercentage,
|
|
10489
|
+
feeAPercentage,
|
|
10490
|
+
feeBPercentage,
|
|
10491
|
+
reward0Percentage,
|
|
10492
|
+
reward1Percentage
|
|
10493
|
+
} = params;
|
|
10494
|
+
return yield this._program.methods.splitPosition({
|
|
10495
|
+
permanentLockedLiquidityPercentage,
|
|
10496
|
+
unlockedLiquidityPercentage,
|
|
10497
|
+
feeAPercentage,
|
|
10498
|
+
feeBPercentage,
|
|
10499
|
+
reward0Percentage,
|
|
10500
|
+
reward1Percentage,
|
|
10501
|
+
padding: new Array(16).fill(0)
|
|
10502
|
+
}).accountsPartial({
|
|
10503
|
+
pool,
|
|
10504
|
+
firstPosition,
|
|
10505
|
+
firstPositionNftAccount,
|
|
10506
|
+
secondPosition,
|
|
10507
|
+
secondPositionNftAccount,
|
|
10508
|
+
firstOwner: firstPositionOwner,
|
|
10509
|
+
secondOwner: secondPositionOwner
|
|
10510
|
+
}).transaction();
|
|
10511
|
+
});
|
|
10512
|
+
}
|
|
10320
10513
|
};
|
|
10321
10514
|
|
|
10322
10515
|
// src/index.ts
|
|
@@ -10407,5 +10600,6 @@ var index_default = cp_amm_default;
|
|
|
10407
10600
|
|
|
10408
10601
|
|
|
10409
10602
|
|
|
10410
|
-
|
|
10603
|
+
|
|
10604
|
+
exports.ActivationPoint = ActivationPoint; exports.ActivationType = ActivationType; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_STEP_BPS_DEFAULT = BIN_STEP_BPS_DEFAULT; exports.BIN_STEP_BPS_U128_DEFAULT = BIN_STEP_BPS_U128_DEFAULT; exports.CP_AMM_PROGRAM_ID = CP_AMM_PROGRAM_ID; exports.CollectFeeMode = CollectFeeMode; exports.CpAmm = CpAmm; exports.DYNAMIC_FEE_DECAY_PERIOD_DEFAULT = DYNAMIC_FEE_DECAY_PERIOD_DEFAULT; exports.DYNAMIC_FEE_FILTER_PERIOD_DEFAULT = DYNAMIC_FEE_FILTER_PERIOD_DEFAULT; exports.DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT = DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT; exports.FEE_DENOMINATOR = FEE_DENOMINATOR; exports.FeeSchedulerMode = FeeSchedulerMode; exports.LIQUIDITY_SCALE = LIQUIDITY_SCALE; exports.MAX_CU_BUFFER = MAX_CU_BUFFER; exports.MAX_FEE_NUMERATOR = MAX_FEE_NUMERATOR; exports.MAX_PRICE_CHANGE_BPS_DEFAULT = MAX_PRICE_CHANGE_BPS_DEFAULT; exports.MAX_SQRT_PRICE = MAX_SQRT_PRICE; exports.MIN_CU_BUFFER = MIN_CU_BUFFER; exports.MIN_SQRT_PRICE = MIN_SQRT_PRICE; exports.ONE = ONE; exports.Rounding = Rounding; exports.SCALE_OFFSET = SCALE_OFFSET; exports.TradeDirection = TradeDirection; exports.bpsToFeeNumerator = bpsToFeeNumerator; exports.calculateInitSqrtPrice = calculateInitSqrtPrice; exports.calculateTransferFeeExcludedAmount = calculateTransferFeeExcludedAmount; exports.calculateTransferFeeIncludedAmount = calculateTransferFeeIncludedAmount; exports.decimalToQ64 = decimalToQ64; exports.default = index_default; exports.deriveClaimFeeOperatorAddress = deriveClaimFeeOperatorAddress; exports.deriveConfigAddress = deriveConfigAddress; exports.deriveCustomizablePoolAddress = deriveCustomizablePoolAddress; exports.derivePoolAddress = derivePoolAddress; exports.derivePoolAuthority = derivePoolAuthority; exports.derivePositionAddress = derivePositionAddress; exports.derivePositionNftAccount = derivePositionNftAccount; exports.deriveRewardVaultAddress = deriveRewardVaultAddress; exports.deriveTokenBadgeAddress = deriveTokenBadgeAddress; exports.deriveTokenVaultAddress = deriveTokenVaultAddress; exports.feeNumeratorToBps = feeNumeratorToBps; exports.getAllPositionNftAccountByOwner = getAllPositionNftAccountByOwner; exports.getAllUserPositionNftAccount = getAllUserPositionNftAccount; exports.getAmountAFromLiquidityDelta = getAmountAFromLiquidityDelta; exports.getAmountBFromLiquidityDelta = getAmountBFromLiquidityDelta; exports.getAvailableVestingLiquidity = getAvailableVestingLiquidity; exports.getBaseFeeNumerator = getBaseFeeNumerator; exports.getBaseFeeParams = getBaseFeeParams; exports.getDynamicFeeNumerator = getDynamicFeeNumerator; exports.getDynamicFeeParams = getDynamicFeeParams; exports.getEstimatedComputeUnitIxWithBuffer = getEstimatedComputeUnitIxWithBuffer; exports.getEstimatedComputeUnitUsageWithBuffer = getEstimatedComputeUnitUsageWithBuffer; exports.getExcludedFeeAmount = getExcludedFeeAmount; exports.getFeeMode = getFeeMode; exports.getFeeNumerator = getFeeNumerator; exports.getFirstKey = getFirstKey; exports.getIncludedFeeAmount = getIncludedFeeAmount; exports.getLiquidityDeltaFromAmountA = getLiquidityDeltaFromAmountA; exports.getLiquidityDeltaFromAmountB = getLiquidityDeltaFromAmountB; exports.getMaxAmountWithSlippage = getMaxAmountWithSlippage; exports.getMinAmountWithSlippage = getMinAmountWithSlippage; exports.getNextSqrtPrice = getNextSqrtPrice; exports.getNextSqrtPriceFromAmountARoundingDown = getNextSqrtPriceFromAmountARoundingDown; exports.getNextSqrtPriceFromAmountBRoundingUp = getNextSqrtPriceFromAmountBRoundingUp; exports.getNextSqrtPriceFromOutput = getNextSqrtPriceFromOutput; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getPriceChange = getPriceChange; exports.getPriceFromSqrtPrice = getPriceFromSqrtPrice; exports.getPriceImpact = getPriceImpact; exports.getSecondKey = getSecondKey; exports.getSimulationComputeUnits = getSimulationComputeUnits; exports.getSqrtPriceFromPrice = getSqrtPriceFromPrice; exports.getSwapAmount = getSwapAmount; exports.getSwapResultFromOutAmount = getSwapResultFromOutAmount; exports.getTokenDecimals = getTokenDecimals; exports.getTokenProgram = getTokenProgram; exports.getTotalLockedLiquidity = getTotalLockedLiquidity; exports.getUnClaimReward = getUnClaimReward; exports.isVestingComplete = isVestingComplete; exports.mulDiv = mulDiv; exports.positionByPoolFilter = positionByPoolFilter; exports.pow = pow; exports.q64ToDecimal = q64ToDecimal; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.vestingByPositionFilter = vestingByPositionFilter; exports.wrapSOLInstruction = wrapSOLInstruction;
|
|
10411
10605
|
//# sourceMappingURL=index.js.map
|