@meteora-ag/dlmm 1.3.12 → 1.3.13-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.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import * as _coral_xyz_anchor from '@coral-xyz/anchor';
2
2
  import { BN, Program, IdlAccounts, ProgramAccount, IdlTypes, EventParser } from '@coral-xyz/anchor';
3
3
  import * as _solana_web3_js from '@solana/web3.js';
4
- import { PublicKey, TransactionInstruction, Connection, Transaction, Cluster } from '@solana/web3.js';
4
+ import { PublicKey, AccountMeta, TransactionInstruction, Connection, Transaction, Cluster } from '@solana/web3.js';
5
5
  import Decimal from 'decimal.js';
6
+ import { Mint } from '@solana/spl-token';
6
7
 
7
8
  type LbClmm = {
8
- "version": "0.8.5";
9
+ "version": "0.9.0";
9
10
  "name": "lb_clmm";
10
11
  "constants": [
11
12
  {
@@ -27,6 +28,20 @@ type LbClmm = {
27
28
  };
28
29
  "value": "70";
29
30
  },
31
+ {
32
+ "name": "MAX_RESIZE_LENGTH";
33
+ "type": {
34
+ "defined": "usize";
35
+ };
36
+ "value": "70";
37
+ },
38
+ {
39
+ "name": "POSITION_MAX_LENGTH";
40
+ "type": {
41
+ "defined": "usize";
42
+ };
43
+ "value": "1400";
44
+ },
30
45
  {
31
46
  "name": "MIN_BIN_ID";
32
47
  "type": "i32";
@@ -138,6 +153,11 @@ type LbClmm = {
138
153
  "type": "bytes";
139
154
  "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]";
140
155
  },
156
+ {
157
+ "name": "PRESET_PARAMETER2";
158
+ "type": "bytes";
159
+ "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114, 50]";
160
+ },
141
161
  {
142
162
  "name": "POSITION";
143
163
  "type": "bytes";
@@ -281,7 +301,24 @@ type LbClmm = {
281
301
  "isSigner": true;
282
302
  },
283
303
  {
284
- "name": "tokenProgram";
304
+ "name": "tokenBadgeX";
305
+ "isMut": false;
306
+ "isSigner": false;
307
+ "isOptional": true;
308
+ },
309
+ {
310
+ "name": "tokenBadgeY";
311
+ "isMut": false;
312
+ "isSigner": false;
313
+ "isOptional": true;
314
+ },
315
+ {
316
+ "name": "tokenProgramX";
317
+ "isMut": false;
318
+ "isSigner": false;
319
+ },
320
+ {
321
+ "name": "tokenProgramY";
285
322
  "isMut": false;
286
323
  "isSigner": false;
287
324
  },
@@ -1549,6 +1586,11 @@ type LbClmm = {
1549
1586
  "name": "tokenYProgram";
1550
1587
  "isMut": false;
1551
1588
  "isSigner": false;
1589
+ },
1590
+ {
1591
+ "name": "memoProgram";
1592
+ "isMut": false;
1593
+ "isSigner": false;
1552
1594
  }
1553
1595
  ];
1554
1596
  "args": [
@@ -1559,6 +1601,12 @@ type LbClmm = {
1559
1601
  {
1560
1602
  "name": "amountY";
1561
1603
  "type": "u64";
1604
+ },
1605
+ {
1606
+ "name": "remainingAccountsInfo";
1607
+ "type": {
1608
+ "defined": "RemainingAccountsInfo";
1609
+ };
1562
1610
  }
1563
1611
  ];
1564
1612
  },
@@ -1580,6 +1628,12 @@ type LbClmm = {
1580
1628
  "isMut": false;
1581
1629
  "isSigner": false;
1582
1630
  },
1631
+ {
1632
+ "name": "tokenBadge";
1633
+ "isMut": false;
1634
+ "isSigner": false;
1635
+ "isOptional": true;
1636
+ },
1583
1637
  {
1584
1638
  "name": "admin";
1585
1639
  "isMut": true;
@@ -1687,6 +1741,12 @@ type LbClmm = {
1687
1741
  {
1688
1742
  "name": "carryForward";
1689
1743
  "type": "bool";
1744
+ },
1745
+ {
1746
+ "name": "remainingAccountsInfo";
1747
+ "type": {
1748
+ "defined": "RemainingAccountsInfo";
1749
+ };
1690
1750
  }
1691
1751
  ];
1692
1752
  },
@@ -2109,6 +2169,27 @@ type LbClmm = {
2109
2169
  ];
2110
2170
  "args": [];
2111
2171
  },
2172
+ {
2173
+ "name": "closePresetParameter2";
2174
+ "accounts": [
2175
+ {
2176
+ "name": "presetParameter";
2177
+ "isMut": true;
2178
+ "isSigner": false;
2179
+ },
2180
+ {
2181
+ "name": "admin";
2182
+ "isMut": true;
2183
+ "isSigner": true;
2184
+ },
2185
+ {
2186
+ "name": "rentReceiver";
2187
+ "isMut": true;
2188
+ "isSigner": false;
2189
+ }
2190
+ ];
2191
+ "args": [];
2192
+ },
2112
2193
  {
2113
2194
  "name": "removeAllLiquidity";
2114
2195
  "accounts": [
@@ -2353,6 +2434,11 @@ type LbClmm = {
2353
2434
  "isMut": false;
2354
2435
  "isSigner": false;
2355
2436
  },
2437
+ {
2438
+ "name": "memoProgram";
2439
+ "isMut": false;
2440
+ "isSigner": false;
2441
+ },
2356
2442
  {
2357
2443
  "name": "eventAuthority";
2358
2444
  "isMut": false;
@@ -2368,6 +2454,12 @@ type LbClmm = {
2368
2454
  {
2369
2455
  "name": "rewardIndex";
2370
2456
  "type": "u64";
2457
+ },
2458
+ {
2459
+ "name": "remainingAccountsInfo";
2460
+ "type": {
2461
+ "defined": "RemainingAccountsInfo";
2462
+ };
2371
2463
  }
2372
2464
  ];
2373
2465
  },
@@ -2651,148 +2743,1257 @@ type LbClmm = {
2651
2743
  "type": "publicKey";
2652
2744
  }
2653
2745
  ];
2654
- }
2655
- ];
2656
- "accounts": [
2746
+ },
2657
2747
  {
2658
- "name": "binArrayBitmapExtension";
2659
- "type": {
2660
- "kind": "struct";
2661
- "fields": [
2662
- {
2663
- "name": "lbPair";
2664
- "type": "publicKey";
2665
- },
2666
- {
2667
- "name": "positiveBinArrayBitmap";
2668
- "docs": [
2669
- "Packed initialized bin array state for start_bin_index is positive"
2670
- ];
2671
- "type": {
2672
- "array": [
2673
- {
2674
- "array": [
2675
- "u64",
2676
- 8
2677
- ];
2678
- },
2679
- 12
2680
- ];
2681
- };
2682
- },
2683
- {
2684
- "name": "negativeBinArrayBitmap";
2685
- "docs": [
2686
- "Packed initialized bin array state for start_bin_index is negative"
2687
- ];
2688
- "type": {
2689
- "array": [
2690
- {
2691
- "array": [
2692
- "u64",
2693
- 8
2694
- ];
2695
- },
2696
- 12
2697
- ];
2698
- };
2699
- }
2700
- ];
2701
- };
2748
+ "name": "initializeTokenBadge";
2749
+ "accounts": [
2750
+ {
2751
+ "name": "tokenMint";
2752
+ "isMut": false;
2753
+ "isSigner": false;
2754
+ },
2755
+ {
2756
+ "name": "tokenBadge";
2757
+ "isMut": true;
2758
+ "isSigner": false;
2759
+ },
2760
+ {
2761
+ "name": "admin";
2762
+ "isMut": true;
2763
+ "isSigner": true;
2764
+ },
2765
+ {
2766
+ "name": "systemProgram";
2767
+ "isMut": false;
2768
+ "isSigner": false;
2769
+ }
2770
+ ];
2771
+ "args": [];
2702
2772
  },
2703
2773
  {
2704
- "name": "binArray";
2705
- "docs": [
2706
- "An account to contain a range of bin. For example: Bin 100 <-> 200.",
2707
- "For example:",
2708
- "BinArray index: 0 contains bin 0 <-> 599",
2709
- "index: 2 contains bin 600 <-> 1199, ..."
2774
+ "name": "initializePresetParameter2";
2775
+ "accounts": [
2776
+ {
2777
+ "name": "presetParameter";
2778
+ "isMut": true;
2779
+ "isSigner": false;
2780
+ },
2781
+ {
2782
+ "name": "admin";
2783
+ "isMut": true;
2784
+ "isSigner": true;
2785
+ },
2786
+ {
2787
+ "name": "systemProgram";
2788
+ "isMut": false;
2789
+ "isSigner": false;
2790
+ }
2791
+ ];
2792
+ "args": [
2793
+ {
2794
+ "name": "ix";
2795
+ "type": {
2796
+ "defined": "InitPresetParameters2Ix";
2797
+ };
2798
+ }
2710
2799
  ];
2711
- "type": {
2712
- "kind": "struct";
2713
- "fields": [
2714
- {
2715
- "name": "index";
2716
- "type": "i64";
2717
- },
2718
- {
2719
- "name": "version";
2720
- "docs": [
2721
- "Version of binArray"
2722
- ];
2723
- "type": "u8";
2724
- },
2725
- {
2726
- "name": "padding";
2727
- "type": {
2728
- "array": [
2729
- "u8",
2730
- 7
2731
- ];
2732
- };
2733
- },
2734
- {
2735
- "name": "lbPair";
2736
- "type": "publicKey";
2737
- },
2738
- {
2739
- "name": "bins";
2740
- "type": {
2741
- "array": [
2742
- {
2743
- "defined": "Bin";
2744
- },
2745
- 70
2746
- ];
2747
- };
2748
- }
2749
- ];
2750
- };
2751
2800
  },
2752
2801
  {
2753
- "name": "lbPair";
2754
- "type": {
2755
- "kind": "struct";
2756
- "fields": [
2757
- {
2758
- "name": "parameters";
2759
- "type": {
2760
- "defined": "StaticParameters";
2761
- };
2762
- },
2763
- {
2764
- "name": "vParameters";
2765
- "type": {
2766
- "defined": "VariableParameters";
2767
- };
2768
- },
2769
- {
2770
- "name": "bumpSeed";
2771
- "type": {
2772
- "array": [
2773
- "u8",
2774
- 1
2775
- ];
2776
- };
2777
- },
2778
- {
2779
- "name": "binStepSeed";
2780
- "docs": [
2781
- "Bin step signer seed"
2782
- ];
2783
- "type": {
2784
- "array": [
2785
- "u8",
2786
- 2
2787
- ];
2788
- };
2789
- },
2790
- {
2791
- "name": "pairType";
2792
- "docs": [
2793
- "Type of the pair"
2794
- ];
2795
- "type": "u8";
2802
+ "name": "initializeLbPair2";
2803
+ "accounts": [
2804
+ {
2805
+ "name": "lbPair";
2806
+ "isMut": true;
2807
+ "isSigner": false;
2808
+ },
2809
+ {
2810
+ "name": "binArrayBitmapExtension";
2811
+ "isMut": true;
2812
+ "isSigner": false;
2813
+ "isOptional": true;
2814
+ },
2815
+ {
2816
+ "name": "tokenMintX";
2817
+ "isMut": false;
2818
+ "isSigner": false;
2819
+ },
2820
+ {
2821
+ "name": "tokenMintY";
2822
+ "isMut": false;
2823
+ "isSigner": false;
2824
+ },
2825
+ {
2826
+ "name": "reserveX";
2827
+ "isMut": true;
2828
+ "isSigner": false;
2829
+ },
2830
+ {
2831
+ "name": "reserveY";
2832
+ "isMut": true;
2833
+ "isSigner": false;
2834
+ },
2835
+ {
2836
+ "name": "oracle";
2837
+ "isMut": true;
2838
+ "isSigner": false;
2839
+ },
2840
+ {
2841
+ "name": "presetParameter";
2842
+ "isMut": false;
2843
+ "isSigner": false;
2844
+ },
2845
+ {
2846
+ "name": "funder";
2847
+ "isMut": true;
2848
+ "isSigner": true;
2849
+ },
2850
+ {
2851
+ "name": "tokenBadgeX";
2852
+ "isMut": false;
2853
+ "isSigner": false;
2854
+ "isOptional": true;
2855
+ },
2856
+ {
2857
+ "name": "tokenBadgeY";
2858
+ "isMut": false;
2859
+ "isSigner": false;
2860
+ "isOptional": true;
2861
+ },
2862
+ {
2863
+ "name": "tokenProgramX";
2864
+ "isMut": false;
2865
+ "isSigner": false;
2866
+ },
2867
+ {
2868
+ "name": "tokenProgramY";
2869
+ "isMut": false;
2870
+ "isSigner": false;
2871
+ },
2872
+ {
2873
+ "name": "systemProgram";
2874
+ "isMut": false;
2875
+ "isSigner": false;
2876
+ },
2877
+ {
2878
+ "name": "eventAuthority";
2879
+ "isMut": false;
2880
+ "isSigner": false;
2881
+ },
2882
+ {
2883
+ "name": "program";
2884
+ "isMut": false;
2885
+ "isSigner": false;
2886
+ }
2887
+ ];
2888
+ "args": [
2889
+ {
2890
+ "name": "params";
2891
+ "type": {
2892
+ "defined": "InitializeLbPair2Params";
2893
+ };
2894
+ }
2895
+ ];
2896
+ },
2897
+ {
2898
+ "name": "initializeCustomizablePermissionlessLbPair2";
2899
+ "accounts": [
2900
+ {
2901
+ "name": "lbPair";
2902
+ "isMut": true;
2903
+ "isSigner": false;
2904
+ },
2905
+ {
2906
+ "name": "binArrayBitmapExtension";
2907
+ "isMut": true;
2908
+ "isSigner": false;
2909
+ "isOptional": true;
2910
+ },
2911
+ {
2912
+ "name": "tokenMintX";
2913
+ "isMut": false;
2914
+ "isSigner": false;
2915
+ },
2916
+ {
2917
+ "name": "tokenMintY";
2918
+ "isMut": false;
2919
+ "isSigner": false;
2920
+ },
2921
+ {
2922
+ "name": "reserveX";
2923
+ "isMut": true;
2924
+ "isSigner": false;
2925
+ },
2926
+ {
2927
+ "name": "reserveY";
2928
+ "isMut": true;
2929
+ "isSigner": false;
2930
+ },
2931
+ {
2932
+ "name": "oracle";
2933
+ "isMut": true;
2934
+ "isSigner": false;
2935
+ },
2936
+ {
2937
+ "name": "userTokenX";
2938
+ "isMut": false;
2939
+ "isSigner": false;
2940
+ },
2941
+ {
2942
+ "name": "funder";
2943
+ "isMut": true;
2944
+ "isSigner": true;
2945
+ },
2946
+ {
2947
+ "name": "tokenBadgeX";
2948
+ "isMut": false;
2949
+ "isSigner": false;
2950
+ "isOptional": true;
2951
+ },
2952
+ {
2953
+ "name": "tokenBadgeY";
2954
+ "isMut": false;
2955
+ "isSigner": false;
2956
+ "isOptional": true;
2957
+ },
2958
+ {
2959
+ "name": "tokenProgramX";
2960
+ "isMut": false;
2961
+ "isSigner": false;
2962
+ },
2963
+ {
2964
+ "name": "tokenProgramY";
2965
+ "isMut": false;
2966
+ "isSigner": false;
2967
+ },
2968
+ {
2969
+ "name": "systemProgram";
2970
+ "isMut": false;
2971
+ "isSigner": false;
2972
+ },
2973
+ {
2974
+ "name": "userTokenY";
2975
+ "isMut": false;
2976
+ "isSigner": false;
2977
+ },
2978
+ {
2979
+ "name": "eventAuthority";
2980
+ "isMut": false;
2981
+ "isSigner": false;
2982
+ },
2983
+ {
2984
+ "name": "program";
2985
+ "isMut": false;
2986
+ "isSigner": false;
2987
+ }
2988
+ ];
2989
+ "args": [
2990
+ {
2991
+ "name": "params";
2992
+ "type": {
2993
+ "defined": "CustomizableParams";
2994
+ };
2995
+ }
2996
+ ];
2997
+ },
2998
+ {
2999
+ "name": "claimFee2";
3000
+ "accounts": [
3001
+ {
3002
+ "name": "lbPair";
3003
+ "isMut": true;
3004
+ "isSigner": false;
3005
+ },
3006
+ {
3007
+ "name": "position";
3008
+ "isMut": true;
3009
+ "isSigner": false;
3010
+ },
3011
+ {
3012
+ "name": "sender";
3013
+ "isMut": false;
3014
+ "isSigner": true;
3015
+ },
3016
+ {
3017
+ "name": "reserveX";
3018
+ "isMut": true;
3019
+ "isSigner": false;
3020
+ },
3021
+ {
3022
+ "name": "reserveY";
3023
+ "isMut": true;
3024
+ "isSigner": false;
3025
+ },
3026
+ {
3027
+ "name": "userTokenX";
3028
+ "isMut": true;
3029
+ "isSigner": false;
3030
+ },
3031
+ {
3032
+ "name": "userTokenY";
3033
+ "isMut": true;
3034
+ "isSigner": false;
3035
+ },
3036
+ {
3037
+ "name": "tokenXMint";
3038
+ "isMut": false;
3039
+ "isSigner": false;
3040
+ },
3041
+ {
3042
+ "name": "tokenYMint";
3043
+ "isMut": false;
3044
+ "isSigner": false;
3045
+ },
3046
+ {
3047
+ "name": "tokenProgramX";
3048
+ "isMut": false;
3049
+ "isSigner": false;
3050
+ },
3051
+ {
3052
+ "name": "tokenProgramY";
3053
+ "isMut": false;
3054
+ "isSigner": false;
3055
+ },
3056
+ {
3057
+ "name": "memoProgram";
3058
+ "isMut": false;
3059
+ "isSigner": false;
3060
+ },
3061
+ {
3062
+ "name": "eventAuthority";
3063
+ "isMut": false;
3064
+ "isSigner": false;
3065
+ },
3066
+ {
3067
+ "name": "program";
3068
+ "isMut": false;
3069
+ "isSigner": false;
3070
+ }
3071
+ ];
3072
+ "args": [
3073
+ {
3074
+ "name": "minBinId";
3075
+ "type": "i32";
3076
+ },
3077
+ {
3078
+ "name": "maxBinId";
3079
+ "type": "i32";
3080
+ },
3081
+ {
3082
+ "name": "remainingAccountsInfo";
3083
+ "type": {
3084
+ "defined": "RemainingAccountsInfo";
3085
+ };
3086
+ }
3087
+ ];
3088
+ },
3089
+ {
3090
+ "name": "claimReward2";
3091
+ "accounts": [
3092
+ {
3093
+ "name": "lbPair";
3094
+ "isMut": true;
3095
+ "isSigner": false;
3096
+ },
3097
+ {
3098
+ "name": "position";
3099
+ "isMut": true;
3100
+ "isSigner": false;
3101
+ },
3102
+ {
3103
+ "name": "sender";
3104
+ "isMut": false;
3105
+ "isSigner": true;
3106
+ },
3107
+ {
3108
+ "name": "rewardVault";
3109
+ "isMut": true;
3110
+ "isSigner": false;
3111
+ },
3112
+ {
3113
+ "name": "rewardMint";
3114
+ "isMut": false;
3115
+ "isSigner": false;
3116
+ },
3117
+ {
3118
+ "name": "userTokenAccount";
3119
+ "isMut": true;
3120
+ "isSigner": false;
3121
+ },
3122
+ {
3123
+ "name": "tokenProgram";
3124
+ "isMut": false;
3125
+ "isSigner": false;
3126
+ },
3127
+ {
3128
+ "name": "memoProgram";
3129
+ "isMut": false;
3130
+ "isSigner": false;
3131
+ },
3132
+ {
3133
+ "name": "eventAuthority";
3134
+ "isMut": false;
3135
+ "isSigner": false;
3136
+ },
3137
+ {
3138
+ "name": "program";
3139
+ "isMut": false;
3140
+ "isSigner": false;
3141
+ }
3142
+ ];
3143
+ "args": [
3144
+ {
3145
+ "name": "rewardIndex";
3146
+ "type": "u64";
3147
+ },
3148
+ {
3149
+ "name": "minBinId";
3150
+ "type": "i32";
3151
+ },
3152
+ {
3153
+ "name": "maxBinId";
3154
+ "type": "i32";
3155
+ },
3156
+ {
3157
+ "name": "remainingAccountsInfo";
3158
+ "type": {
3159
+ "defined": "RemainingAccountsInfo";
3160
+ };
3161
+ }
3162
+ ];
3163
+ },
3164
+ {
3165
+ "name": "addLiquidity2";
3166
+ "accounts": [
3167
+ {
3168
+ "name": "position";
3169
+ "isMut": true;
3170
+ "isSigner": false;
3171
+ },
3172
+ {
3173
+ "name": "lbPair";
3174
+ "isMut": true;
3175
+ "isSigner": false;
3176
+ },
3177
+ {
3178
+ "name": "binArrayBitmapExtension";
3179
+ "isMut": true;
3180
+ "isSigner": false;
3181
+ "isOptional": true;
3182
+ },
3183
+ {
3184
+ "name": "userTokenX";
3185
+ "isMut": true;
3186
+ "isSigner": false;
3187
+ },
3188
+ {
3189
+ "name": "userTokenY";
3190
+ "isMut": true;
3191
+ "isSigner": false;
3192
+ },
3193
+ {
3194
+ "name": "reserveX";
3195
+ "isMut": true;
3196
+ "isSigner": false;
3197
+ },
3198
+ {
3199
+ "name": "reserveY";
3200
+ "isMut": true;
3201
+ "isSigner": false;
3202
+ },
3203
+ {
3204
+ "name": "tokenXMint";
3205
+ "isMut": false;
3206
+ "isSigner": false;
3207
+ },
3208
+ {
3209
+ "name": "tokenYMint";
3210
+ "isMut": false;
3211
+ "isSigner": false;
3212
+ },
3213
+ {
3214
+ "name": "sender";
3215
+ "isMut": false;
3216
+ "isSigner": true;
3217
+ },
3218
+ {
3219
+ "name": "tokenXProgram";
3220
+ "isMut": false;
3221
+ "isSigner": false;
3222
+ },
3223
+ {
3224
+ "name": "tokenYProgram";
3225
+ "isMut": false;
3226
+ "isSigner": false;
3227
+ },
3228
+ {
3229
+ "name": "memoProgram";
3230
+ "isMut": false;
3231
+ "isSigner": false;
3232
+ },
3233
+ {
3234
+ "name": "eventAuthority";
3235
+ "isMut": false;
3236
+ "isSigner": false;
3237
+ },
3238
+ {
3239
+ "name": "program";
3240
+ "isMut": false;
3241
+ "isSigner": false;
3242
+ }
3243
+ ];
3244
+ "args": [
3245
+ {
3246
+ "name": "liquidityParameter";
3247
+ "type": {
3248
+ "defined": "LiquidityParameter";
3249
+ };
3250
+ },
3251
+ {
3252
+ "name": "remainingAccountsInfo";
3253
+ "type": {
3254
+ "defined": "RemainingAccountsInfo";
3255
+ };
3256
+ }
3257
+ ];
3258
+ },
3259
+ {
3260
+ "name": "addLiquidityByStrategy2";
3261
+ "accounts": [
3262
+ {
3263
+ "name": "position";
3264
+ "isMut": true;
3265
+ "isSigner": false;
3266
+ },
3267
+ {
3268
+ "name": "lbPair";
3269
+ "isMut": true;
3270
+ "isSigner": false;
3271
+ },
3272
+ {
3273
+ "name": "binArrayBitmapExtension";
3274
+ "isMut": true;
3275
+ "isSigner": false;
3276
+ "isOptional": true;
3277
+ },
3278
+ {
3279
+ "name": "userTokenX";
3280
+ "isMut": true;
3281
+ "isSigner": false;
3282
+ },
3283
+ {
3284
+ "name": "userTokenY";
3285
+ "isMut": true;
3286
+ "isSigner": false;
3287
+ },
3288
+ {
3289
+ "name": "reserveX";
3290
+ "isMut": true;
3291
+ "isSigner": false;
3292
+ },
3293
+ {
3294
+ "name": "reserveY";
3295
+ "isMut": true;
3296
+ "isSigner": false;
3297
+ },
3298
+ {
3299
+ "name": "tokenXMint";
3300
+ "isMut": false;
3301
+ "isSigner": false;
3302
+ },
3303
+ {
3304
+ "name": "tokenYMint";
3305
+ "isMut": false;
3306
+ "isSigner": false;
3307
+ },
3308
+ {
3309
+ "name": "sender";
3310
+ "isMut": false;
3311
+ "isSigner": true;
3312
+ },
3313
+ {
3314
+ "name": "tokenXProgram";
3315
+ "isMut": false;
3316
+ "isSigner": false;
3317
+ },
3318
+ {
3319
+ "name": "tokenYProgram";
3320
+ "isMut": false;
3321
+ "isSigner": false;
3322
+ },
3323
+ {
3324
+ "name": "memoProgram";
3325
+ "isMut": false;
3326
+ "isSigner": false;
3327
+ },
3328
+ {
3329
+ "name": "eventAuthority";
3330
+ "isMut": false;
3331
+ "isSigner": false;
3332
+ },
3333
+ {
3334
+ "name": "program";
3335
+ "isMut": false;
3336
+ "isSigner": false;
3337
+ }
3338
+ ];
3339
+ "args": [
3340
+ {
3341
+ "name": "liquidityParameter";
3342
+ "type": {
3343
+ "defined": "LiquidityParameterByStrategy";
3344
+ };
3345
+ },
3346
+ {
3347
+ "name": "remainingAccountsInfo";
3348
+ "type": {
3349
+ "defined": "RemainingAccountsInfo";
3350
+ };
3351
+ }
3352
+ ];
3353
+ },
3354
+ {
3355
+ "name": "removeLiquidity2";
3356
+ "accounts": [
3357
+ {
3358
+ "name": "position";
3359
+ "isMut": true;
3360
+ "isSigner": false;
3361
+ },
3362
+ {
3363
+ "name": "lbPair";
3364
+ "isMut": true;
3365
+ "isSigner": false;
3366
+ },
3367
+ {
3368
+ "name": "binArrayBitmapExtension";
3369
+ "isMut": true;
3370
+ "isSigner": false;
3371
+ "isOptional": true;
3372
+ },
3373
+ {
3374
+ "name": "userTokenX";
3375
+ "isMut": true;
3376
+ "isSigner": false;
3377
+ },
3378
+ {
3379
+ "name": "userTokenY";
3380
+ "isMut": true;
3381
+ "isSigner": false;
3382
+ },
3383
+ {
3384
+ "name": "reserveX";
3385
+ "isMut": true;
3386
+ "isSigner": false;
3387
+ },
3388
+ {
3389
+ "name": "reserveY";
3390
+ "isMut": true;
3391
+ "isSigner": false;
3392
+ },
3393
+ {
3394
+ "name": "tokenXMint";
3395
+ "isMut": false;
3396
+ "isSigner": false;
3397
+ },
3398
+ {
3399
+ "name": "tokenYMint";
3400
+ "isMut": false;
3401
+ "isSigner": false;
3402
+ },
3403
+ {
3404
+ "name": "sender";
3405
+ "isMut": false;
3406
+ "isSigner": true;
3407
+ },
3408
+ {
3409
+ "name": "tokenXProgram";
3410
+ "isMut": false;
3411
+ "isSigner": false;
3412
+ },
3413
+ {
3414
+ "name": "tokenYProgram";
3415
+ "isMut": false;
3416
+ "isSigner": false;
3417
+ },
3418
+ {
3419
+ "name": "memoProgram";
3420
+ "isMut": false;
3421
+ "isSigner": false;
3422
+ },
3423
+ {
3424
+ "name": "eventAuthority";
3425
+ "isMut": false;
3426
+ "isSigner": false;
3427
+ },
3428
+ {
3429
+ "name": "program";
3430
+ "isMut": false;
3431
+ "isSigner": false;
3432
+ }
3433
+ ];
3434
+ "args": [
3435
+ {
3436
+ "name": "binLiquidityRemoval";
3437
+ "type": {
3438
+ "vec": {
3439
+ "defined": "BinLiquidityReduction";
3440
+ };
3441
+ };
3442
+ },
3443
+ {
3444
+ "name": "remainingAccountsInfo";
3445
+ "type": {
3446
+ "defined": "RemainingAccountsInfo";
3447
+ };
3448
+ }
3449
+ ];
3450
+ },
3451
+ {
3452
+ "name": "removeLiquidityByRange2";
3453
+ "accounts": [
3454
+ {
3455
+ "name": "position";
3456
+ "isMut": true;
3457
+ "isSigner": false;
3458
+ },
3459
+ {
3460
+ "name": "lbPair";
3461
+ "isMut": true;
3462
+ "isSigner": false;
3463
+ },
3464
+ {
3465
+ "name": "binArrayBitmapExtension";
3466
+ "isMut": true;
3467
+ "isSigner": false;
3468
+ "isOptional": true;
3469
+ },
3470
+ {
3471
+ "name": "userTokenX";
3472
+ "isMut": true;
3473
+ "isSigner": false;
3474
+ },
3475
+ {
3476
+ "name": "userTokenY";
3477
+ "isMut": true;
3478
+ "isSigner": false;
3479
+ },
3480
+ {
3481
+ "name": "reserveX";
3482
+ "isMut": true;
3483
+ "isSigner": false;
3484
+ },
3485
+ {
3486
+ "name": "reserveY";
3487
+ "isMut": true;
3488
+ "isSigner": false;
3489
+ },
3490
+ {
3491
+ "name": "tokenXMint";
3492
+ "isMut": false;
3493
+ "isSigner": false;
3494
+ },
3495
+ {
3496
+ "name": "tokenYMint";
3497
+ "isMut": false;
3498
+ "isSigner": false;
3499
+ },
3500
+ {
3501
+ "name": "sender";
3502
+ "isMut": false;
3503
+ "isSigner": true;
3504
+ },
3505
+ {
3506
+ "name": "tokenXProgram";
3507
+ "isMut": false;
3508
+ "isSigner": false;
3509
+ },
3510
+ {
3511
+ "name": "tokenYProgram";
3512
+ "isMut": false;
3513
+ "isSigner": false;
3514
+ },
3515
+ {
3516
+ "name": "memoProgram";
3517
+ "isMut": false;
3518
+ "isSigner": false;
3519
+ },
3520
+ {
3521
+ "name": "eventAuthority";
3522
+ "isMut": false;
3523
+ "isSigner": false;
3524
+ },
3525
+ {
3526
+ "name": "program";
3527
+ "isMut": false;
3528
+ "isSigner": false;
3529
+ }
3530
+ ];
3531
+ "args": [
3532
+ {
3533
+ "name": "fromBinId";
3534
+ "type": "i32";
3535
+ },
3536
+ {
3537
+ "name": "toBinId";
3538
+ "type": "i32";
3539
+ },
3540
+ {
3541
+ "name": "bpsToRemove";
3542
+ "type": "u16";
3543
+ },
3544
+ {
3545
+ "name": "remainingAccountsInfo";
3546
+ "type": {
3547
+ "defined": "RemainingAccountsInfo";
3548
+ };
3549
+ }
3550
+ ];
3551
+ },
3552
+ {
3553
+ "name": "swap2";
3554
+ "accounts": [
3555
+ {
3556
+ "name": "lbPair";
3557
+ "isMut": true;
3558
+ "isSigner": false;
3559
+ },
3560
+ {
3561
+ "name": "binArrayBitmapExtension";
3562
+ "isMut": false;
3563
+ "isSigner": false;
3564
+ "isOptional": true;
3565
+ },
3566
+ {
3567
+ "name": "reserveX";
3568
+ "isMut": true;
3569
+ "isSigner": false;
3570
+ },
3571
+ {
3572
+ "name": "reserveY";
3573
+ "isMut": true;
3574
+ "isSigner": false;
3575
+ },
3576
+ {
3577
+ "name": "userTokenIn";
3578
+ "isMut": true;
3579
+ "isSigner": false;
3580
+ },
3581
+ {
3582
+ "name": "userTokenOut";
3583
+ "isMut": true;
3584
+ "isSigner": false;
3585
+ },
3586
+ {
3587
+ "name": "tokenXMint";
3588
+ "isMut": false;
3589
+ "isSigner": false;
3590
+ },
3591
+ {
3592
+ "name": "tokenYMint";
3593
+ "isMut": false;
3594
+ "isSigner": false;
3595
+ },
3596
+ {
3597
+ "name": "oracle";
3598
+ "isMut": true;
3599
+ "isSigner": false;
3600
+ },
3601
+ {
3602
+ "name": "hostFeeIn";
3603
+ "isMut": true;
3604
+ "isSigner": false;
3605
+ "isOptional": true;
3606
+ },
3607
+ {
3608
+ "name": "user";
3609
+ "isMut": false;
3610
+ "isSigner": true;
3611
+ },
3612
+ {
3613
+ "name": "tokenXProgram";
3614
+ "isMut": false;
3615
+ "isSigner": false;
3616
+ },
3617
+ {
3618
+ "name": "tokenYProgram";
3619
+ "isMut": false;
3620
+ "isSigner": false;
3621
+ },
3622
+ {
3623
+ "name": "memoProgram";
3624
+ "isMut": false;
3625
+ "isSigner": false;
3626
+ },
3627
+ {
3628
+ "name": "eventAuthority";
3629
+ "isMut": false;
3630
+ "isSigner": false;
3631
+ },
3632
+ {
3633
+ "name": "program";
3634
+ "isMut": false;
3635
+ "isSigner": false;
3636
+ }
3637
+ ];
3638
+ "args": [
3639
+ {
3640
+ "name": "amountIn";
3641
+ "type": "u64";
3642
+ },
3643
+ {
3644
+ "name": "minAmountOut";
3645
+ "type": "u64";
3646
+ },
3647
+ {
3648
+ "name": "remainingAccountsInfo";
3649
+ "type": {
3650
+ "defined": "RemainingAccountsInfo";
3651
+ };
3652
+ }
3653
+ ];
3654
+ },
3655
+ {
3656
+ "name": "swapWithPriceImpact2";
3657
+ "accounts": [
3658
+ {
3659
+ "name": "lbPair";
3660
+ "isMut": true;
3661
+ "isSigner": false;
3662
+ },
3663
+ {
3664
+ "name": "binArrayBitmapExtension";
3665
+ "isMut": false;
3666
+ "isSigner": false;
3667
+ "isOptional": true;
3668
+ },
3669
+ {
3670
+ "name": "reserveX";
3671
+ "isMut": true;
3672
+ "isSigner": false;
3673
+ },
3674
+ {
3675
+ "name": "reserveY";
3676
+ "isMut": true;
3677
+ "isSigner": false;
3678
+ },
3679
+ {
3680
+ "name": "userTokenIn";
3681
+ "isMut": true;
3682
+ "isSigner": false;
3683
+ },
3684
+ {
3685
+ "name": "userTokenOut";
3686
+ "isMut": true;
3687
+ "isSigner": false;
3688
+ },
3689
+ {
3690
+ "name": "tokenXMint";
3691
+ "isMut": false;
3692
+ "isSigner": false;
3693
+ },
3694
+ {
3695
+ "name": "tokenYMint";
3696
+ "isMut": false;
3697
+ "isSigner": false;
3698
+ },
3699
+ {
3700
+ "name": "oracle";
3701
+ "isMut": true;
3702
+ "isSigner": false;
3703
+ },
3704
+ {
3705
+ "name": "hostFeeIn";
3706
+ "isMut": true;
3707
+ "isSigner": false;
3708
+ "isOptional": true;
3709
+ },
3710
+ {
3711
+ "name": "user";
3712
+ "isMut": false;
3713
+ "isSigner": true;
3714
+ },
3715
+ {
3716
+ "name": "tokenXProgram";
3717
+ "isMut": false;
3718
+ "isSigner": false;
3719
+ },
3720
+ {
3721
+ "name": "tokenYProgram";
3722
+ "isMut": false;
3723
+ "isSigner": false;
3724
+ },
3725
+ {
3726
+ "name": "memoProgram";
3727
+ "isMut": false;
3728
+ "isSigner": false;
3729
+ },
3730
+ {
3731
+ "name": "eventAuthority";
3732
+ "isMut": false;
3733
+ "isSigner": false;
3734
+ },
3735
+ {
3736
+ "name": "program";
3737
+ "isMut": false;
3738
+ "isSigner": false;
3739
+ }
3740
+ ];
3741
+ "args": [
3742
+ {
3743
+ "name": "amountIn";
3744
+ "type": "u64";
3745
+ },
3746
+ {
3747
+ "name": "activeId";
3748
+ "type": {
3749
+ "option": "i32";
3750
+ };
3751
+ },
3752
+ {
3753
+ "name": "maxPriceImpactBps";
3754
+ "type": "u16";
3755
+ },
3756
+ {
3757
+ "name": "remainingAccountsInfo";
3758
+ "type": {
3759
+ "defined": "RemainingAccountsInfo";
3760
+ };
3761
+ }
3762
+ ];
3763
+ },
3764
+ {
3765
+ "name": "closePosition2";
3766
+ "accounts": [
3767
+ {
3768
+ "name": "position";
3769
+ "isMut": true;
3770
+ "isSigner": false;
3771
+ },
3772
+ {
3773
+ "name": "sender";
3774
+ "isMut": false;
3775
+ "isSigner": true;
3776
+ },
3777
+ {
3778
+ "name": "rentReceiver";
3779
+ "isMut": true;
3780
+ "isSigner": false;
3781
+ },
3782
+ {
3783
+ "name": "eventAuthority";
3784
+ "isMut": false;
3785
+ "isSigner": false;
3786
+ },
3787
+ {
3788
+ "name": "program";
3789
+ "isMut": false;
3790
+ "isSigner": false;
3791
+ }
3792
+ ];
3793
+ "args": [];
3794
+ },
3795
+ {
3796
+ "name": "updateFeesAndReward2";
3797
+ "accounts": [
3798
+ {
3799
+ "name": "position";
3800
+ "isMut": true;
3801
+ "isSigner": false;
3802
+ },
3803
+ {
3804
+ "name": "lbPair";
3805
+ "isMut": true;
3806
+ "isSigner": false;
3807
+ },
3808
+ {
3809
+ "name": "owner";
3810
+ "isMut": false;
3811
+ "isSigner": true;
3812
+ }
3813
+ ];
3814
+ "args": [
3815
+ {
3816
+ "name": "minBinId";
3817
+ "type": "i32";
3818
+ },
3819
+ {
3820
+ "name": "maxBinId";
3821
+ "type": "i32";
3822
+ }
3823
+ ];
3824
+ },
3825
+ {
3826
+ "name": "closePositionIfEmpty";
3827
+ "accounts": [
3828
+ {
3829
+ "name": "position";
3830
+ "isMut": true;
3831
+ "isSigner": false;
3832
+ },
3833
+ {
3834
+ "name": "sender";
3835
+ "isMut": false;
3836
+ "isSigner": true;
3837
+ },
3838
+ {
3839
+ "name": "rentReceiver";
3840
+ "isMut": true;
3841
+ "isSigner": false;
3842
+ },
3843
+ {
3844
+ "name": "eventAuthority";
3845
+ "isMut": false;
3846
+ "isSigner": false;
3847
+ },
3848
+ {
3849
+ "name": "program";
3850
+ "isMut": false;
3851
+ "isSigner": false;
3852
+ }
3853
+ ];
3854
+ "args": [];
3855
+ }
3856
+ ];
3857
+ "accounts": [
3858
+ {
3859
+ "name": "binArrayBitmapExtension";
3860
+ "type": {
3861
+ "kind": "struct";
3862
+ "fields": [
3863
+ {
3864
+ "name": "lbPair";
3865
+ "type": "publicKey";
3866
+ },
3867
+ {
3868
+ "name": "positiveBinArrayBitmap";
3869
+ "docs": [
3870
+ "Packed initialized bin array state for start_bin_index is positive"
3871
+ ];
3872
+ "type": {
3873
+ "array": [
3874
+ {
3875
+ "array": [
3876
+ "u64",
3877
+ 8
3878
+ ];
3879
+ },
3880
+ 12
3881
+ ];
3882
+ };
3883
+ },
3884
+ {
3885
+ "name": "negativeBinArrayBitmap";
3886
+ "docs": [
3887
+ "Packed initialized bin array state for start_bin_index is negative"
3888
+ ];
3889
+ "type": {
3890
+ "array": [
3891
+ {
3892
+ "array": [
3893
+ "u64",
3894
+ 8
3895
+ ];
3896
+ },
3897
+ 12
3898
+ ];
3899
+ };
3900
+ }
3901
+ ];
3902
+ };
3903
+ },
3904
+ {
3905
+ "name": "binArray";
3906
+ "docs": [
3907
+ "An account to contain a range of bin. For example: Bin 100 <-> 200.",
3908
+ "For example:",
3909
+ "BinArray index: 0 contains bin 0 <-> 599",
3910
+ "index: 2 contains bin 600 <-> 1199, ..."
3911
+ ];
3912
+ "type": {
3913
+ "kind": "struct";
3914
+ "fields": [
3915
+ {
3916
+ "name": "index";
3917
+ "type": "i64";
3918
+ },
3919
+ {
3920
+ "name": "version";
3921
+ "docs": [
3922
+ "Version of binArray"
3923
+ ];
3924
+ "type": "u8";
3925
+ },
3926
+ {
3927
+ "name": "padding";
3928
+ "type": {
3929
+ "array": [
3930
+ "u8",
3931
+ 7
3932
+ ];
3933
+ };
3934
+ },
3935
+ {
3936
+ "name": "lbPair";
3937
+ "type": "publicKey";
3938
+ },
3939
+ {
3940
+ "name": "bins";
3941
+ "type": {
3942
+ "array": [
3943
+ {
3944
+ "defined": "Bin";
3945
+ },
3946
+ 70
3947
+ ];
3948
+ };
3949
+ }
3950
+ ];
3951
+ };
3952
+ },
3953
+ {
3954
+ "name": "lbPair";
3955
+ "type": {
3956
+ "kind": "struct";
3957
+ "fields": [
3958
+ {
3959
+ "name": "parameters";
3960
+ "type": {
3961
+ "defined": "StaticParameters";
3962
+ };
3963
+ },
3964
+ {
3965
+ "name": "vParameters";
3966
+ "type": {
3967
+ "defined": "VariableParameters";
3968
+ };
3969
+ },
3970
+ {
3971
+ "name": "bumpSeed";
3972
+ "type": {
3973
+ "array": [
3974
+ "u8",
3975
+ 1
3976
+ ];
3977
+ };
3978
+ },
3979
+ {
3980
+ "name": "binStepSeed";
3981
+ "docs": [
3982
+ "Bin step signer seed"
3983
+ ];
3984
+ "type": {
3985
+ "array": [
3986
+ "u8",
3987
+ 2
3988
+ ];
3989
+ };
3990
+ },
3991
+ {
3992
+ "name": "pairType";
3993
+ "docs": [
3994
+ "Type of the pair"
3995
+ ];
3996
+ "type": "u8";
2796
3997
  },
2797
3998
  {
2798
3999
  "name": "activeId";
@@ -3003,6 +4204,20 @@ type LbClmm = {
3003
4204
  ];
3004
4205
  "type": "publicKey";
3005
4206
  },
4207
+ {
4208
+ "name": "tokenMintXProgramFlag";
4209
+ "docs": [
4210
+ "token_mint_x_program_flag"
4211
+ ];
4212
+ "type": "u8";
4213
+ },
4214
+ {
4215
+ "name": "tokenMintYProgramFlag";
4216
+ "docs": [
4217
+ "token_mint_y_program_flag"
4218
+ ];
4219
+ "type": "u8";
4220
+ },
3006
4221
  {
3007
4222
  "name": "reserved";
3008
4223
  "docs": [
@@ -3011,7 +4226,7 @@ type LbClmm = {
3011
4226
  "type": {
3012
4227
  "array": [
3013
4228
  "u8",
3014
- 24
4229
+ 22
3015
4230
  ];
3016
4231
  };
3017
4232
  }
@@ -3317,6 +4532,103 @@ type LbClmm = {
3317
4532
  ];
3318
4533
  };
3319
4534
  },
4535
+ {
4536
+ "name": "presetParameter2";
4537
+ "type": {
4538
+ "kind": "struct";
4539
+ "fields": [
4540
+ {
4541
+ "name": "binStep";
4542
+ "docs": [
4543
+ "Bin step. Represent the price increment / decrement."
4544
+ ];
4545
+ "type": "u16";
4546
+ },
4547
+ {
4548
+ "name": "baseFactor";
4549
+ "docs": [
4550
+ "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor"
4551
+ ];
4552
+ "type": "u16";
4553
+ },
4554
+ {
4555
+ "name": "filterPeriod";
4556
+ "docs": [
4557
+ "Filter period determine high frequency trading time window."
4558
+ ];
4559
+ "type": "u16";
4560
+ },
4561
+ {
4562
+ "name": "decayPeriod";
4563
+ "docs": [
4564
+ "Decay period determine when the volatile fee start decay / decrease."
4565
+ ];
4566
+ "type": "u16";
4567
+ },
4568
+ {
4569
+ "name": "variableFeeControl";
4570
+ "docs": [
4571
+ "Used to scale the variable fee component depending on the dynamic of the market"
4572
+ ];
4573
+ "type": "u32";
4574
+ },
4575
+ {
4576
+ "name": "maxVolatilityAccumulator";
4577
+ "docs": [
4578
+ "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate."
4579
+ ];
4580
+ "type": "u32";
4581
+ },
4582
+ {
4583
+ "name": "reductionFactor";
4584
+ "docs": [
4585
+ "Reduction factor controls the volatile fee rate decrement rate."
4586
+ ];
4587
+ "type": "u16";
4588
+ },
4589
+ {
4590
+ "name": "protocolShare";
4591
+ "docs": [
4592
+ "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee"
4593
+ ];
4594
+ "type": "u16";
4595
+ },
4596
+ {
4597
+ "name": "index";
4598
+ "docs": [
4599
+ "index"
4600
+ ];
4601
+ "type": "u16";
4602
+ },
4603
+ {
4604
+ "name": "baseFeePowerFactor";
4605
+ "docs": [
4606
+ "Base fee power factor"
4607
+ ];
4608
+ "type": "u8";
4609
+ },
4610
+ {
4611
+ "name": "padding0";
4612
+ "docs": [
4613
+ "Padding 0 for future use"
4614
+ ];
4615
+ "type": "u8";
4616
+ },
4617
+ {
4618
+ "name": "padding1";
4619
+ "docs": [
4620
+ "Padding 1 for future use"
4621
+ ];
4622
+ "type": {
4623
+ "array": [
4624
+ "u64",
4625
+ 20
4626
+ ];
4627
+ };
4628
+ }
4629
+ ];
4630
+ };
4631
+ },
3320
4632
  {
3321
4633
  "name": "presetParameter";
3322
4634
  "type": {
@@ -3332,7 +4644,7 @@ type LbClmm = {
3332
4644
  {
3333
4645
  "name": "baseFactor";
3334
4646
  "docs": [
3335
- "Used for base fee calculation. base_fee_rate = base_factor * bin_step"
4647
+ "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor"
3336
4648
  ];
3337
4649
  "type": "u16";
3338
4650
  },
@@ -3394,14 +4706,48 @@ type LbClmm = {
3394
4706
  }
3395
4707
  ];
3396
4708
  };
4709
+ },
4710
+ {
4711
+ "name": "tokenBadge";
4712
+ "docs": [
4713
+ "Parameter that set by the protocol"
4714
+ ];
4715
+ "type": {
4716
+ "kind": "struct";
4717
+ "fields": [
4718
+ {
4719
+ "name": "tokenMint";
4720
+ "docs": [
4721
+ "token mint"
4722
+ ];
4723
+ "type": "publicKey";
4724
+ },
4725
+ {
4726
+ "name": "padding";
4727
+ "docs": [
4728
+ "Reserve"
4729
+ ];
4730
+ "type": {
4731
+ "array": [
4732
+ "u8",
4733
+ 128
4734
+ ];
4735
+ };
4736
+ }
4737
+ ];
4738
+ };
3397
4739
  }
3398
4740
  ];
3399
4741
  "types": [
3400
4742
  {
3401
- "name": "InitPresetParametersIx";
4743
+ "name": "InitPresetParameters2Ix";
3402
4744
  "type": {
3403
4745
  "kind": "struct";
3404
4746
  "fields": [
4747
+ {
4748
+ "name": "index";
4749
+ "type": "u16";
4750
+ },
3405
4751
  {
3406
4752
  "name": "binStep";
3407
4753
  "docs": [
@@ -3412,7 +4758,7 @@ type LbClmm = {
3412
4758
  {
3413
4759
  "name": "baseFactor";
3414
4760
  "docs": [
3415
- "Used for base fee calculation. base_fee_rate = base_factor * bin_step"
4761
+ "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor"
3416
4762
  ];
3417
4763
  "type": "u16";
3418
4764
  },
@@ -3452,18 +4798,75 @@ type LbClmm = {
3452
4798
  "type": "u32";
3453
4799
  },
3454
4800
  {
3455
- "name": "minBinId";
4801
+ "name": "protocolShare";
4802
+ "docs": [
4803
+ "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee"
4804
+ ];
4805
+ "type": "u16";
4806
+ },
4807
+ {
4808
+ "name": "baseFeePowerFactor";
4809
+ "docs": [
4810
+ "Base fee power factor"
4811
+ ];
4812
+ "type": "u8";
4813
+ }
4814
+ ];
4815
+ };
4816
+ },
4817
+ {
4818
+ "name": "InitPresetParametersIx";
4819
+ "type": {
4820
+ "kind": "struct";
4821
+ "fields": [
4822
+ {
4823
+ "name": "binStep";
4824
+ "docs": [
4825
+ "Bin step. Represent the price increment / decrement."
4826
+ ];
4827
+ "type": "u16";
4828
+ },
4829
+ {
4830
+ "name": "baseFactor";
4831
+ "docs": [
4832
+ "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor"
4833
+ ];
4834
+ "type": "u16";
4835
+ },
4836
+ {
4837
+ "name": "filterPeriod";
4838
+ "docs": [
4839
+ "Filter period determine high frequency trading time window."
4840
+ ];
4841
+ "type": "u16";
4842
+ },
4843
+ {
4844
+ "name": "decayPeriod";
4845
+ "docs": [
4846
+ "Decay period determine when the volatile fee start decay / decrease."
4847
+ ];
4848
+ "type": "u16";
4849
+ },
4850
+ {
4851
+ "name": "reductionFactor";
4852
+ "docs": [
4853
+ "Reduction factor controls the volatile fee rate decrement rate."
4854
+ ];
4855
+ "type": "u16";
4856
+ },
4857
+ {
4858
+ "name": "variableFeeControl";
3456
4859
  "docs": [
3457
- "Min bin id supported by the pool based on the configured bin step."
4860
+ "Used to scale the variable fee component depending on the dynamic of the market"
3458
4861
  ];
3459
- "type": "i32";
4862
+ "type": "u32";
3460
4863
  },
3461
4864
  {
3462
- "name": "maxBinId";
4865
+ "name": "maxVolatilityAccumulator";
3463
4866
  "docs": [
3464
- "Max bin id supported by the pool based on the configured bin step."
4867
+ "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate."
3465
4868
  ];
3466
- "type": "i32";
4869
+ "type": "u32";
3467
4870
  },
3468
4871
  {
3469
4872
  "name": "protocolShare";
@@ -3493,6 +4896,13 @@ type LbClmm = {
3493
4896
  "Base factor for base fee rate"
3494
4897
  ];
3495
4898
  "type": "u16";
4899
+ },
4900
+ {
4901
+ "name": "baseFeePowerFactor";
4902
+ "docs": [
4903
+ "Base fee power factor"
4904
+ ];
4905
+ "type": "u8";
3496
4906
  }
3497
4907
  ];
3498
4908
  };
@@ -3922,6 +5332,13 @@ type LbClmm = {
3922
5332
  "option": "u64";
3923
5333
  };
3924
5334
  },
5335
+ {
5336
+ "name": "baseFeePowerFactor";
5337
+ "docs": [
5338
+ "Base fee power factor"
5339
+ ];
5340
+ "type": "u8";
5341
+ },
3925
5342
  {
3926
5343
  "name": "padding";
3927
5344
  "docs": [
@@ -3930,7 +5347,7 @@ type LbClmm = {
3930
5347
  "type": {
3931
5348
  "array": [
3932
5349
  "u8",
3933
- 64
5350
+ 63
3934
5351
  ];
3935
5352
  };
3936
5353
  }
@@ -3955,16 +5372,43 @@ type LbClmm = {
3955
5372
  "type": "u16";
3956
5373
  },
3957
5374
  {
3958
- "name": "minBinId";
3959
- "type": "i32";
5375
+ "name": "baseFeePowerFactor";
5376
+ "type": "u8";
3960
5377
  },
3961
5378
  {
3962
- "name": "maxBinId";
5379
+ "name": "activationType";
5380
+ "type": "u8";
5381
+ },
5382
+ {
5383
+ "name": "protocolShare";
5384
+ "type": "u16";
5385
+ }
5386
+ ];
5387
+ };
5388
+ },
5389
+ {
5390
+ "name": "InitializeLbPair2Params";
5391
+ "type": {
5392
+ "kind": "struct";
5393
+ "fields": [
5394
+ {
5395
+ "name": "activeId";
5396
+ "docs": [
5397
+ "Pool price"
5398
+ ];
3963
5399
  "type": "i32";
3964
5400
  },
3965
5401
  {
3966
- "name": "activationType";
3967
- "type": "u8";
5402
+ "name": "padding";
5403
+ "docs": [
5404
+ "Padding, for future use"
5405
+ ];
5406
+ "type": {
5407
+ "array": [
5408
+ "u8",
5409
+ 96
5410
+ ];
5411
+ };
3968
5412
  }
3969
5413
  ];
3970
5414
  };
@@ -4184,7 +5628,7 @@ type LbClmm = {
4184
5628
  {
4185
5629
  "name": "baseFactor";
4186
5630
  "docs": [
4187
- "Used for base fee calculation. base_fee_rate = base_factor * bin_step"
5631
+ "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor"
4188
5632
  ];
4189
5633
  "type": "u16";
4190
5634
  },
@@ -4244,6 +5688,13 @@ type LbClmm = {
4244
5688
  ];
4245
5689
  "type": "u16";
4246
5690
  },
5691
+ {
5692
+ "name": "baseFeePowerFactor";
5693
+ "docs": [
5694
+ "Base fee power factor"
5695
+ ];
5696
+ "type": "u8";
5697
+ },
4247
5698
  {
4248
5699
  "name": "padding";
4249
5700
  "docs": [
@@ -4252,7 +5703,7 @@ type LbClmm = {
4252
5703
  "type": {
4253
5704
  "array": [
4254
5705
  "u8",
4255
- 6
5706
+ 5
4256
5707
  ];
4257
5708
  };
4258
5709
  }
@@ -4373,6 +5824,40 @@ type LbClmm = {
4373
5824
  ];
4374
5825
  };
4375
5826
  },
5827
+ {
5828
+ "name": "RemainingAccountsSlice";
5829
+ "type": {
5830
+ "kind": "struct";
5831
+ "fields": [
5832
+ {
5833
+ "name": "accountsType";
5834
+ "type": {
5835
+ "defined": "AccountsType";
5836
+ };
5837
+ },
5838
+ {
5839
+ "name": "length";
5840
+ "type": "u8";
5841
+ }
5842
+ ];
5843
+ };
5844
+ },
5845
+ {
5846
+ "name": "RemainingAccountsInfo";
5847
+ "type": {
5848
+ "kind": "struct";
5849
+ "fields": [
5850
+ {
5851
+ "name": "slices";
5852
+ "type": {
5853
+ "vec": {
5854
+ "defined": "RemainingAccountsSlice";
5855
+ };
5856
+ };
5857
+ }
5858
+ ];
5859
+ };
5860
+ },
4376
5861
  {
4377
5862
  "name": "StrategyType";
4378
5863
  "type": {
@@ -4472,6 +5957,9 @@ type LbClmm = {
4472
5957
  },
4473
5958
  {
4474
5959
  "name": "CustomizablePermissionless";
5960
+ },
5961
+ {
5962
+ "name": "PermissionlessV2";
4475
5963
  }
4476
5964
  ];
4477
5965
  };
@@ -4492,6 +5980,37 @@ type LbClmm = {
4492
5980
  }
4493
5981
  ];
4494
5982
  };
5983
+ },
5984
+ {
5985
+ "name": "TokenProgramFlags";
5986
+ "type": {
5987
+ "kind": "enum";
5988
+ "variants": [
5989
+ {
5990
+ "name": "TokenProgram";
5991
+ },
5992
+ {
5993
+ "name": "TokenProgram2022";
5994
+ }
5995
+ ];
5996
+ };
5997
+ },
5998
+ {
5999
+ "name": "AccountsType";
6000
+ "type": {
6001
+ "kind": "enum";
6002
+ "variants": [
6003
+ {
6004
+ "name": "TransferHookX";
6005
+ },
6006
+ {
6007
+ "name": "TransferHookY";
6008
+ },
6009
+ {
6010
+ "name": "TransferHookReward";
6011
+ }
6012
+ ];
6013
+ };
4495
6014
  }
4496
6015
  ];
4497
6016
  "events": [
@@ -4885,6 +6404,66 @@ type LbClmm = {
4885
6404
  }
4886
6405
  ];
4887
6406
  },
6407
+ {
6408
+ "name": "IncreasePositionLength";
6409
+ "fields": [
6410
+ {
6411
+ "name": "lbPair";
6412
+ "type": "publicKey";
6413
+ "index": false;
6414
+ },
6415
+ {
6416
+ "name": "position";
6417
+ "type": "publicKey";
6418
+ "index": false;
6419
+ },
6420
+ {
6421
+ "name": "owner";
6422
+ "type": "publicKey";
6423
+ "index": false;
6424
+ },
6425
+ {
6426
+ "name": "lengthToAdd";
6427
+ "type": "u16";
6428
+ "index": false;
6429
+ },
6430
+ {
6431
+ "name": "side";
6432
+ "type": "u8";
6433
+ "index": false;
6434
+ }
6435
+ ];
6436
+ },
6437
+ {
6438
+ "name": "DecreasePositionLength";
6439
+ "fields": [
6440
+ {
6441
+ "name": "lbPair";
6442
+ "type": "publicKey";
6443
+ "index": false;
6444
+ },
6445
+ {
6446
+ "name": "position";
6447
+ "type": "publicKey";
6448
+ "index": false;
6449
+ },
6450
+ {
6451
+ "name": "owner";
6452
+ "type": "publicKey";
6453
+ "index": false;
6454
+ },
6455
+ {
6456
+ "name": "lengthToRemove";
6457
+ "type": "u16";
6458
+ "index": false;
6459
+ },
6460
+ {
6461
+ "name": "side";
6462
+ "type": "u8";
6463
+ "index": false;
6464
+ }
6465
+ ];
6466
+ },
4888
6467
  {
4889
6468
  "name": "FeeParameterUpdate";
4890
6469
  "fields": [
@@ -5381,6 +6960,76 @@ type LbClmm = {
5381
6960
  "code": 6066;
5382
6961
  "name": "InvalidStatus";
5383
6962
  "msg": "Invalid status";
6963
+ },
6964
+ {
6965
+ "code": 6067;
6966
+ "name": "NotSupportMint";
6967
+ "msg": "Not support token_2022 mint extension";
6968
+ },
6969
+ {
6970
+ "code": 6068;
6971
+ "name": "UnsupportedMintExtension";
6972
+ "msg": "Unsupported mint extension";
6973
+ },
6974
+ {
6975
+ "code": 6069;
6976
+ "name": "UnsupportNativeMintToken2022";
6977
+ "msg": "Unsupported native mint token2022";
6978
+ },
6979
+ {
6980
+ "code": 6070;
6981
+ "name": "UnmatchTokenMint";
6982
+ "msg": "Unmatch token mint";
6983
+ },
6984
+ {
6985
+ "code": 6071;
6986
+ "name": "UnsupportedTokenMint";
6987
+ "msg": "Unsupported token mint";
6988
+ },
6989
+ {
6990
+ "code": 6072;
6991
+ "name": "InsufficientRemainingAccounts";
6992
+ "msg": "Insufficient remaining accounts";
6993
+ },
6994
+ {
6995
+ "code": 6073;
6996
+ "name": "InvalidRemainingAccountSlice";
6997
+ "msg": "Invalid remaining account slice";
6998
+ },
6999
+ {
7000
+ "code": 6074;
7001
+ "name": "DuplicatedRemainingAccountTypes";
7002
+ "msg": "Duplicated remaining account types";
7003
+ },
7004
+ {
7005
+ "code": 6075;
7006
+ "name": "MissingRemainingAccountForTransferHook";
7007
+ "msg": "Missing remaining account for transfer hook";
7008
+ },
7009
+ {
7010
+ "code": 6076;
7011
+ "name": "NoTransferHookProgram";
7012
+ "msg": "Remaining account was passed for transfer hook but there's no hook program";
7013
+ },
7014
+ {
7015
+ "code": 6077;
7016
+ "name": "ZeroFundedAmount";
7017
+ "msg": "Zero funded amount";
7018
+ },
7019
+ {
7020
+ "code": 6078;
7021
+ "name": "InvalidSide";
7022
+ "msg": "Invalid side";
7023
+ },
7024
+ {
7025
+ "code": 6079;
7026
+ "name": "InvalidResizeLength";
7027
+ "msg": "Invalid resize length";
7028
+ },
7029
+ {
7030
+ "code": 6080;
7031
+ "name": "NotSupportAtTheMoment";
7032
+ "msg": "Not support at the moment";
5384
7033
  }
5385
7034
  ];
5386
7035
  };
@@ -5394,8 +7043,10 @@ interface BinAndAmount {
5394
7043
  interface TokenReserve {
5395
7044
  publicKey: PublicKey;
5396
7045
  reserve: PublicKey;
7046
+ mint: Mint;
5397
7047
  amount: bigint;
5398
- decimal: number;
7048
+ owner: PublicKey;
7049
+ transferHookAccountMetas: AccountMeta[];
5399
7050
  }
5400
7051
  type ClmmProgram = Program<LbClmm>;
5401
7052
  type LbPair = IdlAccounts<LbClmm>["lbPair"];
@@ -5405,8 +7056,12 @@ type BinArray = IdlAccounts<LbClmm>["binArray"];
5405
7056
  type BinArrayAccount = ProgramAccount<IdlAccounts<LbClmm>["binArray"]>;
5406
7057
  type Position = IdlAccounts<LbClmm>["position"];
5407
7058
  type PositionV2 = IdlAccounts<LbClmm>["positionV2"];
7059
+ type PresetParameter = IdlAccounts<LbClmm>["presetParameter"];
7060
+ type PresetParameter2 = IdlAccounts<LbClmm>["presetParameter2"];
5408
7061
  type vParameters = IdlAccounts<LbClmm>["lbPair"]["vParameters"];
5409
7062
  type sParameters = IdlAccounts<LbClmm>["lbPair"]["parameters"];
7063
+ type UserRewardInfo = IdlTypes<LbClmm>["UserRewardInfo"];
7064
+ type UserFeeInfo = IdlTypes<LbClmm>["FeeInfo"];
5410
7065
  type InitPermissionPairIx = IdlTypes<LbClmm>["InitPermissionPairIx"];
5411
7066
  type InitCustomizablePermissionlessPairIx = IdlTypes<LbClmm>["CustomizableParams"];
5412
7067
  type BinLiquidityDistribution = IdlTypes<LbClmm>["BinLiquidityDistribution"];
@@ -5420,8 +7075,11 @@ type LiquidityParameterByStrategyOneSide = IdlTypes<LbClmm>["LiquidityParameterB
5420
7075
  type LiquidityParameter = IdlTypes<LbClmm>["LiquidityParameter"];
5421
7076
  type ProgramStrategyParameter = IdlTypes<LbClmm>["StrategyParameters"];
5422
7077
  type ProgramStrategyType = IdlTypes<LbClmm>["StrategyType"];
7078
+ type RemainingAccountInfo = IdlTypes<LbClmm>["RemainingAccountsInfo"];
7079
+ type RemainingAccountsInfoSlice = IdlTypes<LbClmm>["RemainingAccountsSlice"];
5423
7080
  type CompressedBinDepositAmount = IdlTypes<LbClmm>["CompressedBinDepositAmount"];
5424
7081
  type CompressedBinDepositAmounts = CompressedBinDepositAmount[];
7082
+ declare const POSITION_V2_DISC: Buffer;
5425
7083
  interface LbPosition {
5426
7084
  publicKey: PublicKey;
5427
7085
  positionData: PositionData;
@@ -5458,7 +7116,8 @@ interface LMRewards {
5458
7116
  }
5459
7117
  declare enum PositionVersion {
5460
7118
  V1 = 0,
5461
- V2 = 1
7119
+ V2 = 1,
7120
+ V3 = 2
5462
7121
  }
5463
7122
  declare enum PairType {
5464
7123
  Permissionless = 0,
@@ -5529,6 +7188,9 @@ interface BinLiquidity {
5529
7188
  version: number;
5530
7189
  price: string;
5531
7190
  pricePerToken: string;
7191
+ feeAmountXPerTokenStored: BN;
7192
+ feeAmountYPerTokenStored: BN;
7193
+ rewardPerTokenStored: BN[];
5532
7194
  }
5533
7195
  declare namespace BinLiquidity {
5534
7196
  function fromBin(bin: Bin, binId: number, binStep: number, baseTokenDecimal: number, quoteTokenDecimal: number, version: number): BinLiquidity;
@@ -5567,6 +7229,9 @@ interface PositionBinData {
5567
7229
  positionLiquidity: string;
5568
7230
  positionXAmount: string;
5569
7231
  positionYAmount: string;
7232
+ positionFeeXAmount: string;
7233
+ positionFeeYAmount: string;
7234
+ positionRewardAmount: string[];
5570
7235
  }
5571
7236
  interface PositionData {
5572
7237
  totalXAmount: string;
@@ -5582,6 +7247,13 @@ interface PositionData {
5582
7247
  feeOwner: PublicKey;
5583
7248
  totalClaimedFeeXAmount: BN;
5584
7249
  totalClaimedFeeYAmount: BN;
7250
+ feeXExcludeTransferFee: BN;
7251
+ feeYExcludeTransferFee: BN;
7252
+ rewardOneExcludeTransferFee: BN;
7253
+ rewardTwoExcludeTransferFee: BN;
7254
+ totalXAmountExcludeTransferFee: BN;
7255
+ totalYAmountExcludeTransferFee: BN;
7256
+ owner: PublicKey;
5585
7257
  }
5586
7258
  interface SwapWithPriceImpactParams {
5587
7259
  /**
@@ -5672,10 +7344,6 @@ declare enum BitmapType {
5672
7344
  U1024 = 0,
5673
7345
  U512 = 1
5674
7346
  }
5675
- interface SeedLiquidityResponse {
5676
- initializeBinArraysAndPositionIxs: TransactionInstruction[][];
5677
- addLiquidityIxs: TransactionInstruction[][];
5678
- }
5679
7347
  interface Clock {
5680
7348
  slot: BN;
5681
7349
  epochStartTimestamp: BN;
@@ -5688,6 +7356,11 @@ declare enum PairStatus {
5688
7356
  Enabled = 0,
5689
7357
  Disabled = 1
5690
7358
  }
7359
+ declare enum ActionType {
7360
+ Liquidity = 0,
7361
+ Reward = 1
7362
+ }
7363
+ declare const MEMO_PROGRAM_ID: PublicKey;
5691
7364
 
5692
7365
  type Opt = {
5693
7366
  cluster?: Cluster | "localhost";
@@ -5700,9 +7373,10 @@ declare class DLMM {
5700
7373
  binArrayBitmapExtension: BinArrayBitmapExtensionAccount | null;
5701
7374
  tokenX: TokenReserve;
5702
7375
  tokenY: TokenReserve;
7376
+ rewards: Array<TokenReserve | null>;
5703
7377
  clock: Clock;
5704
7378
  private opt?;
5705
- constructor(pubkey: PublicKey, program: ClmmProgram, lbPair: LbPair, binArrayBitmapExtension: BinArrayBitmapExtensionAccount | null, tokenX: TokenReserve, tokenY: TokenReserve, clock: Clock, opt?: Opt);
7379
+ constructor(pubkey: PublicKey, program: ClmmProgram, lbPair: LbPair, binArrayBitmapExtension: BinArrayBitmapExtensionAccount | null, tokenX: TokenReserve, tokenY: TokenReserve, rewards: Array<TokenReserve | null>, clock: Clock, opt?: Opt);
5706
7380
  /** Static public method */
5707
7381
  /**
5708
7382
  * The function `getLbPairs` retrieves a list of LB pair accounts using a connection and optional
@@ -5715,7 +7389,18 @@ declare class DLMM {
5715
7389
  * `LbPairAccount` objects.
5716
7390
  */
5717
7391
  static getLbPairs(connection: Connection, opt?: Opt): Promise<LbPairAccount[]>;
5718
- static getPairPubkeyIfExists(connection: Connection, tokenX: PublicKey, tokenY: PublicKey, binStep: BN, baseFactor: BN, opt?: Opt): Promise<PublicKey | null>;
7392
+ /**
7393
+ * Retrieves the public key of a LB pair if it exists.
7394
+ * @param connection The connection to the Solana cluster.
7395
+ * @param tokenX The mint address of token X.
7396
+ * @param tokenY The mint address of token Y.
7397
+ * @param binStep The bin step of the LB pair.
7398
+ * @param baseFactor The base factor of the LB pair.
7399
+ * @param baseFeePowerFactor The base fee power factor of the LB pair. It allow small bin step to have bigger fee rate.
7400
+ * @param opt Optional parameters.
7401
+ * @returns The public key of the LB pair if it exists, or null.
7402
+ */
7403
+ static getPairPubkeyIfExists(connection: Connection, tokenX: PublicKey, tokenY: PublicKey, binStep: BN, baseFactor: BN, baseFeePowerFactor: BN, opt?: Opt): Promise<PublicKey | null>;
5719
7404
  /**
5720
7405
  * The `create` function is a static method that creates a new instance of the `DLMM` class
5721
7406
  * @param {Connection} connection - The `connection` parameter is an instance of the `Connection`
@@ -5736,18 +7421,46 @@ declare class DLMM {
5736
7421
  * objects.
5737
7422
  */
5738
7423
  static createMultiple(connection: Connection, dlmmList: Array<PublicKey>, opt?: Opt): Promise<DLMM[]>;
5739
- static getAllPresetParameters(connection: Connection, opt?: Opt): Promise<_coral_xyz_anchor.ProgramAccount<{
5740
- binStep: number;
5741
- baseFactor: number;
5742
- filterPeriod: number;
5743
- decayPeriod: number;
5744
- reductionFactor: number;
5745
- variableFeeControl: number;
5746
- maxVolatilityAccumulator: number;
5747
- minBinId: number;
5748
- maxBinId: number;
5749
- protocolShare: number;
5750
- }>[]>;
7424
+ /**
7425
+ * The `getAllPresetParameters` function retrieves all preset parameter accounts
7426
+ * for the given DLMM program.
7427
+ *
7428
+ * @param {Connection} connection - The connection to the Solana cluster.
7429
+ * @param {Opt} [opt] - The optional parameters for the function.
7430
+ *
7431
+ * @returns A promise that resolves to an object containing the preset parameter
7432
+ * accounts, with the following properties:
7433
+ * - `presetParameter`: The preset parameter accounts for the original `PresetParameter` struct.
7434
+ * - `presetParameter2`: The preset parameter accounts for the `PresetParameter2` struct.
7435
+ */
7436
+ static getAllPresetParameters(connection: Connection, opt?: Opt): Promise<{
7437
+ presetParameter: _coral_xyz_anchor.ProgramAccount<{
7438
+ binStep: number;
7439
+ baseFactor: number;
7440
+ filterPeriod: number;
7441
+ decayPeriod: number;
7442
+ reductionFactor: number;
7443
+ variableFeeControl: number;
7444
+ maxVolatilityAccumulator: number;
7445
+ minBinId: number;
7446
+ maxBinId: number;
7447
+ protocolShare: number;
7448
+ }>[];
7449
+ presetParameter2: _coral_xyz_anchor.ProgramAccount<{
7450
+ binStep: number;
7451
+ baseFactor: number;
7452
+ filterPeriod: number;
7453
+ decayPeriod: number;
7454
+ variableFeeControl: number;
7455
+ maxVolatilityAccumulator: number;
7456
+ reductionFactor: number;
7457
+ protocolShare: number;
7458
+ index: number;
7459
+ baseFeePowerFactor: number;
7460
+ padding0: number;
7461
+ padding1: BN[];
7462
+ }>[];
7463
+ }>;
5751
7464
  /**
5752
7465
  * The function `getAllLbPairPositionsByUser` retrieves all liquidity pool pair positions for a given
5753
7466
  * user.
@@ -5763,9 +7476,66 @@ declare class DLMM {
5763
7476
  static getPricePerLamport(tokenXDecimal: number, tokenYDecimal: number, price: number): string;
5764
7477
  static getBinIdFromPrice(price: string | number | Decimal, binStep: number, min: boolean): number;
5765
7478
  /** Public methods */
5766
- static createPermissionLbPair(connection: Connection, binStep: BN, tokenX: PublicKey, tokenY: PublicKey, activeId: BN, baseKey: PublicKey, creatorKey: PublicKey, feeBps: BN, activationType: ActivationType, opt?: Opt): Promise<Transaction>;
7479
+ /**
7480
+ * Create a new customizable permissionless pair. Support both token and token 2022.
7481
+ * @param connection A connection to the Solana cluster.
7482
+ * @param binStep The bin step for the pair.
7483
+ * @param tokenX The mint of the first token.
7484
+ * @param tokenY The mint of the second token.
7485
+ * @param activeId The ID of the initial active bin. Represent the starting price.
7486
+ * @param feeBps The fee rate for swaps in the pair, in basis points.
7487
+ * @param activationType The type of activation for the pair.
7488
+ * @param hasAlphaVault Whether the pair has an alpha vault.
7489
+ * @param creatorKey The public key of the creator of the pair.
7490
+ * @param activationPoint The timestamp at which the pair will be activated.
7491
+ * @param opt An options object.
7492
+ * @returns A transaction that creates the pair.
7493
+ */
7494
+ static createCustomizablePermissionlessLbPair2(connection: Connection, binStep: BN, tokenX: PublicKey, tokenY: PublicKey, activeId: BN, feeBps: BN, activationType: ActivationType, hasAlphaVault: boolean, creatorKey: PublicKey, activationPoint?: BN, opt?: Opt): Promise<Transaction>;
7495
+ /**
7496
+ * Create a new customizable permissionless pair. Support only token program.
7497
+ * @param connection A connection to the Solana cluster.
7498
+ * @param binStep The bin step for the pair.
7499
+ * @param tokenX The mint of the first token.
7500
+ * @param tokenY The mint of the second token.
7501
+ * @param activeId The ID of the initial active bin. Represent the starting price.
7502
+ * @param feeBps The fee rate for swaps in the pair, in basis points.
7503
+ * @param activationType The type of activation for the pair.
7504
+ * @param hasAlphaVault Whether the pair has an alpha vault.
7505
+ * @param creatorKey The public key of the creator of the pair.
7506
+ * @param activationPoint The timestamp at which the pair will be activated.
7507
+ * @param opt An options object.
7508
+ * @returns A transaction that creates the pair.
7509
+ */
5767
7510
  static createCustomizablePermissionlessLbPair(connection: Connection, binStep: BN, tokenX: PublicKey, tokenY: PublicKey, activeId: BN, feeBps: BN, activationType: ActivationType, hasAlphaVault: boolean, creatorKey: PublicKey, activationPoint?: BN, opt?: Opt): Promise<Transaction>;
7511
+ /**
7512
+ * Create a new liquidity pair. Support only token program.
7513
+ * @param connection A connection to the Solana cluster.
7514
+ * @param funder The public key of the funder of the pair.
7515
+ * @param tokenX The mint of the first token.
7516
+ * @param tokenY The mint of the second token.
7517
+ * @param binStep The bin step for the pair.
7518
+ * @param baseFactor The base factor for the pair.
7519
+ * @param presetParameter The public key of the preset parameter account.
7520
+ * @param activeId The ID of the initial active bin. Represent the starting price.
7521
+ * @param opt An options object.
7522
+ * @returns A transaction that creates the pair.
7523
+ * @throws If the pair already exists.
7524
+ */
5768
7525
  static createLbPair(connection: Connection, funder: PublicKey, tokenX: PublicKey, tokenY: PublicKey, binStep: BN, baseFactor: BN, presetParameter: PublicKey, activeId: BN, opt?: Opt): Promise<Transaction>;
7526
+ /**
7527
+ * Create a new liquidity pair. Support both token and token2022 program.
7528
+ * @param connection A connection to the Solana cluster.
7529
+ * @param funder The public key of the funder of the pair.
7530
+ * @param tokenX The mint of the first token.
7531
+ * @param tokenY The mint of the second token.
7532
+ * @param presetParameter The public key of the preset parameter account.
7533
+ * @param activeId The ID of the initial active bin. Represent the starting price.
7534
+ * @param opt An options object.
7535
+ * @returns A transaction that creates the pair.
7536
+ * @throws If the pair already exists.
7537
+ */
7538
+ static createLbPair2(connection: Connection, funder: PublicKey, tokenX: PublicKey, tokenY: PublicKey, presetParameter: PublicKey, activeId: BN, opt?: Opt): Promise<Transaction>;
5769
7539
  /**
5770
7540
  * The function `refetchStates` retrieves and updates various states and data related to bin arrays
5771
7541
  * and lb pairs.
@@ -5785,7 +7555,15 @@ declare class DLMM {
5785
7555
  * @returns an array of `BinArrayAccount` objects.
5786
7556
  */
5787
7557
  getBinArrayForSwap(swapForY: any, count?: number): Promise<BinArrayAccount[]>;
5788
- static calculateFeeInfo(baseFactor: number | string, binStep: number | string): Omit<FeeInfo, "protocolFeePercentage">;
7558
+ /**
7559
+ * The function `calculateFeeInfo` calculates the base fee rate percentage and maximum fee rate percentage
7560
+ * given the base factor, bin step, and optional base fee power factor.
7561
+ * @param baseFactor - The base factor of the pair.
7562
+ * @param binStep - The bin step of the pair.
7563
+ * @param baseFeePowerFactor - Optional parameter to allow small bin step to have bigger fee rate. Default to 0.
7564
+ * @returns an object of type `Omit<FeeInfo, "protocolFeePercentage">` with the following properties: baseFeeRatePercentage and maxFeeRatePercentage.
7565
+ */
7566
+ static calculateFeeInfo(baseFactor: number | string, binStep: number | string, baseFeePowerFactor?: number | string): Omit<FeeInfo, "protocolFeePercentage">;
5789
7567
  /**
5790
7568
  * The function `getFeeInfo` calculates and returns the base fee rate percentage, maximum fee rate
5791
7569
  * percentage, and protocol fee percentage.
@@ -5935,11 +7713,12 @@ declare class DLMM {
5935
7713
  * - `strategy`: The strategy parameters to be used for the liquidity pool (Can use `calculateStrategyParameter` to calculate).
5936
7714
  * - `user`: The public key of the user account.
5937
7715
  * - `slippage`: The slippage percentage to be used for the liquidity pool.
5938
- * @returns {Promise<Transaction>} The function `initializePositionAndAddLiquidityByWeight` returns a `Promise` that
7716
+ * @returns {Promise<Transaction>} The function `initializePositionAndAddLiquidityByStrategy` returns a `Promise` that
5939
7717
  * resolves to either a single `Transaction` object.
5940
7718
  */
5941
7719
  initializePositionAndAddLiquidityByStrategy({ positionPubKey, totalXAmount, totalYAmount, strategy, user, slippage, }: TInitializePositionAndAddLiquidityParamsByStrategy): Promise<Transaction>;
5942
7720
  /**
7721
+ * @deprecated Use `initializePositionAndAddLiquidityByStrategy` instead which support both token and token2022.
5943
7722
  * The function `initializePositionAndAddLiquidityByWeight` function is used to initializes a position and adds liquidity
5944
7723
  * @param {TInitializePositionAndAddLiquidityParams}
5945
7724
  * - `positionPubKey`: The public key of the position account. (usually use `new Keypair()`)
@@ -5966,6 +7745,7 @@ declare class DLMM {
5966
7745
  */
5967
7746
  addLiquidityByStrategy({ positionPubKey, totalXAmount, totalYAmount, strategy, user, slippage, }: TInitializePositionAndAddLiquidityParamsByStrategy): Promise<Transaction>;
5968
7747
  /**
7748
+ * @deprecated Use `addLiquidityByStrategy` instead which support both token and token2022.
5969
7749
  * The `addLiquidityByWeight` function is used to add liquidity to existing position
5970
7750
  * @param {TInitializePositionAndAddLiquidityParams}
5971
7751
  * - `positionPubKey`: The public key of the position account. (usually use `new Keypair()`)
@@ -5984,18 +7764,27 @@ declare class DLMM {
5984
7764
  * @param
5985
7765
  * - `user`: The public key of the user account.
5986
7766
  * - `position`: The public key of the position account.
5987
- * - `binIds`: An array of numbers that represent the bin IDs to remove liquidity from.
7767
+ * - `fromBinId`: The ID of the starting bin to remove liquidity from. Must within position range.
7768
+ * - `toBinId`: The ID of the ending bin to remove liquidity from. Must within position range.
5988
7769
  * - `liquiditiesBpsToRemove`: An array of numbers (percentage) that represent the liquidity to remove from each bin.
5989
7770
  * - `shouldClaimAndClose`: A boolean flag that indicates whether to claim rewards and close the position.
5990
- * @returns {Promise<Transaction|Transaction[]>}
7771
+ * @returns {Promise<Transaction | Transaction[]>}
5991
7772
  */
5992
- removeLiquidity({ user, position, binIds, bps, shouldClaimAndClose, }: {
7773
+ removeLiquidity({ user, position, fromBinId, toBinId, bps, shouldClaimAndClose, }: {
5993
7774
  user: PublicKey;
5994
7775
  position: PublicKey;
5995
- binIds: number[];
7776
+ fromBinId: number;
7777
+ toBinId: number;
5996
7778
  bps: BN;
5997
7779
  shouldClaimAndClose?: boolean;
5998
7780
  }): Promise<Transaction | Transaction[]>;
7781
+ /**
7782
+ * The `closePositionIfEmpty` function closes a position if it is empty. Else, it does nothing.
7783
+ */
7784
+ closePositionIfEmpty({ owner, position, }: {
7785
+ owner: PublicKey;
7786
+ position: LbPosition;
7787
+ }): Promise<Transaction>;
5999
7788
  /**
6000
7789
  * The `closePosition` function closes a position
6001
7790
  * @param
@@ -6075,7 +7864,7 @@ declare class DLMM {
6075
7864
  * @param
6076
7865
  * - `owner`: The public key of the owner of the position.
6077
7866
  * - `position`: The public key of the position account.
6078
- * @returns {Promise<Transaction>}
7867
+ * @returns {Promise<Transaction>} Claim LM reward transactions.
6079
7868
  */
6080
7869
  claimLMReward({ owner, position, }: {
6081
7870
  owner: PublicKey;
@@ -6087,7 +7876,7 @@ declare class DLMM {
6087
7876
  * @param
6088
7877
  * - `owner`: The public key of the owner of the positions.
6089
7878
  * - `positions`: An array of objects of type `PositionData` that represents the positions to claim rewards from.
6090
- * @returns {Promise<Transaction[]>}
7879
+ * @returns {Promise<Transaction[]>} Array of claim LM reward and fees transactions.
6091
7880
  */
6092
7881
  claimAllLMRewards({ owner, positions, }: {
6093
7882
  owner: PublicKey;
@@ -6100,7 +7889,8 @@ declare class DLMM {
6100
7889
  * @param
6101
7890
  * - `owner`: The public key of the owner of the position.
6102
7891
  * - `position`: The public key of the position account.
6103
- * @returns {Promise<Transaction>}
7892
+ * - `binRange`: The bin range to claim swap fees for. If not provided, the function claim swap fees for full range.
7893
+ * @returns {Promise<Transaction>} Claim swap fee transactions.
6104
7894
  */
6105
7895
  claimSwapFee({ owner, position, }: {
6106
7896
  owner: PublicKey;
@@ -6111,7 +7901,7 @@ declare class DLMM {
6111
7901
  * @param
6112
7902
  * - `owner`: The public key of the owner of the positions.
6113
7903
  * - `positions`: An array of objects of type `PositionData` that represents the positions to claim swap fees from.
6114
- * @returns {Promise<Transaction[]>}
7904
+ * @returns {Promise<Transaction[]>} Array of claim swap fee transactions.
6115
7905
  */
6116
7906
  claimAllSwapFee({ owner, positions, }: {
6117
7907
  owner: PublicKey;
@@ -6123,41 +7913,12 @@ declare class DLMM {
6123
7913
  * @param
6124
7914
  * - `owner`: The public key of the owner of the position.
6125
7915
  * - `position`: The public key of the position account.
6126
- * @returns {Promise<Transaction[]>}
7916
+ * @returns {Promise<Transaction[]>} Array of claim reward transactions.
6127
7917
  */
6128
7918
  claimAllRewardsByPosition({ owner, position, }: {
6129
7919
  owner: PublicKey;
6130
7920
  position: LbPosition;
6131
7921
  }): Promise<Transaction[]>;
6132
- /**
6133
- * The `seedLiquidity` function create multiple grouped instructions. The grouped instructions will be either [initialize bin array + initialize position instructions] or [deposit instruction] combination.
6134
- * @param
6135
- * - `owner`: The public key of the positions owner.
6136
- * - `seedAmount`: Lamport amount to be seeded to the pool.
6137
- * - `minPrice`: Start price in UI format
6138
- * - `maxPrice`: End price in UI format
6139
- * - `base`: Base key
6140
- * @returns {Promise<SeedLiquidityResponse>}
6141
- */
6142
- seedLiquidity(owner: PublicKey, seedAmount: BN, curvature: number, minPrice: number, maxPrice: number, base: PublicKey): Promise<SeedLiquidityResponse>;
6143
- /**
6144
- * The `seedLiquidity` function create multiple grouped instructions. The grouped instructions will be either [initialize bin array + initialize position instructions] or [deposit instruction] combination.
6145
- * @param
6146
- * - `payer`: The public key of the tx payer.
6147
- * - `base`: Base key
6148
- * - `seedAmount`: Token X lamport amount to be seeded to the pool.
6149
- * - `price`: TokenX/TokenY Price in UI format
6150
- * - `roundingUp`: Whether to round up the price
6151
- * - `positionOwner`: The owner of the position
6152
- * - `feeOwner`: Position fee owner
6153
- * - `operator`: Operator of the position. Operator able to manage the position on behalf of the position owner. However, liquidity withdrawal issue by the operator can only send to the position owner.
6154
- * - `lockReleasePoint`: The lock release point of the position.
6155
- * - `shouldSeedPositionOwner` (optional): Whether to send 1 lamport amount of token X to the position owner to prove ownership.
6156
- *
6157
- * The returned instructions need to be executed sequentially if it was separated into multiple transactions.
6158
- * @returns {Promise<TransactionInstruction[]>}
6159
- */
6160
- seedLiquiditySingleBin(payer: PublicKey, base: PublicKey, seedAmount: BN, price: number, roundingUp: boolean, positionOwner: PublicKey, feeOwner: PublicKey, operator: PublicKey, lockReleasePoint: BN, shouldSeedPositionOwner?: boolean): Promise<TransactionInstruction[]>;
6161
7922
  /**
6162
7923
  * Initializes bin arrays for the given bin array indexes if it wasn't initialized.
6163
7924
  *
@@ -6194,7 +7955,7 @@ declare class DLMM {
6194
7955
  * @param
6195
7956
  * - `owner`: The public key of the owner of the positions.
6196
7957
  * - `positions`: An array of objects of type `PositionData` that represents the positions to claim swap fees and LM rewards from.
6197
- * @returns {Promise<Transaction[]>}
7958
+ * @returns {Promise<Transaction[]>} Array of claim swap fee and LM reward transactions.
6198
7959
  */
6199
7960
  claimAllRewards({ owner, positions, }: {
6200
7961
  owner: PublicKey;
@@ -6210,10 +7971,6 @@ declare class DLMM {
6210
7971
  */
6211
7972
  syncWithMarketPrice(marketPrice: number, owner: PublicKey): Promise<Transaction>;
6212
7973
  getMaxPriceInBinArrays(binArrayAccounts: BinArrayAccount[]): Promise<string>;
6213
- getAmountOutWithdrawSingleSide(maxLiquidityShare: BN, price: BN, bin: Bin, isWithdrawForY: boolean): {
6214
- withdrawAmount: BN;
6215
- };
6216
- getWithdrawSingleSideAmount(positionPubkey: PublicKey, isWithdrawForY: boolean): Promise<BN>;
6217
7974
  /**
6218
7975
  *
6219
7976
  * @param swapInitiator Address of the swap initiator
@@ -6222,8 +7979,6 @@ declare class DLMM {
6222
7979
  isSwapDisabled(swapInitiator: PublicKey): boolean;
6223
7980
  /** Private static method */
6224
7981
  private static getBinArrays;
6225
- private static getClaimableLMReward;
6226
- private static getClaimableSwapFee;
6227
7982
  private static processPosition;
6228
7983
  private static getBinsBetweenLowerAndUpperBound;
6229
7984
  /** Private method */
@@ -6235,9 +7990,12 @@ declare class DLMM {
6235
7990
  private updateReference;
6236
7991
  private createClaimBuildMethod;
6237
7992
  private createClaimSwapFeeMethod;
7993
+ private getPotentialToken2022IxDataAndAccounts;
6238
7994
  }
6239
7995
 
6240
7996
  /** private */
7997
+ declare function derivePresetParameterWithIndex(index: BN, programId: PublicKey): [PublicKey, number];
7998
+ declare function deriveLbPairWithPresetParamWithIndexKey(presetParameterKey: PublicKey, tokenX: PublicKey, tokenY: PublicKey, programId: PublicKey): [PublicKey, number];
6241
7999
  /**
6242
8000
  *
6243
8001
  * @deprecated Use derivePresetParameter2
@@ -6256,6 +8014,9 @@ declare function deriveOracle(lbPair: PublicKey, programId: PublicKey): [PublicK
6256
8014
  declare function derivePosition(lbPair: PublicKey, base: PublicKey, lowerBinId: BN, width: BN, programId: PublicKey): [PublicKey, number];
6257
8015
  declare function deriveBinArray(lbPair: PublicKey, index: BN, programId: PublicKey): [PublicKey, number];
6258
8016
  declare function deriveReserve(token: PublicKey, lbPair: PublicKey, programId: PublicKey): [PublicKey, number];
8017
+ declare function deriveTokenBadge(mint: PublicKey, programId: PublicKey): [PublicKey, number];
8018
+ declare function deriveEventAuthority(programId: PublicKey): [PublicKey, number];
8019
+ declare function deriveRewardVault(lbPair: PublicKey, rewardIndex: BN, programId: PublicKey): [PublicKey, number];
6259
8020
 
6260
8021
  /** private */
6261
8022
  declare function isOverflowDefaultBinArrayBitmap(binArrayIndex: BN): boolean;
@@ -6305,17 +8066,44 @@ declare function calculateNormalDistribution(activeBin: number, binIds: number[]
6305
8066
  xAmountBpsOfTotal: BN;
6306
8067
  yAmountBpsOfTotal: BN;
6307
8068
  }[];
8069
+ /**
8070
+ * Converts a weight distribution into token amounts for one side (either bid or ask).
8071
+ *
8072
+ * @param amount - The total amount of liquidity to distribute.
8073
+ * @param distributions - The array of weight distributions for each bin.
8074
+ * @param binStep - The step interval between bin ids.
8075
+ * @param activeId - The id of the active bin.
8076
+ * @param depositForY - Flag indicating if the deposit is for token Y (bid side).
8077
+ * @param mint - Mint information for the token. Mint Y if depositForY is true, else Mint X. Get from DLMM instance.
8078
+ * @param clock - Clock instance for the current epoch. Get from DLMM instance.
8079
+ * @returns An array of objects containing binId and amount for each bin.
8080
+ */
6308
8081
  declare function fromWeightDistributionToAmountOneSide(amount: BN, distributions: {
6309
8082
  binId: number;
6310
8083
  weight: number;
6311
- }[], binStep: number, activeId: number, depositForY: boolean): {
8084
+ }[], binStep: number, activeId: number, depositForY: boolean, mint: Mint, clock: Clock): {
6312
8085
  binId: number;
6313
8086
  amount: BN;
6314
8087
  }[];
8088
+ /**
8089
+ * Converts a weight distribution into token amounts for both bid and ask sides.
8090
+ *
8091
+ * @param amountX - The total amount of token X to distribute.
8092
+ * @param amountY - The total amount of token Y to distribute.
8093
+ * @param distributions - The array of weight distributions for each bin.
8094
+ * @param binStep - The step interval between bin ids.
8095
+ * @param activeId - The id of the active bin.
8096
+ * @param amountXInActiveBin - The amount of token X in the active bin.
8097
+ * @param amountYInActiveBin - The amount of token Y in the active bin.
8098
+ * @param mintX - Mint information for token X. Get from DLMM instance.
8099
+ * @param mintY - Mint information for token Y. Get from DLMM instance.
8100
+ * @param clock - Clock instance for the current epoch. Get from DLMM instance.
8101
+ * @returns An array of objects containing binId, amountX, and amountY for each bin.
8102
+ */
6315
8103
  declare function fromWeightDistributionToAmount(amountX: BN, amountY: BN, distributions: {
6316
8104
  binId: number;
6317
8105
  weight: number;
6318
- }[], binStep: number, activeId: number, amountXInActiveBin: BN, amountYInActiveBin: BN): {
8106
+ }[], binStep: number, activeId: number, amountXInActiveBin: BN, amountYInActiveBin: BN, mintX: Mint, mintY: Mint, clock: Clock): {
6319
8107
  binId: number;
6320
8108
  amountX: BN;
6321
8109
  amountY: BN;
@@ -6340,24 +8128,58 @@ declare function swapExactInQuoteAtBin(bin: Bin, binStep: number, sParameter: sP
6340
8128
  protocolFee: BN;
6341
8129
  };
6342
8130
 
8131
+ /**
8132
+ * Distribute totalAmount to all bid side bins according to given distributions.
8133
+ * @param activeId active bin id
8134
+ * @param totalAmount total amount of token Y to be distributed
8135
+ * @param distributions weight distribution of each bin
8136
+ * @param mintY mint of token Y, get from DLMM instance
8137
+ * @param clock clock of the program, for calculating transfer fee, get from DLMM instance
8138
+ * @returns array of {binId, amount} where amount is the amount of token Y in each bin
8139
+ */
6343
8140
  declare function toAmountBidSide(activeId: number, totalAmount: BN, distributions: {
6344
8141
  binId: number;
6345
8142
  weight: number;
6346
- }[]): {
8143
+ }[], mintY: Mint, clock: Clock): {
6347
8144
  binId: number;
6348
8145
  amount: BN;
6349
8146
  }[];
8147
+ /**
8148
+ * Distribute totalAmount to all ask side bins according to given distributions.
8149
+ * @param activeId active bin id
8150
+ * @param totalAmount total amount of token Y to be distributed
8151
+ * @param distributions weight distribution of each bin
8152
+ * @param mintX mint of token X, get from DLMM instance
8153
+ * @param clock clock of the program, for calculating transfer fee, get from DLMM instance
8154
+ * @returns array of {binId, amount} where amount is the amount of token X in each bin
8155
+ */
6350
8156
  declare function toAmountAskSide(activeId: number, binStep: number, totalAmount: BN, distributions: {
6351
8157
  binId: number;
6352
8158
  weight: number;
6353
- }[]): {
8159
+ }[], mintX: Mint, clock: Clock): {
6354
8160
  binId: number;
6355
8161
  amount: BN;
6356
8162
  }[];
8163
+ /**
8164
+ * Distributes the given amounts of tokens X and Y to both bid and ask side bins
8165
+ * based on the provided weight distributions.
8166
+ *
8167
+ * @param activeId - The id of the active bin.
8168
+ * @param binStep - The step interval between bin ids.
8169
+ * @param amountX - Total amount of token X to distribute.
8170
+ * @param amountY - Total amount of token Y to distribute.
8171
+ * @param amountXInActiveBin - Amount of token X already in the active bin.
8172
+ * @param amountYInActiveBin - Amount of token Y already in the active bin.
8173
+ * @param distributions - Array of bins with their respective weight distributions.
8174
+ * @param mintX - Mint information for token X. Get from DLMM instance.
8175
+ * @param mintY - Mint information for token Y. Get from DLMM instance.
8176
+ * @param clock - Clock instance. Get from DLMM instance.
8177
+ * @returns An array of objects containing binId, amountX, and amountY for each bin.
8178
+ */
6357
8179
  declare function toAmountBothSide(activeId: number, binStep: number, amountX: BN, amountY: BN, amountXInActiveBin: BN, amountYInActiveBin: BN, distributions: {
6358
8180
  binId: number;
6359
8181
  weight: number;
6360
- }[]): {
8182
+ }[], mintX: Mint, mintY: Mint, clock: Clock): {
6361
8183
  binId: number;
6362
8184
  amountX: BN;
6363
8185
  amountY: BN;
@@ -6371,7 +8193,23 @@ declare function autoFillXByWeight(activeId: number, binStep: number, amountY: B
6371
8193
  weight: number;
6372
8194
  }[]): BN;
6373
8195
 
6374
- declare function toAmountsBothSideByStrategy(activeId: number, binStep: number, minBinId: number, maxBinId: number, amountX: BN, amountY: BN, amountXInActiveBin: BN, amountYInActiveBin: BN, strategyType: StrategyType): {
8196
+ /**
8197
+ * Given a strategy type and amounts of X and Y, returns the distribution of liquidity.
8198
+ * @param activeId The bin id of the active bin.
8199
+ * @param binStep The step size of each bin.
8200
+ * @param minBinId The min bin id.
8201
+ * @param maxBinId The max bin id.
8202
+ * @param amountX The amount of X token to deposit.
8203
+ * @param amountY The amount of Y token to deposit.
8204
+ * @param amountXInActiveBin The amount of X token in the active bin.
8205
+ * @param amountYInActiveBin The amount of Y token in the active bin.
8206
+ * @param strategyType The strategy type.
8207
+ * @param mintX The mint info of X token. Get from DLMM instance.
8208
+ * @param mintY The mint info of Y token. Get from DLMM instance.
8209
+ * @param clock The clock info. Get from DLMM instance.
8210
+ * @returns The distribution of liquidity.
8211
+ */
8212
+ declare function toAmountsBothSideByStrategy(activeId: number, binStep: number, minBinId: number, maxBinId: number, amountX: BN, amountY: BN, amountXInActiveBin: BN, amountYInActiveBin: BN, strategyType: StrategyType, mintX: Mint, mintY: Mint, clock: Clock): {
6375
8213
  binId: number;
6376
8214
  amountX: BN;
6377
8215
  amountY: BN;
@@ -6460,10 +8298,15 @@ declare function toStrategyParameters({ maxBinId, minBinId, strategyType, single
6460
8298
  */
6461
8299
  declare function getTokensMintFromPoolAddress(connection: Connection, poolAddress: string, opt?: {
6462
8300
  cluster?: Cluster;
8301
+ programId?: PublicKey;
6463
8302
  }): Promise<{
6464
8303
  tokenXMint: PublicKey;
6465
8304
  tokenYMint: PublicKey;
6466
8305
  }>;
8306
+ declare function getTokenProgramId(lbPairState: LbPair): {
8307
+ tokenXProgram: PublicKey;
8308
+ tokenYProgram: PublicKey;
8309
+ };
6467
8310
 
6468
8311
  declare function chunks<T>(array: T[], size: number): T[][];
6469
8312
  declare function range<T>(min: number, max: number, mapfn: (i: number) => T): T[];
@@ -6478,6 +8321,7 @@ declare function chunkedFetchMultiplePoolAccount(program: ClmmProgram, pks: Publ
6478
8321
  minBinId: number;
6479
8322
  maxBinId: number;
6480
8323
  protocolShare: number;
8324
+ baseFeePowerFactor: number;
6481
8325
  padding: number[];
6482
8326
  };
6483
8327
  vParameters: {
@@ -6528,6 +8372,8 @@ declare function chunkedFetchMultiplePoolAccount(program: ClmmProgram, pks: Publ
6528
8372
  padding3: number[];
6529
8373
  padding4: BN;
6530
8374
  creator: PublicKey;
8375
+ tokenMintXProgramFlag: number;
8376
+ tokenMintYProgramFlag: number;
6531
8377
  reserved: number[];
6532
8378
  }[]>;
6533
8379
  declare function chunkedFetchMultipleBinArrayBitmapExtensionAccount(program: ClmmProgram, pks: PublicKey[], chunkSize?: number): Promise<{
@@ -6537,7 +8383,7 @@ declare function chunkedFetchMultipleBinArrayBitmapExtensionAccount(program: Clm
6537
8383
  }[]>;
6538
8384
  declare function getOutAmount(bin: Bin, inAmount: BN, swapForY: boolean): BN;
6539
8385
  declare function getTokenDecimals(conn: Connection, mint: PublicKey): Promise<number>;
6540
- declare const getOrCreateATAInstruction: (connection: Connection, tokenMint: PublicKey, owner: PublicKey, payer?: PublicKey, allowOwnerOffCurve?: boolean) => Promise<GetOrCreateATAResponse>;
8386
+ declare const getOrCreateATAInstruction: (connection: Connection, tokenMint: PublicKey, owner: PublicKey, programId?: PublicKey, payer?: PublicKey, allowOwnerOffCurve?: boolean) => Promise<GetOrCreateATAResponse>;
6541
8387
  declare function getTokenBalance(conn: Connection, tokenAccount: PublicKey): Promise<bigint>;
6542
8388
  declare const parseLogs: <T>(eventParser: EventParser, logs: string[]) => T;
6543
8389
  declare const wrapSOLInstruction: (from: PublicKey, to: PublicKey, amount: bigint) => TransactionInstruction[];
@@ -6611,4 +8457,4 @@ declare const MAX_BIN_PER_TX = 69;
6611
8457
  declare const MAX_ACTIVE_BIN_SLIPPAGE = 3;
6612
8458
  declare const ILM_BASE: PublicKey;
6613
8459
 
6614
- export { ADMIN, ActivationType, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, Clock, ClockLayout, CompressedBinDepositAmount, CompressedBinDepositAmounts, DLMMError, DlmmSdkError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, IDL, ILM_BASE, InitCustomizablePermissionlessPairIx, InitPermissionPairIx, LBCLMM_PROGRAM_IDS, LMRewards, LbClmm, LbPair, LbPairAccount, LbPosition, LiquidityOneSideParameter, LiquidityParameter, LiquidityParameterByStrategy, LiquidityParameterByStrategyOneSide, LiquidityParameterByWeight, MAX_ACTIVE_BIN_SLIPPAGE, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_BIN_PER_POSITION, MAX_BIN_PER_TX, MAX_CLAIM_ALL_ALLOWED, MAX_FEE_RATE, Network, POSITION_FEE, PRECISION, PairStatus, PairType, Position, PositionBinData, PositionData, PositionInfo, PositionV2, PositionVersion, ProgramStrategyParameter, ProgramStrategyType, SCALE, SCALE_OFFSET, SIMULATION_USER, SeedLiquidityResponse, Strategy, StrategyParameters, StrategyType, SwapExactOutParams, SwapFee, SwapParams, SwapQuote, SwapQuoteExactOut, SwapWithPriceImpactParams, TInitializePositionAndAddLiquidityParams, TInitializePositionAndAddLiquidityParamsByStrategy, TQuoteCreatePositionParams, TokenReserve, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, binIdToBinArrayIndex, calculateBidAskDistribution, calculateNormalDistribution, calculateSpotDistribution, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveCustomizablePermissionlessLbPair, deriveLbPair, deriveLbPair2, deriveOracle, derivePermissionLbPair, derivePosition, derivePresetParameter, derivePresetParameter2, deriveReserve, enumerateBins, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getBaseFee, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinFromBinArray, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parseLogs, range, sParameters, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountsBothSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };
8460
+ export { ADMIN, ActionType, ActivationType, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, Clock, ClockLayout, CompressedBinDepositAmount, CompressedBinDepositAmounts, DLMMError, DlmmSdkError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, IDL, ILM_BASE, InitCustomizablePermissionlessPairIx, InitPermissionPairIx, LBCLMM_PROGRAM_IDS, LMRewards, LbClmm, LbPair, LbPairAccount, LbPosition, LiquidityOneSideParameter, LiquidityParameter, LiquidityParameterByStrategy, LiquidityParameterByStrategyOneSide, LiquidityParameterByWeight, MAX_ACTIVE_BIN_SLIPPAGE, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_BIN_PER_POSITION, MAX_BIN_PER_TX, MAX_CLAIM_ALL_ALLOWED, MAX_FEE_RATE, MEMO_PROGRAM_ID, Network, POSITION_FEE, POSITION_V2_DISC, PRECISION, PairStatus, PairType, Position, PositionBinData, PositionData, PositionInfo, PositionV2, PositionVersion, PresetParameter, PresetParameter2, ProgramStrategyParameter, ProgramStrategyType, RemainingAccountInfo, RemainingAccountsInfoSlice, SCALE, SCALE_OFFSET, SIMULATION_USER, Strategy, StrategyParameters, StrategyType, SwapExactOutParams, SwapFee, SwapParams, SwapQuote, SwapQuoteExactOut, SwapWithPriceImpactParams, TInitializePositionAndAddLiquidityParams, TInitializePositionAndAddLiquidityParamsByStrategy, TQuoteCreatePositionParams, TokenReserve, UserFeeInfo, UserRewardInfo, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, binIdToBinArrayIndex, calculateBidAskDistribution, calculateNormalDistribution, calculateSpotDistribution, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveCustomizablePermissionlessLbPair, deriveEventAuthority, deriveLbPair, deriveLbPair2, deriveLbPairWithPresetParamWithIndexKey, deriveOracle, derivePermissionLbPair, derivePosition, derivePresetParameter, derivePresetParameter2, derivePresetParameterWithIndex, deriveReserve, deriveRewardVault, deriveTokenBadge, enumerateBins, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getBaseFee, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinFromBinArray, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTokenProgramId, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parseLogs, range, sParameters, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountsBothSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };