@meteora-ag/dlmm 1.6.0-rc.26 → 1.6.0-rc.28

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,7 +1,7 @@
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
6
  import { IdlDiscriminator } from '@coral-xyz/anchor/dist/cjs/idl';
7
7
  import { Mint } from '@solana/spl-token';
@@ -9755,6 +9755,150 @@ declare function getTokenProgramId(lbPairState: LbPair): {
9755
9755
  tokenYProgram: PublicKey;
9756
9756
  };
9757
9757
 
9758
+ interface IPosition {
9759
+ address(): PublicKey;
9760
+ lowerBinId(): BN;
9761
+ upperBinId(): BN;
9762
+ liquidityShares(): BN[];
9763
+ rewardInfos(): UserRewardInfo[];
9764
+ feeInfos(): UserFeeInfo[];
9765
+ lastUpdatedAt(): BN;
9766
+ lbPair(): PublicKey;
9767
+ totalClaimedFeeXAmount(): BN;
9768
+ totalClaimedFeeYAmount(): BN;
9769
+ totalClaimedRewards(): BN[];
9770
+ operator(): PublicKey;
9771
+ lockReleasePoint(): BN;
9772
+ feeOwner(): PublicKey;
9773
+ owner(): PublicKey;
9774
+ getBinArrayIndexesCoverage(): BN[];
9775
+ getBinArrayKeysCoverage(programId: PublicKey): PublicKey[];
9776
+ version(): PositionVersion;
9777
+ width(): BN;
9778
+ }
9779
+ interface CombinedPositionBinData {
9780
+ liquidityShares: BN[];
9781
+ rewardInfos: UserRewardInfo[];
9782
+ feeInfos: UserFeeInfo[];
9783
+ }
9784
+ declare function wrapPosition(program: Program<LbClmm>, key: PublicKey, account: AccountInfo<Buffer>): IPosition;
9785
+ declare class PositionV2Wrapper implements IPosition {
9786
+ positionAddress: PublicKey;
9787
+ inner: PositionV2;
9788
+ extended: ExtendedPositionBinData[];
9789
+ combinedPositionBinData: CombinedPositionBinData;
9790
+ constructor(positionAddress: PublicKey, inner: PositionV2, extended: ExtendedPositionBinData[], combinedPositionBinData: CombinedPositionBinData);
9791
+ address(): PublicKey;
9792
+ totalClaimedRewards(): BN[];
9793
+ feeOwner(): PublicKey;
9794
+ lockReleasePoint(): BN;
9795
+ operator(): PublicKey;
9796
+ totalClaimedFeeYAmount(): BN;
9797
+ totalClaimedFeeXAmount(): BN;
9798
+ lbPair(): PublicKey;
9799
+ lowerBinId(): BN;
9800
+ upperBinId(): BN;
9801
+ liquidityShares(): BN[];
9802
+ rewardInfos(): UserRewardInfo[];
9803
+ feeInfos(): UserFeeInfo[];
9804
+ lastUpdatedAt(): BN;
9805
+ getBinArrayIndexesCoverage(): BN[];
9806
+ getBinArrayKeysCoverage(programId: PublicKey): PublicKey[];
9807
+ version(): PositionVersion;
9808
+ owner(): PublicKey;
9809
+ width(): BN;
9810
+ }
9811
+
9812
+ declare function getBinArrayIndexesCoverage(lowerBinId: BN, upperBinId: BN): BN[];
9813
+ declare function getBinArrayKeysCoverage(lowerBinId: BN, upperBinId: BN, lbPair: PublicKey, programId: PublicKey): PublicKey[];
9814
+ declare function getBinArrayAccountMetasCoverage(lowerBinId: BN, upperBinId: BN, lbPair: PublicKey, programId: PublicKey): AccountMeta[];
9815
+ declare function getPositionLowerUpperBinIdWithLiquidity(position: PositionData): {
9816
+ lowerBinId: BN;
9817
+ upperBinId: BN;
9818
+ } | null;
9819
+ declare function isPositionNoFee(position: PositionData): boolean;
9820
+ declare function isPositionNoReward(position: PositionData): boolean;
9821
+ /**
9822
+ * Divides a range of bin IDs into chunks, each with a maximum length defined by POSITION_MAX_LENGTH,
9823
+ * and returns an array of objects representing the lower and upper bin IDs for each chunk.
9824
+ *
9825
+ * @param {number} minBinId - The starting bin ID of the range.
9826
+ * @param {number} maxBinId - The ending bin ID of the range.
9827
+ * @returns {{ lowerBinId: number; upperBinId: number }[]} An array of objects, each containing a
9828
+ * 'lowerBinId' and 'upperBinId', representing the range of bin IDs in each chunk.
9829
+ */
9830
+ declare function chunkBinRangeIntoExtendedPositions(minBinId: number, maxBinId: number): {
9831
+ lowerBinId: number;
9832
+ upperBinId: number;
9833
+ }[];
9834
+ /**
9835
+ * Divides a range of bin IDs into chunks, each with a length defined by DEFAULT_BIN_PER_POSITION,
9836
+ * and returns an array of objects representing the lower and upper bin IDs for each chunk.
9837
+ * Mainly used for chunking bin range to execute multiple add/remove liquidity, claim fee/reward
9838
+ *
9839
+ * @param {number} minBinId - The starting bin ID of the range.
9840
+ * @param {number} maxBinId - The ending bin ID of the range.
9841
+ * @returns {{ lowerBinId: number; upperBinId: number }[]} An array of objects, each containing a
9842
+ * 'lowerBinId' and 'upperBinId', representing the range of bin IDs in each chunk.
9843
+ */
9844
+ declare function chunkBinRange(minBinId: number, maxBinId: number): {
9845
+ lowerBinId: number;
9846
+ upperBinId: number;
9847
+ }[];
9848
+ declare function chunkPositionBinRange(position: LbPosition, minBinId: number, maxBinId: number): {
9849
+ minBinId: number;
9850
+ maxBinId: number;
9851
+ amountX: BN;
9852
+ amountY: BN;
9853
+ feeXAmount: BN;
9854
+ feeYAmount: BN;
9855
+ rewardAmounts: BN[];
9856
+ }[];
9857
+ declare function calculatePositionSize(binCount: BN): BN;
9858
+ /**
9859
+ * Get the minimum balance required to pay for the rent exemption of a
9860
+ * position with the given bin count.
9861
+ *
9862
+ * @param connection The connection to the Solana RPC node.
9863
+ * @param binCount The number of bins in the position.
9864
+ * @returns The minimum balance required to pay for the rent exemption.
9865
+ */
9866
+ declare function getPositionRentExemption(connection: Connection, binCount: BN): Promise<number>;
9867
+ /**
9868
+ * Calculate the minimum lamports required to expand a position to a given
9869
+ * width.
9870
+ *
9871
+ * The function takes into account the current width of the position and the
9872
+ * width to expand to. If the expanded width is less than or equal to the
9873
+ * default bin count per position, the function returns 0.
9874
+ *
9875
+ * @param currentMinBinId The current minimum bin ID of the position.
9876
+ * @param currentMaxBinId The current maximum bin ID of the position.
9877
+ * @param connection The connection to the Solana RPC node.
9878
+ * @param binCountToExpand The number of bins to expand the position by.
9879
+ * @returns The minimum lamports required to expand the position to the given
9880
+ * width.
9881
+ */
9882
+ declare function getPositionExpandRentExemption(currentMinBinId: BN, currentMaxBinId: BN, connection: Connection, binCountToExpand: BN): Promise<number>;
9883
+ /**
9884
+ * Calculate the number of extended bins in a position.
9885
+ *
9886
+ * @param minBinId The minimum bin ID of the position.
9887
+ * @param maxBinId The maximum bin ID of the position.
9888
+ * @returns The number of extended bins in the position. If the position width is
9889
+ * less than or equal to the default bin count per position, returns 0.
9890
+ */
9891
+ declare function getExtendedPositionBinCount(minBinId: BN, maxBinId: BN): BN;
9892
+ /**
9893
+ * Decode the extended position data.
9894
+ *
9895
+ * @param base The base position with the base data.
9896
+ * @param program The program that the position is associated with.
9897
+ * @param bytes The buffer of bytes to decode.
9898
+ * @returns The decoded extended position data.
9899
+ */
9900
+ declare function decodeExtendedPosition(base: PositionV2, program: Program<LbClmm>, bytes: Buffer): ExtendedPositionBinData[];
9901
+
9758
9902
  /**
9759
9903
  * Given a strategy type and amounts of X and Y, returns the distribution of liquidity.
9760
9904
  * @param activeId The bin id of the active bin.
@@ -10437,6 +10581,10 @@ declare class DLMM {
10437
10581
  binArrayCost: Decimal;
10438
10582
  }>;
10439
10583
  quoteCreatePosition({ strategy }: TQuoteCreatePositionParams): Promise<{
10584
+ positionCount: number;
10585
+ positionCost: number;
10586
+ positionReallocCost: number;
10587
+ bitmapExtensionCost: number;
10440
10588
  binArraysCount: number;
10441
10589
  binArrayCost: number;
10442
10590
  transactionCount: number;
@@ -21775,4 +21923,4 @@ declare const MAX_EXTRA_BIN_ARRAYS = 3;
21775
21923
  declare const U64_MAX: BN$1;
21776
21924
  declare const MAX_BINS_PER_POSITION: BN$1;
21777
21925
 
21778
- 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, 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, 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, calculateSpotDistribution, capSlippagePercentage, chunkDepositWithRebalanceEndpoint, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeFee, computeFeeFromAmount, computeProtocolFee, createProgram, decodeAccount, 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, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinCount, getBinFromBinArray, getBinIdIndexInBinArray, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getLiquidityStrategyParameterBuilder, getOrCreateATAInstruction, getOutAmount, getPositionCountByBinCount, getPriceOfBinByBinId, getRebalanceBinArrayIndexesAndBitmapCoverage, getSlippageMaxAmount, getSlippageMinAmount, getTokenBalance, getTokenDecimals, getTokenProgramId, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parseLogs, range, resetUninvolvedLiquidityParams, sParameters, suggestBalancedXParametersFromY, suggestBalancedYParametersFromX, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountIntoBins, toAmountsBothSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, updateBinArray, vParameters, wrapSOLInstruction };
21926
+ 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 };
package/dist/index.js CHANGED
@@ -11267,6 +11267,20 @@ function isPositionNoFee(position) {
11267
11267
  function isPositionNoReward(position) {
11268
11268
  return position.rewardOne.isZero() && position.rewardTwo.isZero();
11269
11269
  }
11270
+ function chunkBinRangeIntoExtendedPositions(minBinId, maxBinId) {
11271
+ const chunkedBinRange = [];
11272
+ for (let currentMinBinId = minBinId; currentMinBinId <= maxBinId; currentMinBinId += POSITION_MAX_LENGTH.toNumber()) {
11273
+ const currentMaxBinId = Math.min(
11274
+ currentMinBinId + POSITION_MAX_LENGTH.toNumber() - 1,
11275
+ maxBinId
11276
+ );
11277
+ chunkedBinRange.push({
11278
+ lowerBinId: currentMinBinId,
11279
+ upperBinId: currentMaxBinId
11280
+ });
11281
+ }
11282
+ return chunkedBinRange;
11283
+ }
11270
11284
  function chunkBinRange(minBinId, maxBinId) {
11271
11285
  const chunkedBinRange = [];
11272
11286
  let startBinId = minBinId;
@@ -11283,6 +11297,65 @@ function chunkBinRange(minBinId, maxBinId) {
11283
11297
  }
11284
11298
  return chunkedBinRange;
11285
11299
  }
11300
+ function chunkPositionBinRange(position, minBinId, maxBinId) {
11301
+ const chunkedFeesAndRewards = [];
11302
+ let totalAmountX = new (0, _bnjs2.default)(0);
11303
+ let totalAmountY = new (0, _bnjs2.default)(0);
11304
+ let totalFeeXAmount = new (0, _bnjs2.default)(0);
11305
+ let totalFeeYAmount = new (0, _bnjs2.default)(0);
11306
+ let totalRewardAmounts = [new (0, _bnjs2.default)(0), new (0, _bnjs2.default)(0)];
11307
+ let count = 0;
11308
+ for (let i = 0; i < position.positionData.positionBinData.length; i++) {
11309
+ const positionBinData = position.positionData.positionBinData[i];
11310
+ if (positionBinData.binId >= minBinId && positionBinData.binId <= maxBinId) {
11311
+ totalFeeXAmount = totalFeeXAmount.add(
11312
+ new (0, _bnjs2.default)(positionBinData.positionFeeXAmount)
11313
+ );
11314
+ totalFeeYAmount = totalFeeYAmount.add(
11315
+ new (0, _bnjs2.default)(positionBinData.positionFeeYAmount)
11316
+ );
11317
+ totalAmountX = totalAmountX.add(new (0, _bnjs2.default)(positionBinData.positionXAmount));
11318
+ totalAmountY = totalAmountY.add(new (0, _bnjs2.default)(positionBinData.positionYAmount));
11319
+ for (const [
11320
+ index,
11321
+ reward
11322
+ ] of positionBinData.positionRewardAmount.entries()) {
11323
+ totalRewardAmounts[index] = totalRewardAmounts[index].add(
11324
+ new (0, _bnjs2.default)(reward)
11325
+ );
11326
+ }
11327
+ count++;
11328
+ }
11329
+ if (count === DEFAULT_BIN_PER_POSITION.toNumber() || positionBinData.binId == maxBinId) {
11330
+ chunkedFeesAndRewards.push({
11331
+ minBinId: positionBinData.binId - count + 1,
11332
+ maxBinId: positionBinData.binId,
11333
+ feeXAmount: totalFeeXAmount,
11334
+ feeYAmount: totalFeeYAmount,
11335
+ rewardAmounts: totalRewardAmounts,
11336
+ amountX: totalAmountX,
11337
+ amountY: totalAmountY
11338
+ });
11339
+ totalFeeXAmount = new (0, _bnjs2.default)(0);
11340
+ totalFeeYAmount = new (0, _bnjs2.default)(0);
11341
+ totalAmountX = new (0, _bnjs2.default)(0);
11342
+ totalAmountY = new (0, _bnjs2.default)(0);
11343
+ totalRewardAmounts = [new (0, _bnjs2.default)(0), new (0, _bnjs2.default)(0)];
11344
+ count = 0;
11345
+ }
11346
+ }
11347
+ return chunkedFeesAndRewards;
11348
+ }
11349
+ function calculatePositionSize(binCount) {
11350
+ const extraBinCount = binCount.gt(DEFAULT_BIN_PER_POSITION) ? binCount.sub(DEFAULT_BIN_PER_POSITION) : new (0, _bnjs2.default)(0);
11351
+ return new (0, _bnjs2.default)(POSITION_MIN_SIZE).add(
11352
+ extraBinCount.mul(new (0, _bnjs2.default)(POSITION_BIN_DATA_SIZE))
11353
+ );
11354
+ }
11355
+ function getPositionRentExemption(connection, binCount) {
11356
+ const size = calculatePositionSize(binCount);
11357
+ return connection.getMinimumBalanceForRentExemption(size.toNumber());
11358
+ }
11286
11359
  async function getPositionExpandRentExemption(currentMinBinId, currentMaxBinId, connection, binCountToExpand) {
11287
11360
  const currentPositionWidth = currentMaxBinId.sub(currentMinBinId).addn(1);
11288
11361
  const positionWidthAfterExpand = currentPositionWidth.add(binCountToExpand);
@@ -15036,7 +15109,11 @@ var DLMM = class {
15036
15109
  tokenY,
15037
15110
  new (0, _anchor.BN)(presetParameterState.binStep),
15038
15111
  new (0, _anchor.BN)(presetParameterState.baseFactor),
15039
- new (0, _anchor.BN)(presetParameterState.baseFactor)
15112
+ new (0, _anchor.BN)(presetParameterState.baseFactor),
15113
+ {
15114
+ cluster: _optionalChain([opt, 'optionalAccess', _69 => _69.cluster]),
15115
+ programId: _optionalChain([opt, 'optionalAccess', _70 => _70.programId])
15116
+ }
15040
15117
  );
15041
15118
  if (existsPool) {
15042
15119
  throw new Error("Pool already exists");
@@ -15263,7 +15340,7 @@ var DLMM = class {
15263
15340
  swapForY,
15264
15341
  new (0, _anchor.BN)(activeIdToLoop),
15265
15342
  this.lbPair,
15266
- _nullishCoalesce(_optionalChain([this, 'access', _69 => _69.binArrayBitmapExtension, 'optionalAccess', _70 => _70.account]), () => ( null))
15343
+ _nullishCoalesce(_optionalChain([this, 'access', _71 => _71.binArrayBitmapExtension, 'optionalAccess', _72 => _72.account]), () => ( null))
15267
15344
  );
15268
15345
  if (binArrayIndex === null)
15269
15346
  shouldStop = true;
@@ -15594,8 +15671,8 @@ var DLMM = class {
15594
15671
  position,
15595
15672
  this.tokenX.mint,
15596
15673
  this.tokenY.mint,
15597
- _optionalChain([this, 'access', _71 => _71.rewards, 'access', _72 => _72[0], 'optionalAccess', _73 => _73.mint]),
15598
- _optionalChain([this, 'access', _74 => _74.rewards, 'access', _75 => _75[1], 'optionalAccess', _76 => _76.mint]),
15674
+ _optionalChain([this, 'access', _73 => _73.rewards, 'access', _74 => _74[0], 'optionalAccess', _75 => _75.mint]),
15675
+ _optionalChain([this, 'access', _76 => _76.rewards, 'access', _77 => _77[1], 'optionalAccess', _78 => _78.mint]),
15599
15676
  positionBinArraysMapV2
15600
15677
  ),
15601
15678
  version: position.version()
@@ -15642,17 +15719,46 @@ var DLMM = class {
15642
15719
  }
15643
15720
  async quoteCreatePosition({ strategy }) {
15644
15721
  const { minBinId, maxBinId } = strategy;
15722
+ const binCount = maxBinId - minBinId + 1;
15723
+ const positionCount = Math.floor(binCount / MAX_BINS_PER_POSITION.toNumber()) + 1;
15724
+ let positionReallocCost = 0;
15725
+ for (let i = 0; i < positionCount; i++) {
15726
+ const lowerBinId = minBinId;
15727
+ const upperBinId = Math.min(
15728
+ maxBinId,
15729
+ lowerBinId + DEFAULT_BIN_PER_POSITION.toNumber() - 1
15730
+ );
15731
+ const maxUpperBinId = Math.min(
15732
+ maxBinId,
15733
+ upperBinId + MAX_BINS_PER_POSITION.toNumber() - 1
15734
+ );
15735
+ const binToExpand = maxUpperBinId - upperBinId;
15736
+ const { positionExtendCost } = await this.quoteExtendPosition(
15737
+ new (0, _anchor.BN)(lowerBinId),
15738
+ new (0, _anchor.BN)(upperBinId),
15739
+ new (0, _anchor.BN)(binToExpand)
15740
+ );
15741
+ positionReallocCost += positionExtendCost.toNumber();
15742
+ }
15645
15743
  const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(minBinId));
15646
15744
  const upperBinArrayIndex = _anchor.BN.max(
15647
15745
  binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId)),
15648
15746
  lowerBinArrayIndex.add(new (0, _anchor.BN)(1))
15649
15747
  );
15748
+ let bitmapExtensionCost = 0;
15749
+ if (isOverflowDefaultBinArrayBitmap(lowerBinArrayIndex) || isOverflowDefaultBinArrayBitmap(upperBinArrayIndex)) {
15750
+ bitmapExtensionCost = BIN_ARRAY_BITMAP_FEE;
15751
+ }
15650
15752
  const binArraysCount = (await this.binArraysToBeCreate(lowerBinArrayIndex, upperBinArrayIndex)).length;
15651
15753
  const transactionCount = Math.ceil(
15652
15754
  (maxBinId - minBinId + 1) / DEFAULT_BIN_PER_POSITION.toNumber()
15653
15755
  );
15654
15756
  const binArrayCost = binArraysCount * BIN_ARRAY_FEE;
15655
15757
  return {
15758
+ positionCount,
15759
+ positionCost: positionCount * POSITION_FEE,
15760
+ positionReallocCost,
15761
+ bitmapExtensionCost,
15656
15762
  binArraysCount,
15657
15763
  binArrayCost,
15658
15764
  transactionCount
@@ -15748,8 +15854,8 @@ var DLMM = class {
15748
15854
  position,
15749
15855
  this.tokenX.mint,
15750
15856
  this.tokenY.mint,
15751
- _optionalChain([this, 'access', _77 => _77.rewards, 'access', _78 => _78[0], 'optionalAccess', _79 => _79.mint]),
15752
- _optionalChain([this, 'access', _80 => _80.rewards, 'access', _81 => _81[1], 'optionalAccess', _82 => _82.mint]),
15857
+ _optionalChain([this, 'access', _79 => _79.rewards, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.mint]),
15858
+ _optionalChain([this, 'access', _82 => _82.rewards, 'access', _83 => _83[1], 'optionalAccess', _84 => _84.mint]),
15753
15859
  binArrayMap
15754
15860
  ),
15755
15861
  version: position.version()
@@ -16925,7 +17031,7 @@ var DLMM = class {
16925
17031
  swapForY,
16926
17032
  activeId,
16927
17033
  this.lbPair,
16928
- _nullishCoalesce(_optionalChain([this, 'access', _83 => _83.binArrayBitmapExtension, 'optionalAccess', _84 => _84.account]), () => ( null)),
17034
+ _nullishCoalesce(_optionalChain([this, 'access', _85 => _85.binArrayBitmapExtension, 'optionalAccess', _86 => _86.account]), () => ( null)),
16929
17035
  binArrays
16930
17036
  );
16931
17037
  if (binArrayAccountToSwap == null) {
@@ -16990,7 +17096,7 @@ var DLMM = class {
16990
17096
  swapForY,
16991
17097
  activeId,
16992
17098
  this.lbPair,
16993
- _nullishCoalesce(_optionalChain([this, 'access', _85 => _85.binArrayBitmapExtension, 'optionalAccess', _86 => _86.account]), () => ( null)),
17099
+ _nullishCoalesce(_optionalChain([this, 'access', _87 => _87.binArrayBitmapExtension, 'optionalAccess', _88 => _88.account]), () => ( null)),
16994
17100
  binArrays
16995
17101
  );
16996
17102
  if (binArrayAccountToSwap == null) {
@@ -17087,7 +17193,7 @@ var DLMM = class {
17087
17193
  swapForY,
17088
17194
  activeId,
17089
17195
  this.lbPair,
17090
- _nullishCoalesce(_optionalChain([this, 'access', _87 => _87.binArrayBitmapExtension, 'optionalAccess', _88 => _88.account]), () => ( null)),
17196
+ _nullishCoalesce(_optionalChain([this, 'access', _89 => _89.binArrayBitmapExtension, 'optionalAccess', _90 => _90.account]), () => ( null)),
17091
17197
  binArrays
17092
17198
  );
17093
17199
  if (binArrayAccountToSwap == null) {
@@ -17175,7 +17281,7 @@ var DLMM = class {
17175
17281
  swapForY,
17176
17282
  activeId,
17177
17283
  this.lbPair,
17178
- _nullishCoalesce(_optionalChain([this, 'access', _89 => _89.binArrayBitmapExtension, 'optionalAccess', _90 => _90.account]), () => ( null)),
17284
+ _nullishCoalesce(_optionalChain([this, 'access', _91 => _91.binArrayBitmapExtension, 'optionalAccess', _92 => _92.account]), () => ( null)),
17179
17285
  binArrays
17180
17286
  );
17181
17287
  if (binArrayAccountToSwap == null) {
@@ -18521,7 +18627,7 @@ var DLMM = class {
18521
18627
  swapForY,
18522
18628
  new (0, _anchor.BN)(activeBinId),
18523
18629
  this.lbPair,
18524
- _nullishCoalesce(_optionalChain([this, 'access', _91 => _91.binArrayBitmapExtension, 'optionalAccess', _92 => _92.account]), () => ( null))
18630
+ _nullishCoalesce(_optionalChain([this, 'access', _93 => _93.binArrayBitmapExtension, 'optionalAccess', _94 => _94.account]), () => ( null))
18525
18631
  );
18526
18632
  if (toBinArrayIndex === null)
18527
18633
  return true;
@@ -18558,7 +18664,7 @@ var DLMM = class {
18558
18664
  swapForY,
18559
18665
  new (0, _anchor.BN)(activeBinId),
18560
18666
  this.lbPair,
18561
- _nullishCoalesce(_optionalChain([this, 'access', _93 => _93.binArrayBitmapExtension, 'optionalAccess', _94 => _94.account]), () => ( null))
18667
+ _nullishCoalesce(_optionalChain([this, 'access', _95 => _95.binArrayBitmapExtension, 'optionalAccess', _96 => _96.account]), () => ( null))
18562
18668
  );
18563
18669
  const marketPriceBinArrayIndex = binIdToBinArrayIndex(
18564
18670
  new (0, _anchor.BN)(marketPriceBinId)
@@ -18594,7 +18700,7 @@ var DLMM = class {
18594
18700
  let binArrayBitmapExtension = null;
18595
18701
  if (binArrayBitMapExtensionPubkey) {
18596
18702
  binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
18597
- if (!_optionalChain([binArrayAccounts, 'optionalAccess', _95 => _95[0]])) {
18703
+ if (!_optionalChain([binArrayAccounts, 'optionalAccess', _97 => _97[0]])) {
18598
18704
  const initializeBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
18599
18705
  binArrayBitmapExtension: binArrayBitMapExtensionPubkey,
18600
18706
  funder: owner,
@@ -18603,10 +18709,10 @@ var DLMM = class {
18603
18709
  preInstructions.push(initializeBitmapExtensionIx);
18604
18710
  }
18605
18711
  }
18606
- if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _96 => _96[1]])) {
18712
+ if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _98 => _98[1]])) {
18607
18713
  fromBinArray = fromBinArrayPubkey;
18608
18714
  }
18609
- if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _97 => _97[2]]) && !!toBinArrayIndex) {
18715
+ if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _99 => _99[2]]) && !!toBinArrayIndex) {
18610
18716
  toBinArray = toBinArrayPubkey;
18611
18717
  }
18612
18718
  const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
@@ -19512,7 +19618,7 @@ var DLMM = class {
19512
19618
  );
19513
19619
  })
19514
19620
  );
19515
- const version = _nullishCoalesce(_optionalChain([binArrays, 'access', _98 => _98.find, 'call', _99 => _99((binArray) => binArray != null), 'optionalAccess', _100 => _100.version]), () => ( 1));
19621
+ const version = _nullishCoalesce(_optionalChain([binArrays, 'access', _100 => _100.find, 'call', _101 => _101((binArray) => binArray != null), 'optionalAccess', _102 => _102.version]), () => ( 1));
19516
19622
  return Array.from(
19517
19623
  enumerateBins(
19518
19624
  binsById,
@@ -19912,5 +20018,21 @@ var src_default = DLMM;
19912
20018
 
19913
20019
 
19914
20020
 
19915
- exports.ADMIN = ADMIN; exports.ActionType = ActionType; exports.ActivationType = ActivationType; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_ARRAY_BITMAP_FEE = BIN_ARRAY_BITMAP_FEE; exports.BIN_ARRAY_BITMAP_FEE_BN = BIN_ARRAY_BITMAP_FEE_BN; exports.BIN_ARRAY_BITMAP_SIZE = BIN_ARRAY_BITMAP_SIZE; exports.BIN_ARRAY_FEE = BIN_ARRAY_FEE; exports.BIN_ARRAY_FEE_BN = BIN_ARRAY_FEE_BN; exports.BinLiquidity = BinLiquidity; exports.BitmapType = BitmapType; exports.ClockLayout = ClockLayout; exports.DEFAULT_BIN_PER_POSITION = DEFAULT_BIN_PER_POSITION; exports.DLMMError = DLMMError; exports.DlmmSdkError = DlmmSdkError; exports.EXTENSION_BINARRAY_BITMAP_SIZE = EXTENSION_BINARRAY_BITMAP_SIZE; exports.FEE_PRECISION = FEE_PRECISION; exports.IDL = dlmm_default; exports.ILM_BASE = ILM_BASE; exports.LBCLMM_PROGRAM_IDS = LBCLMM_PROGRAM_IDS; exports.MAX_ACTIVE_BIN_SLIPPAGE = MAX_ACTIVE_BIN_SLIPPAGE; exports.MAX_BINS_PER_POSITION = MAX_BINS_PER_POSITION; exports.MAX_BIN_ARRAY_SIZE = MAX_BIN_ARRAY_SIZE; exports.MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX; exports.MAX_CLAIM_ALL_ALLOWED = MAX_CLAIM_ALL_ALLOWED; exports.MAX_EXTRA_BIN_ARRAYS = MAX_EXTRA_BIN_ARRAYS; exports.MAX_FEE_RATE = MAX_FEE_RATE; exports.MAX_RESIZE_LENGTH = MAX_RESIZE_LENGTH; exports.MEMO_PROGRAM_ID = MEMO_PROGRAM_ID; exports.Network = Network; exports.POOL_FEE = POOL_FEE; exports.POOL_FEE_BN = POOL_FEE_BN; exports.POSITION_BIN_DATA_SIZE = POSITION_BIN_DATA_SIZE; exports.POSITION_FEE = POSITION_FEE; exports.POSITION_FEE_BN = POSITION_FEE_BN; exports.POSITION_MAX_LENGTH = POSITION_MAX_LENGTH; exports.POSITION_MIN_SIZE = POSITION_MIN_SIZE; exports.PRECISION = PRECISION; exports.PairStatus = PairStatus; exports.PairType = PairType; exports.PositionVersion = PositionVersion; exports.RebalancePosition = RebalancePosition; exports.ResizeSide = ResizeSide; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.Strategy = Strategy; exports.StrategyType = StrategyType; exports.TOKEN_ACCOUNT_FEE = TOKEN_ACCOUNT_FEE; exports.TOKEN_ACCOUNT_FEE_BN = TOKEN_ACCOUNT_FEE_BN; exports.U64_MAX = U64_MAX; exports.autoFillXByStrategy = autoFillXByStrategy; exports.autoFillXByWeight = autoFillXByWeight; exports.autoFillYByStrategy = autoFillYByStrategy; exports.autoFillYByWeight = autoFillYByWeight; exports.binIdToBinArrayIndex = binIdToBinArrayIndex; exports.buildBitFlagAndNegateStrategyParameters = buildBitFlagAndNegateStrategyParameters; exports.buildLiquidityStrategyParameters = buildLiquidityStrategyParameters; exports.calculateBidAskDistribution = calculateBidAskDistribution; exports.calculateNormalDistribution = calculateNormalDistribution; exports.calculateSpotDistribution = calculateSpotDistribution; exports.capSlippagePercentage = capSlippagePercentage; exports.chunkDepositWithRebalanceEndpoint = chunkDepositWithRebalanceEndpoint; exports.chunkedFetchMultipleBinArrayBitmapExtensionAccount = chunkedFetchMultipleBinArrayBitmapExtensionAccount; exports.chunkedFetchMultiplePoolAccount = chunkedFetchMultiplePoolAccount; exports.chunkedGetMultipleAccountInfos = chunkedGetMultipleAccountInfos; exports.chunks = chunks; exports.computeFee = computeFee; exports.computeFeeFromAmount = computeFeeFromAmount; exports.computeProtocolFee = computeProtocolFee; exports.createProgram = createProgram; exports.decodeAccount = decodeAccount; exports.default = src_default; exports.deriveBinArray = deriveBinArray; exports.deriveBinArrayBitmapExtension = deriveBinArrayBitmapExtension; exports.deriveCustomizablePermissionlessLbPair = deriveCustomizablePermissionlessLbPair; exports.deriveEventAuthority = deriveEventAuthority; exports.deriveLbPair = deriveLbPair; exports.deriveLbPair2 = deriveLbPair2; exports.deriveLbPairWithPresetParamWithIndexKey = deriveLbPairWithPresetParamWithIndexKey; exports.deriveOracle = deriveOracle; exports.derivePermissionLbPair = derivePermissionLbPair; exports.derivePlaceHolderAccountMeta = derivePlaceHolderAccountMeta; exports.derivePosition = derivePosition; exports.derivePresetParameter = derivePresetParameter; exports.derivePresetParameter2 = derivePresetParameter2; exports.derivePresetParameterWithIndex = derivePresetParameterWithIndex; exports.deriveReserve = deriveReserve; exports.deriveRewardVault = deriveRewardVault; exports.deriveTokenBadge = deriveTokenBadge; exports.enumerateBins = enumerateBins; exports.findNextBinArrayIndexWithLiquidity = findNextBinArrayIndexWithLiquidity; exports.findNextBinArrayWithLiquidity = findNextBinArrayWithLiquidity; exports.fromWeightDistributionToAmount = fromWeightDistributionToAmount; exports.fromWeightDistributionToAmountOneSide = fromWeightDistributionToAmountOneSide; exports.getAccountDiscriminator = getAccountDiscriminator; exports.getAmountInBinsAskSide = getAmountInBinsAskSide; exports.getAmountInBinsBidSide = getAmountInBinsBidSide; exports.getAndCapMaxActiveBinSlippage = getAndCapMaxActiveBinSlippage; exports.getAutoFillAmountByRebalancedPosition = getAutoFillAmountByRebalancedPosition; exports.getBaseFee = getBaseFee; exports.getBinArrayLowerUpperBinId = getBinArrayLowerUpperBinId; exports.getBinArraysRequiredByPositionRange = getBinArraysRequiredByPositionRange; exports.getBinCount = getBinCount; exports.getBinFromBinArray = getBinFromBinArray; exports.getBinIdIndexInBinArray = getBinIdIndexInBinArray; exports.getEstimatedComputeUnitIxWithBuffer = getEstimatedComputeUnitIxWithBuffer; exports.getEstimatedComputeUnitUsageWithBuffer = getEstimatedComputeUnitUsageWithBuffer; exports.getLiquidityStrategyParameterBuilder = getLiquidityStrategyParameterBuilder; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getOutAmount = getOutAmount; exports.getPositionCountByBinCount = getPositionCountByBinCount; exports.getPriceOfBinByBinId = getPriceOfBinByBinId; exports.getRebalanceBinArrayIndexesAndBitmapCoverage = getRebalanceBinArrayIndexesAndBitmapCoverage; exports.getSlippageMaxAmount = getSlippageMaxAmount; exports.getSlippageMinAmount = getSlippageMinAmount; exports.getTokenBalance = getTokenBalance; exports.getTokenDecimals = getTokenDecimals; exports.getTokenProgramId = getTokenProgramId; exports.getTokensMintFromPoolAddress = getTokensMintFromPoolAddress; exports.getTotalFee = getTotalFee; exports.getVariableFee = getVariableFee; exports.isBinIdWithinBinArray = isBinIdWithinBinArray; exports.isOverflowDefaultBinArrayBitmap = isOverflowDefaultBinArrayBitmap; exports.parseLogs = parseLogs; exports.range = range; exports.resetUninvolvedLiquidityParams = resetUninvolvedLiquidityParams; exports.suggestBalancedXParametersFromY = suggestBalancedXParametersFromY; exports.suggestBalancedYParametersFromX = suggestBalancedYParametersFromX; exports.swapExactInQuoteAtBin = swapExactInQuoteAtBin; exports.swapExactOutQuoteAtBin = swapExactOutQuoteAtBin; exports.toAmountAskSide = toAmountAskSide; exports.toAmountBidSide = toAmountBidSide; exports.toAmountBothSide = toAmountBothSide; exports.toAmountIntoBins = toAmountIntoBins; exports.toAmountsBothSideByStrategy = toAmountsBothSideByStrategy; exports.toStrategyParameters = toStrategyParameters; exports.toWeightDistribution = toWeightDistribution; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.updateBinArray = updateBinArray; exports.wrapSOLInstruction = wrapSOLInstruction;
20021
+
20022
+
20023
+
20024
+
20025
+
20026
+
20027
+
20028
+
20029
+
20030
+
20031
+
20032
+
20033
+
20034
+
20035
+
20036
+
20037
+ exports.ADMIN = ADMIN; exports.ActionType = ActionType; exports.ActivationType = ActivationType; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_ARRAY_BITMAP_FEE = BIN_ARRAY_BITMAP_FEE; exports.BIN_ARRAY_BITMAP_FEE_BN = BIN_ARRAY_BITMAP_FEE_BN; exports.BIN_ARRAY_BITMAP_SIZE = BIN_ARRAY_BITMAP_SIZE; exports.BIN_ARRAY_FEE = BIN_ARRAY_FEE; exports.BIN_ARRAY_FEE_BN = BIN_ARRAY_FEE_BN; exports.BinLiquidity = BinLiquidity; exports.BitmapType = BitmapType; exports.ClockLayout = ClockLayout; exports.DEFAULT_BIN_PER_POSITION = DEFAULT_BIN_PER_POSITION; exports.DLMMError = DLMMError; exports.DlmmSdkError = DlmmSdkError; exports.EXTENSION_BINARRAY_BITMAP_SIZE = EXTENSION_BINARRAY_BITMAP_SIZE; exports.FEE_PRECISION = FEE_PRECISION; exports.IDL = dlmm_default; exports.ILM_BASE = ILM_BASE; exports.LBCLMM_PROGRAM_IDS = LBCLMM_PROGRAM_IDS; exports.MAX_ACTIVE_BIN_SLIPPAGE = MAX_ACTIVE_BIN_SLIPPAGE; exports.MAX_BINS_PER_POSITION = MAX_BINS_PER_POSITION; exports.MAX_BIN_ARRAY_SIZE = MAX_BIN_ARRAY_SIZE; exports.MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX; exports.MAX_CLAIM_ALL_ALLOWED = MAX_CLAIM_ALL_ALLOWED; exports.MAX_EXTRA_BIN_ARRAYS = MAX_EXTRA_BIN_ARRAYS; exports.MAX_FEE_RATE = MAX_FEE_RATE; exports.MAX_RESIZE_LENGTH = MAX_RESIZE_LENGTH; exports.MEMO_PROGRAM_ID = MEMO_PROGRAM_ID; exports.Network = Network; exports.POOL_FEE = POOL_FEE; exports.POOL_FEE_BN = POOL_FEE_BN; exports.POSITION_BIN_DATA_SIZE = POSITION_BIN_DATA_SIZE; exports.POSITION_FEE = POSITION_FEE; exports.POSITION_FEE_BN = POSITION_FEE_BN; exports.POSITION_MAX_LENGTH = POSITION_MAX_LENGTH; exports.POSITION_MIN_SIZE = POSITION_MIN_SIZE; exports.PRECISION = PRECISION; exports.PairStatus = PairStatus; exports.PairType = PairType; exports.PositionV2Wrapper = PositionV2Wrapper; exports.PositionVersion = PositionVersion; exports.RebalancePosition = RebalancePosition; exports.ResizeSide = ResizeSide; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.Strategy = Strategy; exports.StrategyType = StrategyType; exports.TOKEN_ACCOUNT_FEE = TOKEN_ACCOUNT_FEE; exports.TOKEN_ACCOUNT_FEE_BN = TOKEN_ACCOUNT_FEE_BN; exports.U64_MAX = U64_MAX; exports.autoFillXByStrategy = autoFillXByStrategy; exports.autoFillXByWeight = autoFillXByWeight; exports.autoFillYByStrategy = autoFillYByStrategy; exports.autoFillYByWeight = autoFillYByWeight; exports.binIdToBinArrayIndex = binIdToBinArrayIndex; exports.buildBitFlagAndNegateStrategyParameters = buildBitFlagAndNegateStrategyParameters; exports.buildLiquidityStrategyParameters = buildLiquidityStrategyParameters; exports.calculateBidAskDistribution = calculateBidAskDistribution; exports.calculateNormalDistribution = calculateNormalDistribution; exports.calculatePositionSize = calculatePositionSize; exports.calculateSpotDistribution = calculateSpotDistribution; exports.capSlippagePercentage = capSlippagePercentage; exports.chunkBinRange = chunkBinRange; exports.chunkBinRangeIntoExtendedPositions = chunkBinRangeIntoExtendedPositions; exports.chunkDepositWithRebalanceEndpoint = chunkDepositWithRebalanceEndpoint; exports.chunkPositionBinRange = chunkPositionBinRange; exports.chunkedFetchMultipleBinArrayBitmapExtensionAccount = chunkedFetchMultipleBinArrayBitmapExtensionAccount; exports.chunkedFetchMultiplePoolAccount = chunkedFetchMultiplePoolAccount; exports.chunkedGetMultipleAccountInfos = chunkedGetMultipleAccountInfos; exports.chunks = chunks; exports.computeFee = computeFee; exports.computeFeeFromAmount = computeFeeFromAmount; exports.computeProtocolFee = computeProtocolFee; exports.createProgram = createProgram; exports.decodeAccount = decodeAccount; exports.decodeExtendedPosition = decodeExtendedPosition; exports.default = src_default; exports.deriveBinArray = deriveBinArray; exports.deriveBinArrayBitmapExtension = deriveBinArrayBitmapExtension; exports.deriveCustomizablePermissionlessLbPair = deriveCustomizablePermissionlessLbPair; exports.deriveEventAuthority = deriveEventAuthority; exports.deriveLbPair = deriveLbPair; exports.deriveLbPair2 = deriveLbPair2; exports.deriveLbPairWithPresetParamWithIndexKey = deriveLbPairWithPresetParamWithIndexKey; exports.deriveOracle = deriveOracle; exports.derivePermissionLbPair = derivePermissionLbPair; exports.derivePlaceHolderAccountMeta = derivePlaceHolderAccountMeta; exports.derivePosition = derivePosition; exports.derivePresetParameter = derivePresetParameter; exports.derivePresetParameter2 = derivePresetParameter2; exports.derivePresetParameterWithIndex = derivePresetParameterWithIndex; exports.deriveReserve = deriveReserve; exports.deriveRewardVault = deriveRewardVault; exports.deriveTokenBadge = deriveTokenBadge; exports.enumerateBins = enumerateBins; exports.findNextBinArrayIndexWithLiquidity = findNextBinArrayIndexWithLiquidity; exports.findNextBinArrayWithLiquidity = findNextBinArrayWithLiquidity; exports.fromWeightDistributionToAmount = fromWeightDistributionToAmount; exports.fromWeightDistributionToAmountOneSide = fromWeightDistributionToAmountOneSide; exports.getAccountDiscriminator = getAccountDiscriminator; exports.getAmountInBinsAskSide = getAmountInBinsAskSide; exports.getAmountInBinsBidSide = getAmountInBinsBidSide; exports.getAndCapMaxActiveBinSlippage = getAndCapMaxActiveBinSlippage; exports.getAutoFillAmountByRebalancedPosition = getAutoFillAmountByRebalancedPosition; exports.getBaseFee = getBaseFee; exports.getBinArrayAccountMetasCoverage = getBinArrayAccountMetasCoverage; exports.getBinArrayIndexesCoverage = getBinArrayIndexesCoverage; exports.getBinArrayKeysCoverage = getBinArrayKeysCoverage2; exports.getBinArrayLowerUpperBinId = getBinArrayLowerUpperBinId; exports.getBinArraysRequiredByPositionRange = getBinArraysRequiredByPositionRange; exports.getBinCount = getBinCount; exports.getBinFromBinArray = getBinFromBinArray; exports.getBinIdIndexInBinArray = getBinIdIndexInBinArray; exports.getEstimatedComputeUnitIxWithBuffer = getEstimatedComputeUnitIxWithBuffer; exports.getEstimatedComputeUnitUsageWithBuffer = getEstimatedComputeUnitUsageWithBuffer; exports.getExtendedPositionBinCount = getExtendedPositionBinCount; exports.getLiquidityStrategyParameterBuilder = getLiquidityStrategyParameterBuilder; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getOutAmount = getOutAmount; exports.getPositionCountByBinCount = getPositionCountByBinCount; exports.getPositionExpandRentExemption = getPositionExpandRentExemption; exports.getPositionLowerUpperBinIdWithLiquidity = getPositionLowerUpperBinIdWithLiquidity; exports.getPositionRentExemption = getPositionRentExemption; exports.getPriceOfBinByBinId = getPriceOfBinByBinId; exports.getRebalanceBinArrayIndexesAndBitmapCoverage = getRebalanceBinArrayIndexesAndBitmapCoverage; exports.getSlippageMaxAmount = getSlippageMaxAmount; exports.getSlippageMinAmount = getSlippageMinAmount; exports.getTokenBalance = getTokenBalance; exports.getTokenDecimals = getTokenDecimals; exports.getTokenProgramId = getTokenProgramId; exports.getTokensMintFromPoolAddress = getTokensMintFromPoolAddress; exports.getTotalFee = getTotalFee; exports.getVariableFee = getVariableFee; exports.isBinIdWithinBinArray = isBinIdWithinBinArray; exports.isOverflowDefaultBinArrayBitmap = isOverflowDefaultBinArrayBitmap; exports.isPositionNoFee = isPositionNoFee; exports.isPositionNoReward = isPositionNoReward; exports.parseLogs = parseLogs; exports.range = range; exports.resetUninvolvedLiquidityParams = resetUninvolvedLiquidityParams; exports.suggestBalancedXParametersFromY = suggestBalancedXParametersFromY; exports.suggestBalancedYParametersFromX = suggestBalancedYParametersFromX; exports.swapExactInQuoteAtBin = swapExactInQuoteAtBin; exports.swapExactOutQuoteAtBin = swapExactOutQuoteAtBin; exports.toAmountAskSide = toAmountAskSide; exports.toAmountBidSide = toAmountBidSide; exports.toAmountBothSide = toAmountBothSide; exports.toAmountIntoBins = toAmountIntoBins; exports.toAmountsBothSideByStrategy = toAmountsBothSideByStrategy; exports.toStrategyParameters = toStrategyParameters; exports.toWeightDistribution = toWeightDistribution; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.updateBinArray = updateBinArray; exports.wrapPosition = wrapPosition; exports.wrapSOLInstruction = wrapSOLInstruction;
19916
20038
  //# sourceMappingURL=index.js.map