@meteora-ag/dlmm 1.3.9 → 1.3.10
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 +138 -7
- package/dist/index.js +140 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +140 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { PublicKey, TransactionInstruction, Connection, Transaction, Cluster } f
|
|
|
5
5
|
import Decimal from 'decimal.js';
|
|
6
6
|
|
|
7
7
|
type LbClmm = {
|
|
8
|
-
"version": "0.8.
|
|
8
|
+
"version": "0.8.5";
|
|
9
9
|
"name": "lb_clmm";
|
|
10
10
|
"constants": [
|
|
11
11
|
{
|
|
@@ -93,6 +93,16 @@ type LbClmm = {
|
|
|
93
93
|
};
|
|
94
94
|
"value": "15";
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
"name": "ILM_PROTOCOL_SHARE";
|
|
98
|
+
"type": "u16";
|
|
99
|
+
"value": "2000";
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "PROTOCOL_SHARE";
|
|
103
|
+
"type": "u16";
|
|
104
|
+
"value": "500";
|
|
105
|
+
},
|
|
96
106
|
{
|
|
97
107
|
"name": "MAX_BIN_STEP";
|
|
98
108
|
"type": "u16";
|
|
@@ -365,7 +375,7 @@ type LbClmm = {
|
|
|
365
375
|
"isSigner": false;
|
|
366
376
|
},
|
|
367
377
|
{
|
|
368
|
-
"name": "
|
|
378
|
+
"name": "userTokenY";
|
|
369
379
|
"isMut": false;
|
|
370
380
|
"isSigner": false;
|
|
371
381
|
},
|
|
@@ -1944,7 +1954,40 @@ type LbClmm = {
|
|
|
1944
1954
|
"args": [];
|
|
1945
1955
|
},
|
|
1946
1956
|
{
|
|
1947
|
-
"name": "
|
|
1957
|
+
"name": "updateBaseFeeParameters";
|
|
1958
|
+
"accounts": [
|
|
1959
|
+
{
|
|
1960
|
+
"name": "lbPair";
|
|
1961
|
+
"isMut": true;
|
|
1962
|
+
"isSigner": false;
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
"name": "admin";
|
|
1966
|
+
"isMut": false;
|
|
1967
|
+
"isSigner": true;
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
"name": "eventAuthority";
|
|
1971
|
+
"isMut": false;
|
|
1972
|
+
"isSigner": false;
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
"name": "program";
|
|
1976
|
+
"isMut": false;
|
|
1977
|
+
"isSigner": false;
|
|
1978
|
+
}
|
|
1979
|
+
];
|
|
1980
|
+
"args": [
|
|
1981
|
+
{
|
|
1982
|
+
"name": "feeParameter";
|
|
1983
|
+
"type": {
|
|
1984
|
+
"defined": "BaseFeeParameter";
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
];
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
"name": "updateDynamicFeeParameters";
|
|
1948
1991
|
"accounts": [
|
|
1949
1992
|
{
|
|
1950
1993
|
"name": "lbPair";
|
|
@@ -1971,7 +2014,7 @@ type LbClmm = {
|
|
|
1971
2014
|
{
|
|
1972
2015
|
"name": "feeParameter";
|
|
1973
2016
|
"type": {
|
|
1974
|
-
"defined": "
|
|
2017
|
+
"defined": "DynamicFeeParameter";
|
|
1975
2018
|
};
|
|
1976
2019
|
}
|
|
1977
2020
|
];
|
|
@@ -2154,7 +2197,7 @@ type LbClmm = {
|
|
|
2154
2197
|
"args": [];
|
|
2155
2198
|
},
|
|
2156
2199
|
{
|
|
2157
|
-
"name": "
|
|
2200
|
+
"name": "setPairStatus";
|
|
2158
2201
|
"accounts": [
|
|
2159
2202
|
{
|
|
2160
2203
|
"name": "lbPair";
|
|
@@ -2167,7 +2210,12 @@ type LbClmm = {
|
|
|
2167
2210
|
"isSigner": true;
|
|
2168
2211
|
}
|
|
2169
2212
|
];
|
|
2170
|
-
"args": [
|
|
2213
|
+
"args": [
|
|
2214
|
+
{
|
|
2215
|
+
"name": "status";
|
|
2216
|
+
"type": "u8";
|
|
2217
|
+
}
|
|
2218
|
+
];
|
|
2171
2219
|
},
|
|
2172
2220
|
{
|
|
2173
2221
|
"name": "migratePosition";
|
|
@@ -3428,7 +3476,7 @@ type LbClmm = {
|
|
|
3428
3476
|
};
|
|
3429
3477
|
},
|
|
3430
3478
|
{
|
|
3431
|
-
"name": "
|
|
3479
|
+
"name": "BaseFeeParameter";
|
|
3432
3480
|
"type": {
|
|
3433
3481
|
"kind": "struct";
|
|
3434
3482
|
"fields": [
|
|
@@ -3449,6 +3497,49 @@ type LbClmm = {
|
|
|
3449
3497
|
];
|
|
3450
3498
|
};
|
|
3451
3499
|
},
|
|
3500
|
+
{
|
|
3501
|
+
"name": "DynamicFeeParameter";
|
|
3502
|
+
"type": {
|
|
3503
|
+
"kind": "struct";
|
|
3504
|
+
"fields": [
|
|
3505
|
+
{
|
|
3506
|
+
"name": "filterPeriod";
|
|
3507
|
+
"docs": [
|
|
3508
|
+
"Filter period determine high frequency trading time window."
|
|
3509
|
+
];
|
|
3510
|
+
"type": "u16";
|
|
3511
|
+
},
|
|
3512
|
+
{
|
|
3513
|
+
"name": "decayPeriod";
|
|
3514
|
+
"docs": [
|
|
3515
|
+
"Decay period determine when the volatile fee start decay / decrease."
|
|
3516
|
+
];
|
|
3517
|
+
"type": "u16";
|
|
3518
|
+
},
|
|
3519
|
+
{
|
|
3520
|
+
"name": "reductionFactor";
|
|
3521
|
+
"docs": [
|
|
3522
|
+
"Reduction factor controls the volatile fee rate decrement rate."
|
|
3523
|
+
];
|
|
3524
|
+
"type": "u16";
|
|
3525
|
+
},
|
|
3526
|
+
{
|
|
3527
|
+
"name": "variableFeeControl";
|
|
3528
|
+
"docs": [
|
|
3529
|
+
"Used to scale the variable fee component depending on the dynamic of the market"
|
|
3530
|
+
];
|
|
3531
|
+
"type": "u32";
|
|
3532
|
+
},
|
|
3533
|
+
{
|
|
3534
|
+
"name": "maxVolatilityAccumulator";
|
|
3535
|
+
"docs": [
|
|
3536
|
+
"Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate."
|
|
3537
|
+
];
|
|
3538
|
+
"type": "u32";
|
|
3539
|
+
}
|
|
3540
|
+
];
|
|
3541
|
+
};
|
|
3542
|
+
},
|
|
3452
3543
|
{
|
|
3453
3544
|
"name": "LiquidityParameterByStrategyOneSide";
|
|
3454
3545
|
"type": {
|
|
@@ -4814,6 +4905,41 @@ type LbClmm = {
|
|
|
4814
4905
|
}
|
|
4815
4906
|
];
|
|
4816
4907
|
},
|
|
4908
|
+
{
|
|
4909
|
+
"name": "DynamicFeeParameterUpdate";
|
|
4910
|
+
"fields": [
|
|
4911
|
+
{
|
|
4912
|
+
"name": "lbPair";
|
|
4913
|
+
"type": "publicKey";
|
|
4914
|
+
"index": false;
|
|
4915
|
+
},
|
|
4916
|
+
{
|
|
4917
|
+
"name": "filterPeriod";
|
|
4918
|
+
"type": "u16";
|
|
4919
|
+
"index": false;
|
|
4920
|
+
},
|
|
4921
|
+
{
|
|
4922
|
+
"name": "decayPeriod";
|
|
4923
|
+
"type": "u16";
|
|
4924
|
+
"index": false;
|
|
4925
|
+
},
|
|
4926
|
+
{
|
|
4927
|
+
"name": "reductionFactor";
|
|
4928
|
+
"type": "u16";
|
|
4929
|
+
"index": false;
|
|
4930
|
+
},
|
|
4931
|
+
{
|
|
4932
|
+
"name": "variableFeeControl";
|
|
4933
|
+
"type": "u32";
|
|
4934
|
+
"index": false;
|
|
4935
|
+
},
|
|
4936
|
+
{
|
|
4937
|
+
"name": "maxVolatilityAccumulator";
|
|
4938
|
+
"type": "u32";
|
|
4939
|
+
"index": false;
|
|
4940
|
+
}
|
|
4941
|
+
];
|
|
4942
|
+
},
|
|
4817
4943
|
{
|
|
4818
4944
|
"name": "IncreaseObservation";
|
|
4819
4945
|
"fields": [
|
|
@@ -5250,6 +5376,11 @@ type LbClmm = {
|
|
|
5250
5376
|
"code": 6065;
|
|
5251
5377
|
"name": "AlreadyPassPreActivationSwapPoint";
|
|
5252
5378
|
"msg": "Already pass pre-activation swap point";
|
|
5379
|
+
},
|
|
5380
|
+
{
|
|
5381
|
+
"code": 6066;
|
|
5382
|
+
"name": "InvalidStatus";
|
|
5383
|
+
"msg": "Invalid status";
|
|
5253
5384
|
}
|
|
5254
5385
|
];
|
|
5255
5386
|
};
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var _decimaljs = require('decimal.js'); var _decimaljs2 = _interopRequireDefault
|
|
|
25
25
|
|
|
26
26
|
// src/dlmm/idl.ts
|
|
27
27
|
var IDL = {
|
|
28
|
-
"version": "0.8.
|
|
28
|
+
"version": "0.8.5",
|
|
29
29
|
"name": "lb_clmm",
|
|
30
30
|
"constants": [
|
|
31
31
|
{
|
|
@@ -113,6 +113,16 @@ var IDL = {
|
|
|
113
113
|
},
|
|
114
114
|
"value": "15"
|
|
115
115
|
},
|
|
116
|
+
{
|
|
117
|
+
"name": "ILM_PROTOCOL_SHARE",
|
|
118
|
+
"type": "u16",
|
|
119
|
+
"value": "2000"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "PROTOCOL_SHARE",
|
|
123
|
+
"type": "u16",
|
|
124
|
+
"value": "500"
|
|
125
|
+
},
|
|
116
126
|
{
|
|
117
127
|
"name": "MAX_BIN_STEP",
|
|
118
128
|
"type": "u16",
|
|
@@ -385,7 +395,7 @@ var IDL = {
|
|
|
385
395
|
"isSigner": false
|
|
386
396
|
},
|
|
387
397
|
{
|
|
388
|
-
"name": "
|
|
398
|
+
"name": "userTokenY",
|
|
389
399
|
"isMut": false,
|
|
390
400
|
"isSigner": false
|
|
391
401
|
},
|
|
@@ -1964,7 +1974,7 @@ var IDL = {
|
|
|
1964
1974
|
"args": []
|
|
1965
1975
|
},
|
|
1966
1976
|
{
|
|
1967
|
-
"name": "
|
|
1977
|
+
"name": "updateBaseFeeParameters",
|
|
1968
1978
|
"accounts": [
|
|
1969
1979
|
{
|
|
1970
1980
|
"name": "lbPair",
|
|
@@ -1991,7 +2001,40 @@ var IDL = {
|
|
|
1991
2001
|
{
|
|
1992
2002
|
"name": "feeParameter",
|
|
1993
2003
|
"type": {
|
|
1994
|
-
"defined": "
|
|
2004
|
+
"defined": "BaseFeeParameter"
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
]
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
"name": "updateDynamicFeeParameters",
|
|
2011
|
+
"accounts": [
|
|
2012
|
+
{
|
|
2013
|
+
"name": "lbPair",
|
|
2014
|
+
"isMut": true,
|
|
2015
|
+
"isSigner": false
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
"name": "admin",
|
|
2019
|
+
"isMut": false,
|
|
2020
|
+
"isSigner": true
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
"name": "eventAuthority",
|
|
2024
|
+
"isMut": false,
|
|
2025
|
+
"isSigner": false
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
"name": "program",
|
|
2029
|
+
"isMut": false,
|
|
2030
|
+
"isSigner": false
|
|
2031
|
+
}
|
|
2032
|
+
],
|
|
2033
|
+
"args": [
|
|
2034
|
+
{
|
|
2035
|
+
"name": "feeParameter",
|
|
2036
|
+
"type": {
|
|
2037
|
+
"defined": "DynamicFeeParameter"
|
|
1995
2038
|
}
|
|
1996
2039
|
}
|
|
1997
2040
|
]
|
|
@@ -2174,7 +2217,7 @@ var IDL = {
|
|
|
2174
2217
|
"args": []
|
|
2175
2218
|
},
|
|
2176
2219
|
{
|
|
2177
|
-
"name": "
|
|
2220
|
+
"name": "setPairStatus",
|
|
2178
2221
|
"accounts": [
|
|
2179
2222
|
{
|
|
2180
2223
|
"name": "lbPair",
|
|
@@ -2187,7 +2230,12 @@ var IDL = {
|
|
|
2187
2230
|
"isSigner": true
|
|
2188
2231
|
}
|
|
2189
2232
|
],
|
|
2190
|
-
"args": [
|
|
2233
|
+
"args": [
|
|
2234
|
+
{
|
|
2235
|
+
"name": "status",
|
|
2236
|
+
"type": "u8"
|
|
2237
|
+
}
|
|
2238
|
+
]
|
|
2191
2239
|
},
|
|
2192
2240
|
{
|
|
2193
2241
|
"name": "migratePosition",
|
|
@@ -3448,7 +3496,7 @@ var IDL = {
|
|
|
3448
3496
|
}
|
|
3449
3497
|
},
|
|
3450
3498
|
{
|
|
3451
|
-
"name": "
|
|
3499
|
+
"name": "BaseFeeParameter",
|
|
3452
3500
|
"type": {
|
|
3453
3501
|
"kind": "struct",
|
|
3454
3502
|
"fields": [
|
|
@@ -3469,6 +3517,49 @@ var IDL = {
|
|
|
3469
3517
|
]
|
|
3470
3518
|
}
|
|
3471
3519
|
},
|
|
3520
|
+
{
|
|
3521
|
+
"name": "DynamicFeeParameter",
|
|
3522
|
+
"type": {
|
|
3523
|
+
"kind": "struct",
|
|
3524
|
+
"fields": [
|
|
3525
|
+
{
|
|
3526
|
+
"name": "filterPeriod",
|
|
3527
|
+
"docs": [
|
|
3528
|
+
"Filter period determine high frequency trading time window."
|
|
3529
|
+
],
|
|
3530
|
+
"type": "u16"
|
|
3531
|
+
},
|
|
3532
|
+
{
|
|
3533
|
+
"name": "decayPeriod",
|
|
3534
|
+
"docs": [
|
|
3535
|
+
"Decay period determine when the volatile fee start decay / decrease."
|
|
3536
|
+
],
|
|
3537
|
+
"type": "u16"
|
|
3538
|
+
},
|
|
3539
|
+
{
|
|
3540
|
+
"name": "reductionFactor",
|
|
3541
|
+
"docs": [
|
|
3542
|
+
"Reduction factor controls the volatile fee rate decrement rate."
|
|
3543
|
+
],
|
|
3544
|
+
"type": "u16"
|
|
3545
|
+
},
|
|
3546
|
+
{
|
|
3547
|
+
"name": "variableFeeControl",
|
|
3548
|
+
"docs": [
|
|
3549
|
+
"Used to scale the variable fee component depending on the dynamic of the market"
|
|
3550
|
+
],
|
|
3551
|
+
"type": "u32"
|
|
3552
|
+
},
|
|
3553
|
+
{
|
|
3554
|
+
"name": "maxVolatilityAccumulator",
|
|
3555
|
+
"docs": [
|
|
3556
|
+
"Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate."
|
|
3557
|
+
],
|
|
3558
|
+
"type": "u32"
|
|
3559
|
+
}
|
|
3560
|
+
]
|
|
3561
|
+
}
|
|
3562
|
+
},
|
|
3472
3563
|
{
|
|
3473
3564
|
"name": "LiquidityParameterByStrategyOneSide",
|
|
3474
3565
|
"type": {
|
|
@@ -4834,6 +4925,41 @@ var IDL = {
|
|
|
4834
4925
|
}
|
|
4835
4926
|
]
|
|
4836
4927
|
},
|
|
4928
|
+
{
|
|
4929
|
+
"name": "DynamicFeeParameterUpdate",
|
|
4930
|
+
"fields": [
|
|
4931
|
+
{
|
|
4932
|
+
"name": "lbPair",
|
|
4933
|
+
"type": "publicKey",
|
|
4934
|
+
"index": false
|
|
4935
|
+
},
|
|
4936
|
+
{
|
|
4937
|
+
"name": "filterPeriod",
|
|
4938
|
+
"type": "u16",
|
|
4939
|
+
"index": false
|
|
4940
|
+
},
|
|
4941
|
+
{
|
|
4942
|
+
"name": "decayPeriod",
|
|
4943
|
+
"type": "u16",
|
|
4944
|
+
"index": false
|
|
4945
|
+
},
|
|
4946
|
+
{
|
|
4947
|
+
"name": "reductionFactor",
|
|
4948
|
+
"type": "u16",
|
|
4949
|
+
"index": false
|
|
4950
|
+
},
|
|
4951
|
+
{
|
|
4952
|
+
"name": "variableFeeControl",
|
|
4953
|
+
"type": "u32",
|
|
4954
|
+
"index": false
|
|
4955
|
+
},
|
|
4956
|
+
{
|
|
4957
|
+
"name": "maxVolatilityAccumulator",
|
|
4958
|
+
"type": "u32",
|
|
4959
|
+
"index": false
|
|
4960
|
+
}
|
|
4961
|
+
]
|
|
4962
|
+
},
|
|
4837
4963
|
{
|
|
4838
4964
|
"name": "IncreaseObservation",
|
|
4839
4965
|
"fields": [
|
|
@@ -5270,6 +5396,11 @@ var IDL = {
|
|
|
5270
5396
|
"code": 6065,
|
|
5271
5397
|
"name": "AlreadyPassPreActivationSwapPoint",
|
|
5272
5398
|
"msg": "Already pass pre-activation swap point"
|
|
5399
|
+
},
|
|
5400
|
+
{
|
|
5401
|
+
"code": 6066,
|
|
5402
|
+
"name": "InvalidStatus",
|
|
5403
|
+
"msg": "Invalid status"
|
|
5273
5404
|
}
|
|
5274
5405
|
]
|
|
5275
5406
|
};
|
|
@@ -8268,9 +8399,9 @@ var DLMM = class {
|
|
|
8268
8399
|
padding: Array(64).fill(0)
|
|
8269
8400
|
};
|
|
8270
8401
|
const userTokenX = _spltoken.getAssociatedTokenAddressSync.call(void 0, tokenX, creatorKey);
|
|
8402
|
+
const userTokenY = _spltoken.getAssociatedTokenAddressSync.call(void 0, tokenY, creatorKey);
|
|
8271
8403
|
return program.methods.initializeCustomizablePermissionlessLbPair(ixData).accounts({
|
|
8272
8404
|
lbPair,
|
|
8273
|
-
rent: _web3js.SYSVAR_RENT_PUBKEY,
|
|
8274
8405
|
reserveX,
|
|
8275
8406
|
reserveY,
|
|
8276
8407
|
binArrayBitmapExtension,
|
|
@@ -8280,6 +8411,7 @@ var DLMM = class {
|
|
|
8280
8411
|
oracle,
|
|
8281
8412
|
systemProgram: _web3js.SystemProgram.programId,
|
|
8282
8413
|
userTokenX,
|
|
8414
|
+
userTokenY,
|
|
8283
8415
|
funder: creatorKey
|
|
8284
8416
|
}).transaction();
|
|
8285
8417
|
}
|