@meteora-ag/dlmm 1.6.0-rc.18 → 1.6.0-rc.2
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 +409 -95
- package/dist/index.js +3500 -2870
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3671 -3041
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as _coral_xyz_anchor from '@coral-xyz/anchor';
|
|
2
2
|
import { Program, BN as BN$1, IdlAccounts, ProgramAccount, IdlTypes, EventParser } from '@coral-xyz/anchor';
|
|
3
3
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
4
|
-
import { PublicKey, Connection, AccountMeta, Keypair, TransactionInstruction, Cluster, Transaction } from '@solana/web3.js';
|
|
4
|
+
import { PublicKey, Connection, AccountMeta, Keypair, TransactionInstruction, Cluster, AccountInfo, Transaction } from '@solana/web3.js';
|
|
5
5
|
import Decimal from 'decimal.js';
|
|
6
|
+
import { IdlDiscriminator } from '@coral-xyz/anchor/dist/cjs/idl';
|
|
6
7
|
import { Mint } from '@solana/spl-token';
|
|
7
8
|
import { AllAccountsMap } from '@coral-xyz/anchor/dist/cjs/program/namespace/types';
|
|
8
9
|
import BN from 'bn.js';
|
|
9
|
-
import { IdlDiscriminator } from '@coral-xyz/anchor/dist/cjs/idl';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -9126,6 +9126,21 @@ type LbClmm = {
|
|
|
9126
9126
|
];
|
|
9127
9127
|
};
|
|
9128
9128
|
|
|
9129
|
+
declare function buildBitFlagAndNegateStrategyParameters(x0: BN, y0: BN, deltaX: BN, deltaY: BN): {
|
|
9130
|
+
bitFlag: number;
|
|
9131
|
+
x0: BN;
|
|
9132
|
+
y0: BN;
|
|
9133
|
+
deltaX: BN;
|
|
9134
|
+
deltaY: BN;
|
|
9135
|
+
};
|
|
9136
|
+
interface AmountIntoBin {
|
|
9137
|
+
binId: BN;
|
|
9138
|
+
amountX: BN;
|
|
9139
|
+
amountY: BN;
|
|
9140
|
+
}
|
|
9141
|
+
declare function getAmountInBinsBidSide(activeId: BN, minDeltaId: BN, maxDeltaId: BN, deltaY: BN, y0: BN): AmountIntoBin[];
|
|
9142
|
+
declare function getAmountInBinsAskSide(activeId: BN, binStep: BN, minDeltaId: BN, maxDeltaId: BN, deltaX: BN, x0: BN): AmountIntoBin[];
|
|
9143
|
+
declare function toAmountIntoBins(activeId: BN, minDeltaId: BN, maxDeltaId: BN, deltaX: BN, deltaY: BN, x0: BN, y0: BN, binStep: BN, favorXInActiveBin: boolean): AmountIntoBin[];
|
|
9129
9144
|
interface SimulateWithdrawResult {
|
|
9130
9145
|
liquidityAndFeeXWithdrawn: BN;
|
|
9131
9146
|
liquidityAndFeeYWithdrawn: BN;
|
|
@@ -9210,6 +9225,43 @@ interface SimulateRebalanceResp {
|
|
|
9210
9225
|
withdrawParams: RebalanceRemoveLiquidityParam[];
|
|
9211
9226
|
rentalCostLamports: BN;
|
|
9212
9227
|
}
|
|
9228
|
+
declare function getRebalanceBinArrayIndexesAndBitmapCoverage(adds: RebalanceAddLiquidityParam[], removes: RebalanceRemoveLiquidityParam[], activeId: number, pairAddress: PublicKey, programId: PublicKey): {
|
|
9229
|
+
binArrayIndexes: BN[];
|
|
9230
|
+
binArrayBitmap: PublicKey;
|
|
9231
|
+
};
|
|
9232
|
+
|
|
9233
|
+
interface LiquidityStrategyParameters {
|
|
9234
|
+
x0: BN;
|
|
9235
|
+
y0: BN;
|
|
9236
|
+
deltaX: BN;
|
|
9237
|
+
deltaY: BN;
|
|
9238
|
+
}
|
|
9239
|
+
interface BidAskParameters {
|
|
9240
|
+
base: BN;
|
|
9241
|
+
delta: BN;
|
|
9242
|
+
}
|
|
9243
|
+
interface LiquidityStrategyParameterBuilder {
|
|
9244
|
+
findXParameters(amountX: BN, minDeltaId: BN, maxDeltaId: BN, binStep: BN, activeId: BN): BidAskParameters;
|
|
9245
|
+
findYParameters(amountY: BN, minDeltaId: BN, maxDeltaId: BN, activeId: BN): BidAskParameters;
|
|
9246
|
+
suggestBalancedXParametersFromY(activeId: BN, binStep: BN, favorXInActiveBin: boolean, minDeltaId: BN, maxDeltaId: BN, amountY: BN): BidAskParameters & {
|
|
9247
|
+
amountX: BN;
|
|
9248
|
+
};
|
|
9249
|
+
suggestBalancedYParametersFromX(activeId: BN, binStep: BN, favorXInActiveBin: boolean, minDeltaId: BN, maxDeltaId: BN, amountXInQuoteValue: BN): BidAskParameters & {
|
|
9250
|
+
amountY: BN;
|
|
9251
|
+
};
|
|
9252
|
+
}
|
|
9253
|
+
declare function getLiquidityStrategyParameterBuilder(strategyType: StrategyType): LiquidityStrategyParameterBuilder;
|
|
9254
|
+
declare function suggestBalancedXParametersFromY(y0: BN, deltaY: BN, minDeltaId: BN, maxDeltaId: BN, activeId: BN, binStep: BN, favorXInActiveBin: boolean, builder: LiquidityStrategyParameterBuilder): BidAskParameters & {
|
|
9255
|
+
amountX: BN;
|
|
9256
|
+
};
|
|
9257
|
+
declare function getAutoFillAmountByRebalancedPosition(rebalancePosition: RebalancePosition, strategyType: StrategyType): {
|
|
9258
|
+
amount: BN;
|
|
9259
|
+
isBidSide: boolean;
|
|
9260
|
+
};
|
|
9261
|
+
declare function suggestBalancedYParametersFromX(x0: BN, deltaX: BN, minDeltaId: BN, maxDeltaId: BN, activeId: BN, binStep: BN, favorXInActiveBin: boolean, builder: LiquidityStrategyParameterBuilder): BidAskParameters & {
|
|
9262
|
+
amountY: BN;
|
|
9263
|
+
};
|
|
9264
|
+
declare function buildLiquidityStrategyParameters(amountX: BN, amountY: BN, minDeltaId: BN, maxDeltaId: BN, binStep: BN, favorXInActiveId: boolean, activeId: BN, strategyParameterBuilder: LiquidityStrategyParameterBuilder): LiquidityStrategyParameters;
|
|
9213
9265
|
|
|
9214
9266
|
interface BinAndAmount {
|
|
9215
9267
|
binId: number;
|
|
@@ -9360,6 +9412,14 @@ interface TInitializePositionAndAddLiquidityParamsByStrategy {
|
|
|
9360
9412
|
user: PublicKey;
|
|
9361
9413
|
slippage?: number;
|
|
9362
9414
|
}
|
|
9415
|
+
interface InitializeMultiplePositionAndAddLiquidityByStrategyResponse {
|
|
9416
|
+
instructionsByPositions: {
|
|
9417
|
+
positionKeypair: Keypair;
|
|
9418
|
+
initializePositionIx: TransactionInstruction;
|
|
9419
|
+
initializeAtaIxs: TransactionInstruction[];
|
|
9420
|
+
addLiquidityIxs: TransactionInstruction[][];
|
|
9421
|
+
}[];
|
|
9422
|
+
}
|
|
9363
9423
|
interface TInitializeMultiplePositionAndAddLiquidityParamsByStrategy {
|
|
9364
9424
|
totalXAmount: BN$1;
|
|
9365
9425
|
totalYAmount: BN$1;
|
|
@@ -9592,31 +9652,6 @@ interface RebalancePositionBinArrayRentalCostQuote {
|
|
|
9592
9652
|
bitmapExtensionCost: number;
|
|
9593
9653
|
}
|
|
9594
9654
|
|
|
9595
|
-
/** private */
|
|
9596
|
-
declare function derivePresetParameterWithIndex(index: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9597
|
-
declare function deriveLbPairWithPresetParamWithIndexKey(presetParameterKey: PublicKey, tokenX: PublicKey, tokenY: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9598
|
-
/**
|
|
9599
|
-
*
|
|
9600
|
-
* @deprecated Use derivePresetParameter2
|
|
9601
|
-
*/
|
|
9602
|
-
declare function derivePresetParameter(binStep: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9603
|
-
declare function derivePresetParameter2(binStep: BN$1, baseFactor: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9604
|
-
declare function deriveLbPair2(tokenX: PublicKey, tokenY: PublicKey, binStep: BN$1, baseFactor: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9605
|
-
/**
|
|
9606
|
-
*
|
|
9607
|
-
* @deprecated Use deriveLbPair2
|
|
9608
|
-
*/
|
|
9609
|
-
declare function deriveLbPair(tokenX: PublicKey, tokenY: PublicKey, binStep: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9610
|
-
declare function deriveCustomizablePermissionlessLbPair(tokenX: PublicKey, tokenY: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9611
|
-
declare function derivePermissionLbPair(baseKey: PublicKey, tokenX: PublicKey, tokenY: PublicKey, binStep: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9612
|
-
declare function deriveOracle(lbPair: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9613
|
-
declare function derivePosition(lbPair: PublicKey, base: PublicKey, lowerBinId: BN$1, width: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9614
|
-
declare function deriveBinArray(lbPair: PublicKey, index: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9615
|
-
declare function deriveReserve(token: PublicKey, lbPair: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9616
|
-
declare function deriveTokenBadge(mint: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9617
|
-
declare function deriveEventAuthority(programId: PublicKey): [PublicKey, number];
|
|
9618
|
-
declare function deriveRewardVault(lbPair: PublicKey, rewardIndex: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9619
|
-
|
|
9620
9655
|
/** private */
|
|
9621
9656
|
declare function isOverflowDefaultBinArrayBitmap(binArrayIndex: BN$1): boolean;
|
|
9622
9657
|
declare function deriveBinArrayBitmapExtension(lbPair: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
@@ -9658,6 +9693,238 @@ declare function updateBinArray(activeId: BN$1, clock: Clock, allRewardInfos: Re
|
|
|
9658
9693
|
}[];
|
|
9659
9694
|
};
|
|
9660
9695
|
|
|
9696
|
+
/** private */
|
|
9697
|
+
declare function derivePresetParameterWithIndex(index: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9698
|
+
declare function deriveLbPairWithPresetParamWithIndexKey(presetParameterKey: PublicKey, tokenX: PublicKey, tokenY: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9699
|
+
/**
|
|
9700
|
+
*
|
|
9701
|
+
* @deprecated Use derivePresetParameter2
|
|
9702
|
+
*/
|
|
9703
|
+
declare function derivePresetParameter(binStep: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9704
|
+
declare function derivePresetParameter2(binStep: BN$1, baseFactor: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9705
|
+
declare function deriveLbPair2(tokenX: PublicKey, tokenY: PublicKey, binStep: BN$1, baseFactor: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9706
|
+
/**
|
|
9707
|
+
*
|
|
9708
|
+
* @deprecated Use deriveLbPair2
|
|
9709
|
+
*/
|
|
9710
|
+
declare function deriveLbPair(tokenX: PublicKey, tokenY: PublicKey, binStep: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9711
|
+
declare function deriveCustomizablePermissionlessLbPair(tokenX: PublicKey, tokenY: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9712
|
+
declare function derivePermissionLbPair(baseKey: PublicKey, tokenX: PublicKey, tokenY: PublicKey, binStep: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9713
|
+
declare function deriveOracle(lbPair: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9714
|
+
declare function derivePosition(lbPair: PublicKey, base: PublicKey, lowerBinId: BN$1, width: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9715
|
+
declare function deriveBinArray(lbPair: PublicKey, index: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9716
|
+
declare function deriveReserve(token: PublicKey, lbPair: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9717
|
+
declare function deriveTokenBadge(mint: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
9718
|
+
declare function deriveEventAuthority(programId: PublicKey): [PublicKey, number];
|
|
9719
|
+
declare function deriveRewardVault(lbPair: PublicKey, rewardIndex: BN$1, programId: PublicKey): [PublicKey, number];
|
|
9720
|
+
declare function derivePlaceHolderAccountMeta(programId: PublicKey): AccountMeta;
|
|
9721
|
+
|
|
9722
|
+
declare function getBaseFee(binStep: number, sParameter: sParameters): BN$1;
|
|
9723
|
+
declare function getVariableFee(binStep: number, sParameter: sParameters, vParameter: vParameters): BN$1;
|
|
9724
|
+
declare function getTotalFee(binStep: number, sParameter: sParameters, vParameter: vParameters): BN$1;
|
|
9725
|
+
declare function computeFee(binStep: number, sParameter: sParameters, vParameter: vParameters, inAmount: BN$1): BN$1;
|
|
9726
|
+
declare function computeFeeFromAmount(binStep: number, sParameter: sParameters, vParameter: vParameters, inAmountWithFees: BN$1): BN$1;
|
|
9727
|
+
declare function computeProtocolFee(feeAmount: BN$1, sParameter: sParameters): BN$1;
|
|
9728
|
+
declare function swapExactOutQuoteAtBin(bin: Bin, binStep: number, sParameter: sParameters, vParameter: vParameters, outAmount: BN$1, swapForY: boolean): {
|
|
9729
|
+
amountIn: BN$1;
|
|
9730
|
+
amountOut: BN$1;
|
|
9731
|
+
fee: BN$1;
|
|
9732
|
+
protocolFee: BN$1;
|
|
9733
|
+
};
|
|
9734
|
+
declare function swapExactInQuoteAtBin(bin: Bin, binStep: number, sParameter: sParameters, vParameter: vParameters, inAmount: BN$1, swapForY: boolean): {
|
|
9735
|
+
amountIn: BN$1;
|
|
9736
|
+
amountOut: BN$1;
|
|
9737
|
+
fee: BN$1;
|
|
9738
|
+
protocolFee: BN$1;
|
|
9739
|
+
};
|
|
9740
|
+
|
|
9741
|
+
/**
|
|
9742
|
+
* It fetches the pool account from the AMM program, and returns the mint addresses for the two tokens
|
|
9743
|
+
* @param {Connection} connection - Connection - The connection to the Solana cluster
|
|
9744
|
+
* @param {string} poolAddress - The address of the pool account.
|
|
9745
|
+
* @returns The tokenAMint and tokenBMint addresses for the pool.
|
|
9746
|
+
*/
|
|
9747
|
+
declare function getTokensMintFromPoolAddress(connection: Connection, poolAddress: string, opt?: {
|
|
9748
|
+
cluster?: Cluster;
|
|
9749
|
+
programId?: PublicKey;
|
|
9750
|
+
}): Promise<{
|
|
9751
|
+
tokenXMint: PublicKey;
|
|
9752
|
+
tokenYMint: PublicKey;
|
|
9753
|
+
}>;
|
|
9754
|
+
declare function getTokenProgramId(lbPairState: LbPair): {
|
|
9755
|
+
tokenXProgram: PublicKey;
|
|
9756
|
+
tokenYProgram: PublicKey;
|
|
9757
|
+
};
|
|
9758
|
+
|
|
9759
|
+
interface IPosition {
|
|
9760
|
+
address(): PublicKey;
|
|
9761
|
+
lowerBinId(): BN;
|
|
9762
|
+
upperBinId(): BN;
|
|
9763
|
+
liquidityShares(): BN[];
|
|
9764
|
+
rewardInfos(): UserRewardInfo[];
|
|
9765
|
+
feeInfos(): UserFeeInfo[];
|
|
9766
|
+
lastUpdatedAt(): BN;
|
|
9767
|
+
lbPair(): PublicKey;
|
|
9768
|
+
totalClaimedFeeXAmount(): BN;
|
|
9769
|
+
totalClaimedFeeYAmount(): BN;
|
|
9770
|
+
totalClaimedRewards(): BN[];
|
|
9771
|
+
operator(): PublicKey;
|
|
9772
|
+
lockReleasePoint(): BN;
|
|
9773
|
+
feeOwner(): PublicKey;
|
|
9774
|
+
owner(): PublicKey;
|
|
9775
|
+
getBinArrayIndexesCoverage(): BN[];
|
|
9776
|
+
getBinArrayKeysCoverage(programId: PublicKey): PublicKey[];
|
|
9777
|
+
version(): PositionVersion;
|
|
9778
|
+
width(): BN;
|
|
9779
|
+
}
|
|
9780
|
+
interface CombinedPositionBinData {
|
|
9781
|
+
liquidityShares: BN[];
|
|
9782
|
+
rewardInfos: UserRewardInfo[];
|
|
9783
|
+
feeInfos: UserFeeInfo[];
|
|
9784
|
+
}
|
|
9785
|
+
declare function wrapPosition(program: Program<LbClmm>, key: PublicKey, account: AccountInfo<Buffer>): IPosition;
|
|
9786
|
+
declare class PositionV2Wrapper implements IPosition {
|
|
9787
|
+
positionAddress: PublicKey;
|
|
9788
|
+
inner: PositionV2;
|
|
9789
|
+
extended: ExtendedPositionBinData[];
|
|
9790
|
+
combinedPositionBinData: CombinedPositionBinData;
|
|
9791
|
+
constructor(positionAddress: PublicKey, inner: PositionV2, extended: ExtendedPositionBinData[], combinedPositionBinData: CombinedPositionBinData);
|
|
9792
|
+
address(): PublicKey;
|
|
9793
|
+
totalClaimedRewards(): BN[];
|
|
9794
|
+
feeOwner(): PublicKey;
|
|
9795
|
+
lockReleasePoint(): BN;
|
|
9796
|
+
operator(): PublicKey;
|
|
9797
|
+
totalClaimedFeeYAmount(): BN;
|
|
9798
|
+
totalClaimedFeeXAmount(): BN;
|
|
9799
|
+
lbPair(): PublicKey;
|
|
9800
|
+
lowerBinId(): BN;
|
|
9801
|
+
upperBinId(): BN;
|
|
9802
|
+
liquidityShares(): BN[];
|
|
9803
|
+
rewardInfos(): UserRewardInfo[];
|
|
9804
|
+
feeInfos(): UserFeeInfo[];
|
|
9805
|
+
lastUpdatedAt(): BN;
|
|
9806
|
+
getBinArrayIndexesCoverage(): BN[];
|
|
9807
|
+
getBinArrayKeysCoverage(programId: PublicKey): PublicKey[];
|
|
9808
|
+
version(): PositionVersion;
|
|
9809
|
+
owner(): PublicKey;
|
|
9810
|
+
width(): BN;
|
|
9811
|
+
}
|
|
9812
|
+
|
|
9813
|
+
declare function getBinArrayIndexesCoverage(lowerBinId: BN, upperBinId: BN): BN[];
|
|
9814
|
+
declare function getBinArrayKeysCoverage(lowerBinId: BN, upperBinId: BN, lbPair: PublicKey, programId: PublicKey): PublicKey[];
|
|
9815
|
+
declare function getBinArrayAccountMetasCoverage(lowerBinId: BN, upperBinId: BN, lbPair: PublicKey, programId: PublicKey): AccountMeta[];
|
|
9816
|
+
declare function getPositionLowerUpperBinIdWithLiquidity(position: PositionData): {
|
|
9817
|
+
lowerBinId: BN;
|
|
9818
|
+
upperBinId: BN;
|
|
9819
|
+
} | null;
|
|
9820
|
+
declare function isPositionNoFee(position: PositionData): boolean;
|
|
9821
|
+
declare function isPositionNoReward(position: PositionData): boolean;
|
|
9822
|
+
/**
|
|
9823
|
+
* Divides a range of bin IDs into chunks, each with a maximum length defined by POSITION_MAX_LENGTH,
|
|
9824
|
+
* and returns an array of objects representing the lower and upper bin IDs for each chunk.
|
|
9825
|
+
*
|
|
9826
|
+
* @param {number} minBinId - The starting bin ID of the range.
|
|
9827
|
+
* @param {number} maxBinId - The ending bin ID of the range.
|
|
9828
|
+
* @returns {{ lowerBinId: number; upperBinId: number }[]} An array of objects, each containing a
|
|
9829
|
+
* 'lowerBinId' and 'upperBinId', representing the range of bin IDs in each chunk.
|
|
9830
|
+
*/
|
|
9831
|
+
declare function chunkBinRangeIntoExtendedPositions(minBinId: number, maxBinId: number): {
|
|
9832
|
+
lowerBinId: number;
|
|
9833
|
+
upperBinId: number;
|
|
9834
|
+
}[];
|
|
9835
|
+
/**
|
|
9836
|
+
* Divides a range of bin IDs into chunks, each with a length defined by DEFAULT_BIN_PER_POSITION,
|
|
9837
|
+
* and returns an array of objects representing the lower and upper bin IDs for each chunk.
|
|
9838
|
+
* Mainly used for chunking bin range to execute multiple add/remove liquidity, claim fee/reward
|
|
9839
|
+
*
|
|
9840
|
+
* @param {number} minBinId - The starting bin ID of the range.
|
|
9841
|
+
* @param {number} maxBinId - The ending bin ID of the range.
|
|
9842
|
+
* @returns {{ lowerBinId: number; upperBinId: number }[]} An array of objects, each containing a
|
|
9843
|
+
* 'lowerBinId' and 'upperBinId', representing the range of bin IDs in each chunk.
|
|
9844
|
+
*/
|
|
9845
|
+
declare function chunkBinRange(minBinId: number, maxBinId: number): {
|
|
9846
|
+
lowerBinId: number;
|
|
9847
|
+
upperBinId: number;
|
|
9848
|
+
}[];
|
|
9849
|
+
declare function chunkPositionBinRange(position: LbPosition, minBinId: number, maxBinId: number): {
|
|
9850
|
+
minBinId: number;
|
|
9851
|
+
maxBinId: number;
|
|
9852
|
+
amountX: BN;
|
|
9853
|
+
amountY: BN;
|
|
9854
|
+
feeXAmount: BN;
|
|
9855
|
+
feeYAmount: BN;
|
|
9856
|
+
rewardAmounts: BN[];
|
|
9857
|
+
}[];
|
|
9858
|
+
declare function calculatePositionSize(binCount: BN): BN;
|
|
9859
|
+
/**
|
|
9860
|
+
* Get the minimum balance required to pay for the rent exemption of a
|
|
9861
|
+
* position with the given bin count.
|
|
9862
|
+
*
|
|
9863
|
+
* @param connection The connection to the Solana RPC node.
|
|
9864
|
+
* @param binCount The number of bins in the position.
|
|
9865
|
+
* @returns The minimum balance required to pay for the rent exemption.
|
|
9866
|
+
*/
|
|
9867
|
+
declare function getPositionRentExemption(connection: Connection, binCount: BN): Promise<number>;
|
|
9868
|
+
/**
|
|
9869
|
+
* Calculate the minimum lamports required to expand a position to a given
|
|
9870
|
+
* width.
|
|
9871
|
+
*
|
|
9872
|
+
* The function takes into account the current width of the position and the
|
|
9873
|
+
* width to expand to. If the expanded width is less than or equal to the
|
|
9874
|
+
* default bin count per position, the function returns 0.
|
|
9875
|
+
*
|
|
9876
|
+
* @param currentMinBinId The current minimum bin ID of the position.
|
|
9877
|
+
* @param currentMaxBinId The current maximum bin ID of the position.
|
|
9878
|
+
* @param connection The connection to the Solana RPC node.
|
|
9879
|
+
* @param binCountToExpand The number of bins to expand the position by.
|
|
9880
|
+
* @returns The minimum lamports required to expand the position to the given
|
|
9881
|
+
* width.
|
|
9882
|
+
*/
|
|
9883
|
+
declare function getPositionExpandRentExemption(currentMinBinId: BN, currentMaxBinId: BN, connection: Connection, binCountToExpand: BN): Promise<number>;
|
|
9884
|
+
/**
|
|
9885
|
+
* Calculate the number of extended bins in a position.
|
|
9886
|
+
*
|
|
9887
|
+
* @param minBinId The minimum bin ID of the position.
|
|
9888
|
+
* @param maxBinId The maximum bin ID of the position.
|
|
9889
|
+
* @returns The number of extended bins in the position. If the position width is
|
|
9890
|
+
* less than or equal to the default bin count per position, returns 0.
|
|
9891
|
+
*/
|
|
9892
|
+
declare function getExtendedPositionBinCount(minBinId: BN, maxBinId: BN): BN;
|
|
9893
|
+
/**
|
|
9894
|
+
* Decode the extended position data.
|
|
9895
|
+
*
|
|
9896
|
+
* @param base The base position with the base data.
|
|
9897
|
+
* @param program The program that the position is associated with.
|
|
9898
|
+
* @param bytes The buffer of bytes to decode.
|
|
9899
|
+
* @returns The decoded extended position data.
|
|
9900
|
+
*/
|
|
9901
|
+
declare function decodeExtendedPosition(base: PositionV2, program: Program<LbClmm>, bytes: Buffer): ExtendedPositionBinData[];
|
|
9902
|
+
|
|
9903
|
+
/**
|
|
9904
|
+
* Given a strategy type and amounts of X and Y, returns the distribution of liquidity.
|
|
9905
|
+
* @param activeId The bin id of the active bin.
|
|
9906
|
+
* @param binStep The step size of each bin.
|
|
9907
|
+
* @param minBinId The min bin id.
|
|
9908
|
+
* @param maxBinId The max bin id.
|
|
9909
|
+
* @param amountX The amount of X token to deposit.
|
|
9910
|
+
* @param amountY The amount of Y token to deposit.
|
|
9911
|
+
* @param amountXInActiveBin The amount of X token in the active bin.
|
|
9912
|
+
* @param amountYInActiveBin The amount of Y token in the active bin.
|
|
9913
|
+
* @param strategyType The strategy type.
|
|
9914
|
+
* @param mintX The mint info of X token. Get from DLMM instance.
|
|
9915
|
+
* @param mintY The mint info of Y token. Get from DLMM instance.
|
|
9916
|
+
* @param clock The clock info. Get from DLMM instance.
|
|
9917
|
+
* @returns The distribution of liquidity.
|
|
9918
|
+
*/
|
|
9919
|
+
declare function toAmountsBothSideByStrategy(activeId: number, binStep: number, minBinId: number, maxBinId: number, amountX: BN$1, amountY: BN$1, amountXInActiveBin: BN$1, amountYInActiveBin: BN$1, strategyType: StrategyType, mintX: Mint, mintY: Mint, clock: Clock): {
|
|
9920
|
+
binId: number;
|
|
9921
|
+
amountX: BN$1;
|
|
9922
|
+
amountY: BN$1;
|
|
9923
|
+
}[];
|
|
9924
|
+
declare function autoFillYByStrategy(activeId: number, binStep: number, amountX: BN$1, amountXInActiveBin: BN$1, amountYInActiveBin: BN$1, minBinId: number, maxBinId: number, strategyType: StrategyType): BN$1;
|
|
9925
|
+
declare function autoFillXByStrategy(activeId: number, binStep: number, amountY: BN$1, amountXInActiveBin: BN$1, amountYInActiveBin: BN$1, minBinId: number, maxBinId: number, strategyType: StrategyType): BN$1;
|
|
9926
|
+
declare function toStrategyParameters({ maxBinId, minBinId, strategyType, singleSidedX, }: StrategyParameters): ProgramStrategyParameter;
|
|
9927
|
+
|
|
9661
9928
|
declare function getPriceOfBinByBinId(binId: number, binStep: number): Decimal;
|
|
9662
9929
|
/** private */
|
|
9663
9930
|
declare function toWeightDistribution(amountX: BN$1, amountY: BN$1, distributions: {
|
|
@@ -9726,25 +9993,6 @@ declare function fromWeightDistributionToAmount(amountX: BN$1, amountY: BN$1, di
|
|
|
9726
9993
|
amountY: BN$1;
|
|
9727
9994
|
}[];
|
|
9728
9995
|
|
|
9729
|
-
declare function getBaseFee(binStep: number, sParameter: sParameters): BN$1;
|
|
9730
|
-
declare function getVariableFee(binStep: number, sParameter: sParameters, vParameter: vParameters): BN$1;
|
|
9731
|
-
declare function getTotalFee(binStep: number, sParameter: sParameters, vParameter: vParameters): BN$1;
|
|
9732
|
-
declare function computeFee(binStep: number, sParameter: sParameters, vParameter: vParameters, inAmount: BN$1): BN$1;
|
|
9733
|
-
declare function computeFeeFromAmount(binStep: number, sParameter: sParameters, vParameter: vParameters, inAmountWithFees: BN$1): BN$1;
|
|
9734
|
-
declare function computeProtocolFee(feeAmount: BN$1, sParameter: sParameters): BN$1;
|
|
9735
|
-
declare function swapExactOutQuoteAtBin(bin: Bin, binStep: number, sParameter: sParameters, vParameter: vParameters, outAmount: BN$1, swapForY: boolean): {
|
|
9736
|
-
amountIn: BN$1;
|
|
9737
|
-
amountOut: BN$1;
|
|
9738
|
-
fee: BN$1;
|
|
9739
|
-
protocolFee: BN$1;
|
|
9740
|
-
};
|
|
9741
|
-
declare function swapExactInQuoteAtBin(bin: Bin, binStep: number, sParameter: sParameters, vParameter: vParameters, inAmount: BN$1, swapForY: boolean): {
|
|
9742
|
-
amountIn: BN$1;
|
|
9743
|
-
amountOut: BN$1;
|
|
9744
|
-
fee: BN$1;
|
|
9745
|
-
protocolFee: BN$1;
|
|
9746
|
-
};
|
|
9747
|
-
|
|
9748
9996
|
/**
|
|
9749
9997
|
* Distribute totalAmount to all bid side bins according to given distributions.
|
|
9750
9998
|
* @param activeId active bin id
|
|
@@ -9810,49 +10058,6 @@ declare function autoFillXByWeight(activeId: number, binStep: number, amountY: B
|
|
|
9810
10058
|
weight: number;
|
|
9811
10059
|
}[]): BN$1;
|
|
9812
10060
|
|
|
9813
|
-
/**
|
|
9814
|
-
* Given a strategy type and amounts of X and Y, returns the distribution of liquidity.
|
|
9815
|
-
* @param activeId The bin id of the active bin.
|
|
9816
|
-
* @param binStep The step size of each bin.
|
|
9817
|
-
* @param minBinId The min bin id.
|
|
9818
|
-
* @param maxBinId The max bin id.
|
|
9819
|
-
* @param amountX The amount of X token to deposit.
|
|
9820
|
-
* @param amountY The amount of Y token to deposit.
|
|
9821
|
-
* @param amountXInActiveBin The amount of X token in the active bin.
|
|
9822
|
-
* @param amountYInActiveBin The amount of Y token in the active bin.
|
|
9823
|
-
* @param strategyType The strategy type.
|
|
9824
|
-
* @param mintX The mint info of X token. Get from DLMM instance.
|
|
9825
|
-
* @param mintY The mint info of Y token. Get from DLMM instance.
|
|
9826
|
-
* @param clock The clock info. Get from DLMM instance.
|
|
9827
|
-
* @returns The distribution of liquidity.
|
|
9828
|
-
*/
|
|
9829
|
-
declare function toAmountsBothSideByStrategy(activeId: number, binStep: number, minBinId: number, maxBinId: number, amountX: BN$1, amountY: BN$1, amountXInActiveBin: BN$1, amountYInActiveBin: BN$1, strategyType: StrategyType, mintX: Mint, mintY: Mint, clock: Clock): {
|
|
9830
|
-
binId: number;
|
|
9831
|
-
amountX: BN$1;
|
|
9832
|
-
amountY: BN$1;
|
|
9833
|
-
}[];
|
|
9834
|
-
declare function autoFillYByStrategy(activeId: number, binStep: number, amountX: BN$1, amountXInActiveBin: BN$1, amountYInActiveBin: BN$1, minBinId: number, maxBinId: number, strategyType: StrategyType): BN$1;
|
|
9835
|
-
declare function autoFillXByStrategy(activeId: number, binStep: number, amountY: BN$1, amountXInActiveBin: BN$1, amountYInActiveBin: BN$1, minBinId: number, maxBinId: number, strategyType: StrategyType): BN$1;
|
|
9836
|
-
declare function toStrategyParameters({ maxBinId, minBinId, strategyType, singleSidedX, }: StrategyParameters): ProgramStrategyParameter;
|
|
9837
|
-
|
|
9838
|
-
/**
|
|
9839
|
-
* It fetches the pool account from the AMM program, and returns the mint addresses for the two tokens
|
|
9840
|
-
* @param {Connection} connection - Connection - The connection to the Solana cluster
|
|
9841
|
-
* @param {string} poolAddress - The address of the pool account.
|
|
9842
|
-
* @returns The tokenAMint and tokenBMint addresses for the pool.
|
|
9843
|
-
*/
|
|
9844
|
-
declare function getTokensMintFromPoolAddress(connection: Connection, poolAddress: string, opt?: {
|
|
9845
|
-
cluster?: Cluster;
|
|
9846
|
-
programId?: PublicKey;
|
|
9847
|
-
}): Promise<{
|
|
9848
|
-
tokenXMint: PublicKey;
|
|
9849
|
-
tokenYMint: PublicKey;
|
|
9850
|
-
}>;
|
|
9851
|
-
declare function getTokenProgramId(lbPairState: LbPair): {
|
|
9852
|
-
tokenXProgram: PublicKey;
|
|
9853
|
-
tokenYProgram: PublicKey;
|
|
9854
|
-
};
|
|
9855
|
-
|
|
9856
10061
|
declare function chunks<T>(array: T[], size: number): T[][];
|
|
9857
10062
|
declare function range<T>(min: number, max: number, mapfn: (i: number) => T): T[];
|
|
9858
10063
|
declare function chunkedFetchMultiplePoolAccount(program: ClmmProgram, pks: PublicKey[], chunkSize?: number): Promise<{
|
|
@@ -9960,7 +10165,78 @@ type Opt = {
|
|
|
9960
10165
|
declare function createProgram(connection: Connection, opt?: Opt): Program<LbClmm>;
|
|
9961
10166
|
declare function decodeAccount<T extends LbPair | BinArrayBitmapExtension | BinArray | PositionV2 | Position | PresetParameter | PresetParameter2>(program: Program<LbClmm>, accountName: AccountName, buffer: Buffer): T;
|
|
9962
10167
|
declare function getAccountDiscriminator(accountName: AccountName): IdlDiscriminator;
|
|
10168
|
+
/**
|
|
10169
|
+
* Caps a slippage percentage to be between 0 and 100.
|
|
10170
|
+
* @param slippage The slippage percentage to be capped.
|
|
10171
|
+
* @returns The capped slippage percentage.
|
|
10172
|
+
*/
|
|
9963
10173
|
declare function capSlippagePercentage(slippage: number): number;
|
|
10174
|
+
/**
|
|
10175
|
+
* Given a slippage percentage and a bin step, calculate the maximum number of bins
|
|
10176
|
+
* that the user is willing to allow the active bin to drift from the target price.
|
|
10177
|
+
* If the slippage percentage is 0 or null, return the maxActiveBinSlippage instead.
|
|
10178
|
+
*
|
|
10179
|
+
* @param slippagePercentage The slippage percentage in basis points.
|
|
10180
|
+
* @param binStep The bin step of the pair.
|
|
10181
|
+
* @param maxActiveBinSlippage The maximum number of bins that the active bin can drift.
|
|
10182
|
+
* @returns The maximum number of bins that the user is willing to allow the active bin to drift.
|
|
10183
|
+
*/
|
|
10184
|
+
declare function getAndCapMaxActiveBinSlippage(slippagePercentage: number, binStep: number, maxActiveBinSlippage: number): number;
|
|
10185
|
+
/**
|
|
10186
|
+
* Calculates the number of bins in a given range.
|
|
10187
|
+
*
|
|
10188
|
+
* @param minBinId The minimum bin id of the range.
|
|
10189
|
+
* @param maxBinId The maximum bin id of the range.
|
|
10190
|
+
* @returns The number of bins in the range.
|
|
10191
|
+
*/
|
|
10192
|
+
declare function getBinCount(minBinId: number, maxBinId: number): number;
|
|
10193
|
+
/**
|
|
10194
|
+
* Calculates the maximum amount of tokens after applying slippage to the given amount.
|
|
10195
|
+
*
|
|
10196
|
+
* @param amount The amount of tokens before slippage.
|
|
10197
|
+
* @param slippage The percentage of slippage to apply.
|
|
10198
|
+
* @returns The maximum amount of tokens after applying slippage. If the slippage is 100%, the maximum amount is U64_MAX.
|
|
10199
|
+
*
|
|
10200
|
+
**/
|
|
10201
|
+
declare function getSlippageMaxAmount(amount: BN$1, slippage: number): BN$1;
|
|
10202
|
+
/**
|
|
10203
|
+
* Calculates the minimum amount of tokens after applying slippage to the given amount.
|
|
10204
|
+
*
|
|
10205
|
+
* @param amount The amount of tokens before slippage.
|
|
10206
|
+
* @param slippage The percentage of slippage to apply.
|
|
10207
|
+
* @returns The minimum amount of tokens after applying slippage.
|
|
10208
|
+
*/
|
|
10209
|
+
declare function getSlippageMinAmount(amount: BN$1, slippage: number): BN$1;
|
|
10210
|
+
/**
|
|
10211
|
+
* Calculates the number of positions required to cover a range of bins.
|
|
10212
|
+
*
|
|
10213
|
+
* @param binCount The number of bins in the range.
|
|
10214
|
+
* @returns The number of positions required to cover the range of bins.
|
|
10215
|
+
*/
|
|
10216
|
+
declare function getPositionCountByBinCount(binCount: number): number;
|
|
10217
|
+
/**
|
|
10218
|
+
* Adjusts the liquidity parameters to reset uninvolved liquidity based on delta IDs.
|
|
10219
|
+
*
|
|
10220
|
+
* This function modifies the provided liquidity strategy parameters by resetting
|
|
10221
|
+
* the x0, y0, deltaX, and deltaY values when certain conditions regarding the
|
|
10222
|
+
* minDeltaId and maxDeltaId are met. If the maxDeltaId is less than or equal
|
|
10223
|
+
* to the end of the bid side delta ID, x0 and deltaX are set to zero. If the
|
|
10224
|
+
* minDeltaId is greater than or equal to the start of the ask side delta ID,
|
|
10225
|
+
* y0 and deltaY are set to zero.
|
|
10226
|
+
*
|
|
10227
|
+
* @param minDeltaId - The minimum delta ID.
|
|
10228
|
+
* @param maxDeltaId - The maximum delta ID.
|
|
10229
|
+
* @param favorXInActiveId - A boolean indicating if X is favored in the active bin.
|
|
10230
|
+
* @param params - The liquidity strategy parameters containing x0, y0, deltaX, and deltaY.
|
|
10231
|
+
* @returns An object containing the adjusted x0, y0, deltaX, and deltaY values.
|
|
10232
|
+
*/
|
|
10233
|
+
declare function resetUninvolvedLiquidityParams(minDeltaId: BN$1, maxDeltaId: BN$1, favorXInActiveId: boolean, params: LiquidityStrategyParameters): {
|
|
10234
|
+
x0: BN$1;
|
|
10235
|
+
y0: BN$1;
|
|
10236
|
+
deltaX: BN$1;
|
|
10237
|
+
deltaY: BN$1;
|
|
10238
|
+
};
|
|
10239
|
+
declare function chunkDepositWithRebalanceEndpoint(dlmm: DLMM, strategy: StrategyParameters, slippagePercentage: number, maxActiveBinSlippage: number, position: PublicKey, positionMinBinId: number, positionMaxBinId: number, liquidityStrategyParameters: LiquidityStrategyParameters, owner: PublicKey, payer: PublicKey, simulateCU: boolean): Promise<TransactionInstruction[][]>;
|
|
9964
10240
|
|
|
9965
10241
|
declare class DLMM {
|
|
9966
10242
|
pubkey: PublicKey;
|
|
@@ -10306,6 +10582,10 @@ declare class DLMM {
|
|
|
10306
10582
|
binArrayCost: Decimal;
|
|
10307
10583
|
}>;
|
|
10308
10584
|
quoteCreatePosition({ strategy }: TQuoteCreatePositionParams): Promise<{
|
|
10585
|
+
positionCount: number;
|
|
10586
|
+
positionCost: number;
|
|
10587
|
+
positionReallocCost: number;
|
|
10588
|
+
bitmapExtensionCost: number;
|
|
10309
10589
|
binArraysCount: number;
|
|
10310
10590
|
binArrayCost: number;
|
|
10311
10591
|
transactionCount: number;
|
|
@@ -10334,6 +10614,33 @@ declare class DLMM {
|
|
|
10334
10614
|
* - `version`: The version of the position (in this case, `Position.V2`)
|
|
10335
10615
|
*/
|
|
10336
10616
|
getPosition(positionPubKey: PublicKey): Promise<LbPosition>;
|
|
10617
|
+
/**
|
|
10618
|
+
* Creates multiple positions and adds liquidity by strategy without chainsaw issues.
|
|
10619
|
+
* @param positionKeypairGenerator A function that generates a specified number of keypairs.
|
|
10620
|
+
* @param totalXAmount The total amount of token X to be added.
|
|
10621
|
+
* @param totalYAmount The total amount of token Y to be added.
|
|
10622
|
+
* @param strategy The strategy for adding liquidity.
|
|
10623
|
+
* @param owner The owner of the position.
|
|
10624
|
+
* @param payer The payer of the transaction.
|
|
10625
|
+
* @param slippagePercentage The slippage percentage for adding liquidity.
|
|
10626
|
+
* @returns An object with two properties: `initPositionIxs` and `addLiquidityIxs`.
|
|
10627
|
+
*/
|
|
10628
|
+
initializeMultiplePositionAndAddLiquidityByStrategy(positionKeypairGenerator: (count: number) => Promise<Keypair[]>, totalXAmount: BN$1, totalYAmount: BN$1, strategy: StrategyParameters, owner: PublicKey, payer: PublicKey, slippagePercentage: number): Promise<InitializeMultiplePositionAndAddLiquidityByStrategyResponse>;
|
|
10629
|
+
/**
|
|
10630
|
+
* Adds liquidity to an existing position using a specified strategy, allowing for chunkable transactions.
|
|
10631
|
+
* If adding liquidity to bin out of position range, it will automatically expand. The limitation is 70 bins.
|
|
10632
|
+
*
|
|
10633
|
+
* @param {TInitializePositionAndAddLiquidityParamsByStrategy} params - The parameters required for adding liquidity.
|
|
10634
|
+
* @param {PublicKey} params.positionPubKey - The public key of the position to which liquidity is being added.
|
|
10635
|
+
* @param {BN} params.totalXAmount - The total amount of token X to be added as liquidity.
|
|
10636
|
+
* @param {BN} params.totalYAmount - The total amount of token Y to be added as liquidity.
|
|
10637
|
+
* @param {StrategyParameters} params.strategy - The strategy parameters for adding liquidity.
|
|
10638
|
+
* @param {PublicKey} params.user - The public key of the user adding liquidity.
|
|
10639
|
+
* @param {number} params.slippage - The slippage percentage allowed for the transaction.
|
|
10640
|
+
*
|
|
10641
|
+
* @returns {Promise<Transaction[]>} A promise that resolves to an array of transactions for adding liquidity.
|
|
10642
|
+
*/
|
|
10643
|
+
addLiquidityByStrategyChunkable({ positionPubKey, totalXAmount, totalYAmount, strategy, user, slippage, }: TInitializePositionAndAddLiquidityParamsByStrategy): Promise<Transaction[]>;
|
|
10337
10644
|
/**
|
|
10338
10645
|
* The function `initializePositionAndAddLiquidityByStrategy` function is used to initializes a position and adds liquidity
|
|
10339
10646
|
* @param {TInitializePositionAndAddLiquidityParamsByStrategy}
|
|
@@ -10362,7 +10669,7 @@ declare class DLMM {
|
|
|
10362
10669
|
*/
|
|
10363
10670
|
initializePositionAndAddLiquidityByWeight({ positionPubKey, totalXAmount, totalYAmount, xYAmountDistribution, user, slippage, }: TInitializePositionAndAddLiquidityParams): Promise<Transaction | Transaction[]>;
|
|
10364
10671
|
/**
|
|
10365
|
-
* The `addLiquidityByStrategy` function is used to add liquidity to existing position
|
|
10672
|
+
* The `addLiquidityByStrategy` function is used to add liquidity to existing position
|
|
10366
10673
|
* @param {TInitializePositionAndAddLiquidityParamsByStrategy}
|
|
10367
10674
|
* - `positionPubKey`: The public key of the position account. (usually use `new Keypair()`)
|
|
10368
10675
|
* - `totalXAmount`: The total amount of token X to be added to the liquidity pool.
|
|
@@ -10370,9 +10677,10 @@ declare class DLMM {
|
|
|
10370
10677
|
* - `strategy`: The strategy parameters to be used for the liquidity pool (Can use `calculateStrategyParameter` to calculate).
|
|
10371
10678
|
* - `user`: The public key of the user account.
|
|
10372
10679
|
* - `slippage`: The slippage percentage to be used for the liquidity pool.
|
|
10373
|
-
* @returns {Promise<Transaction
|
|
10680
|
+
* @returns {Promise<Transaction>} The function `addLiquidityByWeight` returns a `Promise` that resolves to either a single
|
|
10681
|
+
* `Transaction` object
|
|
10374
10682
|
*/
|
|
10375
|
-
addLiquidityByStrategy({ positionPubKey, totalXAmount, totalYAmount, strategy, user, slippage, }: TInitializePositionAndAddLiquidityParamsByStrategy): Promise<Transaction
|
|
10683
|
+
addLiquidityByStrategy({ positionPubKey, totalXAmount, totalYAmount, strategy, user, slippage, }: TInitializePositionAndAddLiquidityParamsByStrategy): Promise<Transaction>;
|
|
10376
10684
|
/**
|
|
10377
10685
|
* @deprecated Use `addLiquidityByStrategy` instead which support both token and token2022.
|
|
10378
10686
|
* The `addLiquidityByWeight` function is used to add liquidity to existing position
|
|
@@ -10687,7 +10995,10 @@ declare class DLMM {
|
|
|
10687
10995
|
*
|
|
10688
10996
|
* @returns An object containing the instructions to initialize new bin arrays and the instruction to rebalance the position.
|
|
10689
10997
|
*/
|
|
10690
|
-
rebalancePosition(rebalancePositionResponse: RebalancePositionResponse, maxActiveBinSlippage: BN$1, rentPayer?: PublicKey, slippage?: number): Promise<
|
|
10998
|
+
rebalancePosition(rebalancePositionResponse: RebalancePositionResponse, maxActiveBinSlippage: BN$1, rentPayer?: PublicKey, slippage?: number): Promise<{
|
|
10999
|
+
initBinArrayInstructions: TransactionInstruction[];
|
|
11000
|
+
rebalancePositionInstruction: TransactionInstruction[];
|
|
11001
|
+
}>;
|
|
10691
11002
|
/**
|
|
10692
11003
|
* Create an extended empty position.
|
|
10693
11004
|
*
|
|
@@ -10713,7 +11024,10 @@ declare class DLMM {
|
|
|
10713
11024
|
static updateReference(activeId: number, vParameter: vParameters, sParameter: sParameters, currentTimestamp: number): void;
|
|
10714
11025
|
private createClaimBuildMethod;
|
|
10715
11026
|
private createClaimSwapFeeMethod;
|
|
10716
|
-
|
|
11027
|
+
getPotentialToken2022IxDataAndAccounts(actionType: ActionType, rewardIndex?: number): {
|
|
11028
|
+
slices: RemainingAccountsInfoSlice[];
|
|
11029
|
+
accounts: AccountMeta[];
|
|
11030
|
+
};
|
|
10717
11031
|
}
|
|
10718
11032
|
|
|
10719
11033
|
var address = "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
|
|
@@ -21610,4 +21924,4 @@ declare const MAX_EXTRA_BIN_ARRAYS = 3;
|
|
|
21610
21924
|
declare const U64_MAX: BN$1;
|
|
21611
21925
|
declare const MAX_BINS_PER_POSITION: BN$1;
|
|
21612
21926
|
|
|
21613
|
-
export { ADMIN, AccountName, ActionType, ActivationType, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_FEE, BIN_ARRAY_BITMAP_FEE_BN, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, BIN_ARRAY_FEE_BN, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, Clock, ClockLayout, CompressedBinDepositAmount, CompressedBinDepositAmounts, DEFAULT_BIN_PER_POSITION, DLMMError, DlmmSdkError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, ExtendedPositionBinData, 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_BINS_PER_POSITION, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_CLAIM_ALL_ALLOWED, MAX_EXTRA_BIN_ARRAYS, MAX_FEE_RATE, MAX_RESIZE_LENGTH, MEMO_PROGRAM_ID, Network, Opt, POOL_FEE, POOL_FEE_BN, POSITION_BIN_DATA_SIZE, POSITION_FEE, POSITION_FEE_BN, POSITION_MAX_LENGTH, POSITION_MIN_SIZE, PRECISION, PairLockInfo, PairStatus, PairType, Position, PositionBinData, PositionData, PositionInfo, PositionLockInfo, PositionV2, PositionVersion, PresetParameter, PresetParameter2, ProgramStrategyParameter, ProgramStrategyType, RebalanceAddLiquidityParam, RebalancePositionBinArrayRentalCostQuote, RebalancePositionResponse, RebalanceRemoveLiquidityParam, RemainingAccountInfo, RemainingAccountsInfoSlice, ResizeSide, ResizeSideEnum, RewardInfo, RewardInfos, SCALE, SCALE_OFFSET, SIMULATION_USER, SeedLiquidityCostBreakdown, SeedLiquidityResponse, SeedLiquiditySingleBinResponse, Strategy, StrategyParameters, StrategyType, SwapExactOutParams, SwapFee, SwapParams, SwapQuote, SwapQuoteExactOut, SwapWithPriceImpactParams, TInitializeMultiplePositionAndAddLiquidityParamsByStrategy, TInitializePositionAndAddLiquidityParams, TInitializePositionAndAddLiquidityParamsByStrategy, TOKEN_ACCOUNT_FEE, TOKEN_ACCOUNT_FEE_BN, TQuoteCreatePositionParams, TokenReserve, U64_MAX, UserFeeInfo, UserRewardInfo, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, binIdToBinArrayIndex, calculateBidAskDistribution, calculateNormalDistribution, calculateSpotDistribution, capSlippagePercentage, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeFee, computeFeeFromAmount, computeProtocolFee, createProgram, decodeAccount, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveCustomizablePermissionlessLbPair, deriveEventAuthority, deriveLbPair, deriveLbPair2, deriveLbPairWithPresetParamWithIndexKey, deriveOracle, derivePermissionLbPair, derivePosition, derivePresetParameter, derivePresetParameter2, derivePresetParameterWithIndex, deriveReserve, deriveRewardVault, deriveTokenBadge, enumerateBins, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getAccountDiscriminator, getBaseFee, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinFromBinArray, getBinIdIndexInBinArray, 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, updateBinArray, vParameters, wrapSOLInstruction };
|
|
21927
|
+
export { ADMIN, AccountName, ActionType, ActivationType, AmountIntoBin, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_FEE, BIN_ARRAY_BITMAP_FEE_BN, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, BIN_ARRAY_FEE_BN, BidAskParameters, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, Clock, ClockLayout, CompressedBinDepositAmount, CompressedBinDepositAmounts, CreateRebalancePositionParams, DEFAULT_BIN_PER_POSITION, DLMMError, DlmmSdkError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, ExtendedPositionBinData, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, IDL, ILM_BASE, IPosition, InitCustomizablePermissionlessPairIx, InitPermissionPairIx, InitializeMultiplePositionAndAddLiquidityByStrategyResponse, LBCLMM_PROGRAM_IDS, LMRewards, LbClmm, LbPair, LbPairAccount, LbPosition, LiquidityOneSideParameter, LiquidityParameter, LiquidityParameterByStrategy, LiquidityParameterByStrategyOneSide, LiquidityParameterByWeight, LiquidityStrategyParameterBuilder, LiquidityStrategyParameters, MAX_ACTIVE_BIN_SLIPPAGE, MAX_BINS_PER_POSITION, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_CLAIM_ALL_ALLOWED, MAX_EXTRA_BIN_ARRAYS, MAX_FEE_RATE, MAX_RESIZE_LENGTH, MEMO_PROGRAM_ID, Network, Opt, POOL_FEE, POOL_FEE_BN, POSITION_BIN_DATA_SIZE, POSITION_FEE, POSITION_FEE_BN, POSITION_MAX_LENGTH, POSITION_MIN_SIZE, PRECISION, PairLockInfo, PairStatus, PairType, Position, PositionBinData, PositionData, PositionInfo, PositionLockInfo, PositionV2, PositionV2Wrapper, PositionVersion, PresetParameter, PresetParameter2, ProgramStrategyParameter, ProgramStrategyType, RebalanceAddLiquidityParam, RebalancePosition, RebalancePositionBinArrayRentalCostQuote, RebalancePositionResponse, RebalanceRemoveLiquidityParam, RebalanceWithDeposit, RebalanceWithWithdraw, RemainingAccountInfo, RemainingAccountsInfoSlice, ResizeSide, ResizeSideEnum, RewardInfo, RewardInfos, SCALE, SCALE_OFFSET, SIMULATION_USER, SeedLiquidityCostBreakdown, SeedLiquidityResponse, SeedLiquiditySingleBinResponse, SimulateRebalanceResp, Strategy, StrategyParameters, StrategyType, SwapExactOutParams, SwapFee, SwapParams, SwapQuote, SwapQuoteExactOut, SwapWithPriceImpactParams, TInitializeMultiplePositionAndAddLiquidityParamsByStrategy, TInitializePositionAndAddLiquidityParams, TInitializePositionAndAddLiquidityParamsByStrategy, TOKEN_ACCOUNT_FEE, TOKEN_ACCOUNT_FEE_BN, TQuoteCreatePositionParams, TokenReserve, U64_MAX, UserFeeInfo, UserRewardInfo, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, binIdToBinArrayIndex, buildBitFlagAndNegateStrategyParameters, buildLiquidityStrategyParameters, calculateBidAskDistribution, calculateNormalDistribution, calculatePositionSize, calculateSpotDistribution, capSlippagePercentage, chunkBinRange, chunkBinRangeIntoExtendedPositions, chunkDepositWithRebalanceEndpoint, chunkPositionBinRange, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeFee, computeFeeFromAmount, computeProtocolFee, createProgram, decodeAccount, decodeExtendedPosition, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveCustomizablePermissionlessLbPair, deriveEventAuthority, deriveLbPair, deriveLbPair2, deriveLbPairWithPresetParamWithIndexKey, deriveOracle, derivePermissionLbPair, derivePlaceHolderAccountMeta, derivePosition, derivePresetParameter, derivePresetParameter2, derivePresetParameterWithIndex, deriveReserve, deriveRewardVault, deriveTokenBadge, enumerateBins, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getAccountDiscriminator, getAmountInBinsAskSide, getAmountInBinsBidSide, getAndCapMaxActiveBinSlippage, getAutoFillAmountByRebalancedPosition, getBaseFee, getBinArrayAccountMetasCoverage, getBinArrayIndexesCoverage, getBinArrayKeysCoverage, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinCount, getBinFromBinArray, getBinIdIndexInBinArray, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExtendedPositionBinCount, getLiquidityStrategyParameterBuilder, getOrCreateATAInstruction, getOutAmount, getPositionCountByBinCount, getPositionExpandRentExemption, getPositionLowerUpperBinIdWithLiquidity, getPositionRentExemption, getPriceOfBinByBinId, getRebalanceBinArrayIndexesAndBitmapCoverage, getSlippageMaxAmount, getSlippageMinAmount, getTokenBalance, getTokenDecimals, getTokenProgramId, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, isPositionNoFee, isPositionNoReward, parseLogs, range, resetUninvolvedLiquidityParams, sParameters, suggestBalancedXParametersFromY, suggestBalancedYParametersFromX, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountIntoBins, toAmountsBothSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, updateBinArray, vParameters, wrapPosition, wrapSOLInstruction };
|