@meteora-ag/dlmm 1.0.50 → 1.0.52-rc.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 +113 -22
- package/dist/index.js +344 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +343 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -2044,6 +2044,73 @@ type LbClmm = {
|
|
|
2044
2044
|
];
|
|
2045
2045
|
"args": [];
|
|
2046
2046
|
},
|
|
2047
|
+
{
|
|
2048
|
+
"name": "removeLiquiditySingleSide";
|
|
2049
|
+
"accounts": [
|
|
2050
|
+
{
|
|
2051
|
+
"name": "position";
|
|
2052
|
+
"isMut": true;
|
|
2053
|
+
"isSigner": false;
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
"name": "lbPair";
|
|
2057
|
+
"isMut": true;
|
|
2058
|
+
"isSigner": false;
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
"name": "binArrayBitmapExtension";
|
|
2062
|
+
"isMut": true;
|
|
2063
|
+
"isSigner": false;
|
|
2064
|
+
"isOptional": true;
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
"name": "userToken";
|
|
2068
|
+
"isMut": true;
|
|
2069
|
+
"isSigner": false;
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
"name": "reserve";
|
|
2073
|
+
"isMut": true;
|
|
2074
|
+
"isSigner": false;
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
"name": "tokenMint";
|
|
2078
|
+
"isMut": false;
|
|
2079
|
+
"isSigner": false;
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
"name": "binArrayLower";
|
|
2083
|
+
"isMut": true;
|
|
2084
|
+
"isSigner": false;
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
"name": "binArrayUpper";
|
|
2088
|
+
"isMut": true;
|
|
2089
|
+
"isSigner": false;
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
"name": "sender";
|
|
2093
|
+
"isMut": false;
|
|
2094
|
+
"isSigner": true;
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
"name": "tokenProgram";
|
|
2098
|
+
"isMut": false;
|
|
2099
|
+
"isSigner": false;
|
|
2100
|
+
},
|
|
2101
|
+
{
|
|
2102
|
+
"name": "eventAuthority";
|
|
2103
|
+
"isMut": false;
|
|
2104
|
+
"isSigner": false;
|
|
2105
|
+
},
|
|
2106
|
+
{
|
|
2107
|
+
"name": "program";
|
|
2108
|
+
"isMut": false;
|
|
2109
|
+
"isSigner": false;
|
|
2110
|
+
}
|
|
2111
|
+
];
|
|
2112
|
+
"args": [];
|
|
2113
|
+
},
|
|
2047
2114
|
{
|
|
2048
2115
|
"name": "togglePairStatus";
|
|
2049
2116
|
"accounts": [
|
|
@@ -3720,38 +3787,38 @@ type LbClmm = {
|
|
|
3720
3787
|
};
|
|
3721
3788
|
},
|
|
3722
3789
|
{
|
|
3723
|
-
"name": "
|
|
3790
|
+
"name": "FeeParameter";
|
|
3724
3791
|
"type": {
|
|
3725
3792
|
"kind": "struct";
|
|
3726
3793
|
"fields": [
|
|
3727
3794
|
{
|
|
3728
|
-
"name": "
|
|
3729
|
-
"
|
|
3795
|
+
"name": "protocolShare";
|
|
3796
|
+
"docs": [
|
|
3797
|
+
"Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee"
|
|
3798
|
+
];
|
|
3799
|
+
"type": "u16";
|
|
3730
3800
|
},
|
|
3731
3801
|
{
|
|
3732
|
-
"name": "
|
|
3802
|
+
"name": "baseFactor";
|
|
3803
|
+
"docs": [
|
|
3804
|
+
"Base factor for base fee rate"
|
|
3805
|
+
];
|
|
3733
3806
|
"type": "u16";
|
|
3734
3807
|
}
|
|
3735
3808
|
];
|
|
3736
3809
|
};
|
|
3737
3810
|
},
|
|
3738
3811
|
{
|
|
3739
|
-
"name": "
|
|
3812
|
+
"name": "BinLiquidityReduction";
|
|
3740
3813
|
"type": {
|
|
3741
3814
|
"kind": "struct";
|
|
3742
3815
|
"fields": [
|
|
3743
3816
|
{
|
|
3744
|
-
"name": "
|
|
3745
|
-
"
|
|
3746
|
-
"Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee"
|
|
3747
|
-
];
|
|
3748
|
-
"type": "u16";
|
|
3817
|
+
"name": "binId";
|
|
3818
|
+
"type": "i32";
|
|
3749
3819
|
},
|
|
3750
3820
|
{
|
|
3751
|
-
"name": "
|
|
3752
|
-
"docs": [
|
|
3753
|
-
"Base factor for base fee rate"
|
|
3754
|
-
];
|
|
3821
|
+
"name": "bpsToRemove";
|
|
3755
3822
|
"type": "u16";
|
|
3756
3823
|
}
|
|
3757
3824
|
];
|
|
@@ -5226,6 +5293,7 @@ interface SwapQuote {
|
|
|
5226
5293
|
minOutAmount: BN;
|
|
5227
5294
|
priceImpact: Decimal;
|
|
5228
5295
|
binArraysPubkey: any[];
|
|
5296
|
+
endPrice: Decimal;
|
|
5229
5297
|
}
|
|
5230
5298
|
interface SwapQuoteExactOut {
|
|
5231
5299
|
inAmount: BN;
|
|
@@ -5538,12 +5606,6 @@ declare class DLMM {
|
|
|
5538
5606
|
* @returns an object with two properties: "binId" which is a number, and "price" which is a string.
|
|
5539
5607
|
*/
|
|
5540
5608
|
getActiveBin(): Promise<BinLiquidity>;
|
|
5541
|
-
/**
|
|
5542
|
-
* The function get the price of a bin based on its bin ID.
|
|
5543
|
-
* @param {number} binId - The `binId` parameter is a number that represents the ID of a bin.
|
|
5544
|
-
* @returns {number} the calculated price of a bin based on the provided binId.
|
|
5545
|
-
*/
|
|
5546
|
-
getPriceOfBinByBinId(binId: number): string;
|
|
5547
5609
|
/**
|
|
5548
5610
|
* The function get bin ID based on a given price and a boolean flag indicating whether to
|
|
5549
5611
|
* round down or up.
|
|
@@ -5648,6 +5710,12 @@ declare class DLMM {
|
|
|
5648
5710
|
bps: BN;
|
|
5649
5711
|
shouldClaimAndClose?: boolean;
|
|
5650
5712
|
}): Promise<Transaction | Transaction[]>;
|
|
5713
|
+
removeLiquiditySingleSide({ user, position, binIds, removeLiquidityForY, }: {
|
|
5714
|
+
user: PublicKey;
|
|
5715
|
+
position: PublicKey;
|
|
5716
|
+
binIds: number[];
|
|
5717
|
+
removeLiquidityForY?: boolean;
|
|
5718
|
+
}): Promise<Transaction | Transaction[]>;
|
|
5651
5719
|
/**
|
|
5652
5720
|
* The `closePosition` function closes a position
|
|
5653
5721
|
* @param
|
|
@@ -5798,6 +5866,14 @@ declare class DLMM {
|
|
|
5798
5866
|
* @returns {Promise<SeedLiquidityResponse>}
|
|
5799
5867
|
*/
|
|
5800
5868
|
seedLiquidity(owner: PublicKey, operator: PublicKey, feeOwner: PublicKey, seedAmount: BN, curvature: number, minPrice: number, maxPrice: number, base: PublicKey): Promise<SeedLiquidityResponse>;
|
|
5869
|
+
/**
|
|
5870
|
+
* Initializes bin arrays for the given bin array indexes if it wasn't initialized.
|
|
5871
|
+
*
|
|
5872
|
+
* @param {BN[]} binArrayIndexes - An array of bin array indexes to initialize.
|
|
5873
|
+
* @param {PublicKey} funder - The public key of the funder.
|
|
5874
|
+
* @return {Promise<TransactionInstruction[]>} An array of transaction instructions to initialize the bin arrays.
|
|
5875
|
+
*/
|
|
5876
|
+
initializeBinArrays(binArrayIndexes: BN[], funder: PublicKey): Promise<TransactionInstruction[]>;
|
|
5801
5877
|
/**
|
|
5802
5878
|
*
|
|
5803
5879
|
* @param
|
|
@@ -5840,13 +5916,16 @@ declare class DLMM {
|
|
|
5840
5916
|
*/
|
|
5841
5917
|
syncWithMarketPrice(marketPrice: number, owner: PublicKey): Promise<Transaction>;
|
|
5842
5918
|
getMaxPriceInBinArrays(binArrayAccounts: BinArrayAccount[]): Promise<string>;
|
|
5919
|
+
getAmountOutWithdrawSingleSide(maxLiquidityShare: BN, price: BN, bin: Bin, isWithdrawForY: boolean): {
|
|
5920
|
+
withdrawAmount: BN;
|
|
5921
|
+
};
|
|
5922
|
+
getWithdrawSingleSideAmount(positionPubkey: PublicKey, isWithdrawForY: boolean): Promise<BN>;
|
|
5843
5923
|
/** Private static method */
|
|
5844
5924
|
private static getBinArrays;
|
|
5845
5925
|
private static getClaimableLMReward;
|
|
5846
5926
|
private static getClaimableSwapFee;
|
|
5847
5927
|
private static processPosition;
|
|
5848
5928
|
private static getBinsBetweenLowerAndUpperBound;
|
|
5849
|
-
private static getPriceOfBinByBinId;
|
|
5850
5929
|
/** Private method */
|
|
5851
5930
|
private processXYAmountDistribution;
|
|
5852
5931
|
private getBins;
|
|
@@ -5886,6 +5965,18 @@ declare function isBinIdWithinBinArray(activeId: BN, binArrayIndex: BN): boolean
|
|
|
5886
5965
|
declare function getBinFromBinArray(binId: number, binArray: BinArray): Bin;
|
|
5887
5966
|
declare function findNextBinArrayIndexWithLiquidity(swapForY: boolean, activeId: BN, lbPairState: LbPair, binArrayBitmapExtension: BinArrayBitmapExtension | null): BN | null;
|
|
5888
5967
|
declare function findNextBinArrayWithLiquidity(swapForY: boolean, activeBinId: BN, lbPairState: LbPair, binArrayBitmapExtension: BinArrayBitmapExtension | null, binArrays: BinArrayAccount[]): BinArrayAccount | null;
|
|
5968
|
+
/**
|
|
5969
|
+
* Retrieves the bin arrays required to initialize multiple positions in continuous range.
|
|
5970
|
+
*
|
|
5971
|
+
* @param {PublicKey} pair - The public key of the pair.
|
|
5972
|
+
* @param {BN} fromBinId - The starting bin ID.
|
|
5973
|
+
* @param {BN} toBinId - The ending bin ID.
|
|
5974
|
+
* @return {[{key: PublicKey, index: BN }]} An array of bin arrays required for the given position range.
|
|
5975
|
+
*/
|
|
5976
|
+
declare function getBinArraysRequiredByPositionRange(pair: PublicKey, fromBinId: BN, toBinId: BN, programId: PublicKey): {
|
|
5977
|
+
key: PublicKey;
|
|
5978
|
+
index: BN;
|
|
5979
|
+
}[];
|
|
5889
5980
|
|
|
5890
5981
|
declare function getPriceOfBinByBinId(binId: number, binStep: number): Decimal;
|
|
5891
5982
|
/** private */
|
|
@@ -6258,4 +6349,4 @@ declare const MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = 26;
|
|
|
6258
6349
|
declare const MAX_BIN_PER_TX = 69;
|
|
6259
6350
|
declare const MAX_ACTIVE_BIN_SLIPPAGE = 3;
|
|
6260
6351
|
|
|
6261
|
-
export { ADMIN, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, CompressedBinDepositAmount, CompressedBinDepositAmounts, DLMMError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, IDL, InitPermissionPairIx, LBCLMM_PROGRAM_IDS, LMRewards, LbClmm, LbPair, LbPairAccount, LbPosition, LiquidityOneSideParameter, 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, 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, computeBudgetIx, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveLbPair, deriveLbPair2, deriveOracle, derivePermissionLbPair, derivePosition, derivePresetParameter, derivePresetParameter2, deriveReserve, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getBaseFee, getBinArrayLowerUpperBinId, getBinFromBinArray, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parseLogs, sParameters, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountsBothSideByStrategy, toAmountsOneSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };
|
|
6352
|
+
export { ADMIN, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, CompressedBinDepositAmount, CompressedBinDepositAmounts, DLMMError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, IDL, InitPermissionPairIx, LBCLMM_PROGRAM_IDS, LMRewards, LbClmm, LbPair, LbPairAccount, LbPosition, LiquidityOneSideParameter, 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, 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, computeBudgetIx, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveLbPair, deriveLbPair2, deriveOracle, derivePermissionLbPair, derivePosition, derivePresetParameter, derivePresetParameter2, deriveReserve, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getBaseFee, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinFromBinArray, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parseLogs, sParameters, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountsBothSideByStrategy, toAmountsOneSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };
|