@meteora-ag/dlmm 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _coral_xyz_anchor from '@coral-xyz/anchor';
2
- import { Program, IdlAccounts, ProgramAccount, BN as BN$1, IdlTypes, EventParser } from '@coral-xyz/anchor';
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
4
  import { PublicKey, Connection, AccountMeta, Keypair, TransactionInstruction, Cluster, AccountInfo, Transaction, GetProgramAccountsFilter } from '@solana/web3.js';
5
5
  import Decimal from 'decimal.js';
@@ -11186,9 +11186,9 @@ declare class RebalancePosition {
11186
11186
  shouldClaimFee: boolean;
11187
11187
  shouldClaimReward: boolean;
11188
11188
  rebalancePositionBinData: RebalancePositionBinData[];
11189
- activeBin: Bin;
11189
+ activeBin: Bin | null;
11190
11190
  currentTimestamp: BN;
11191
- constructor(positionAddress: PublicKey, positionData: PositionData, lbPair: LbPair, activeBin: Bin, shouldClaimFee: boolean, shouldClaimReward: boolean, currentTimestamp: BN);
11191
+ constructor(positionAddress: PublicKey, positionData: PositionData, lbPair: LbPair, activeBin: Bin | null, shouldClaimFee: boolean, shouldClaimReward: boolean, currentTimestamp: BN);
11192
11192
  static create(params: CreateRebalancePositionParams): Promise<RebalancePosition>;
11193
11193
  _simulateDeposit(binStep: BN, tokenXDecimal: BN, tokenYDecimal: BN, deposits: RebalanceWithDeposit[], simulatedWithdrawResult: SimulateWithdrawResult): {
11194
11194
  result: SimulateDepositResult;
@@ -11721,6 +11721,10 @@ declare function updateBinArray(activeId: BN$1, clock: Clock, allRewardInfos: Re
11721
11721
  amountYIn: BN$1;
11722
11722
  }[];
11723
11723
  };
11724
+ declare function binDeltaToMinMaxBinId(binDelta: number, activeBinId: number): {
11725
+ minBinId: number;
11726
+ maxBinId: number;
11727
+ };
11724
11728
 
11725
11729
  /** private */
11726
11730
  declare function derivePresetParameterWithIndex(index: BN$1, programId: PublicKey): [PublicKey, number];
@@ -24296,4 +24300,4 @@ declare const positionOwnerFilter: (owner: PublicKey) => GetProgramAccountsFilte
24296
24300
  declare const positionLbPairFilter: (lbPair: PublicKey) => GetProgramAccountsFilter;
24297
24301
  declare const positionV2Filter: () => GetProgramAccountsFilter;
24298
24302
 
24299
- export { ADMIN, ALT_ADDRESS, type AccountName, ActionType, ActivationType, type AmountIntoBin, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_FEE, BIN_ARRAY_BITMAP_FEE_BN, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, BIN_ARRAY_FEE_BN, type BidAskParameters, type Bin, type BinAndAmount, type BinArray, type BinArrayAccount, type BinArrayBitmapExtension, type BinArrayBitmapExtensionAccount, BinLiquidity, type BinLiquidityDistribution, type BinLiquidityReduction, BitmapType, type ClmmProgram, type Clock, ClockLayout, type CompressedBinDepositAmount, type CompressedBinDepositAmounts, type CreateRebalancePositionParams, DEFAULT_BIN_PER_POSITION, DLMMError, DlmmSdkError, EXTENSION_BINARRAY_BITMAP_SIZE, type EmissionRate, type ExtendedPositionBinData, FEE_PRECISION, type FeeInfo, type GetOrCreateATAResponse, type IAccountsCache, IDL, ILM_BASE, type IPosition, type InitCustomizablePermissionlessPairIx, type InitPermissionPairIx, type InitializeMultiplePositionAndAddLiquidityByStrategyResponse, type InitializeMultiplePositionAndAddLiquidityByStrategyResponse2, LBCLMM_PROGRAM_IDS, type LMRewards, type LbClmm, type LbPair, type LbPairAccount, type LbPosition, type LiquidityOneSideParameter, type LiquidityParameter, type LiquidityParameterByStrategy, type LiquidityParameterByStrategyOneSide, type LiquidityParameterByWeight, type LiquidityStrategyParameterBuilder, type 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, type Opt, POOL_FEE, POOL_FEE_BN, POSITION_BIN_DATA_SIZE, POSITION_FEE, POSITION_FEE_BN, POSITION_MAX_LENGTH, POSITION_MIN_SIZE, PRECISION, type PairLockInfo, PairStatus, PairType, type Position, type PositionBinData, type PositionData, type PositionInfo, type PositionLockInfo, type PositionV2, PositionV2Wrapper, PositionVersion, type PresetParameter, type PresetParameter2, type ProgramStrategyParameter, type ProgramStrategyType, REBALANCE_POSITION_PADDING, type RebalanceAddLiquidityParam, RebalancePosition, type RebalancePositionBinArrayRentalCostQuote, type RebalancePositionResponse, type RebalanceRemoveLiquidityParam, type RebalanceWithDeposit, type RebalanceWithWithdraw, type RemainingAccountInfo, type RemainingAccountsInfoSlice, ResizeSide, type ResizeSideEnum, type RewardInfo, type RewardInfos, SCALE, SCALE_OFFSET, SIMULATION_USER, type SeedLiquidityCostBreakdown, type SeedLiquidityResponse, type SeedLiquiditySingleBinResponse, ShrinkMode, type SimulateRebalanceResp, Strategy, type StrategyParameters, StrategyType, type SwapExactOutParams, type SwapFee, type SwapParams, type SwapQuote, type SwapQuoteExactOut, type SwapWithPriceImpactParams, type TInitializeMultiplePositionAndAddLiquidityParamsByStrategy, type TInitializePositionAndAddLiquidityParams, type TInitializePositionAndAddLiquidityParamsByStrategy, TOKEN_ACCOUNT_FEE, TOKEN_ACCOUNT_FEE_BN, type TQuoteCreatePositionParams, type TokenReserve, U64_MAX, type UserFeeInfo, type UserRewardInfo, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, binArrayLbPairFilter, 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, positionLbPairFilter, positionOwnerFilter, positionV2Filter, presetParameter2BaseFactorFilter, presetParameter2BaseFeePowerFactor, presetParameter2BinStepFilter, range, resetUninvolvedLiquidityParams, type sParameters, suggestBalancedXParametersFromY, suggestBalancedYParametersFromX, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountIntoBins, toAmountsBothSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, updateBinArray, type vParameters, wrapPosition, wrapSOLInstruction };
24303
+ export { ADMIN, ALT_ADDRESS, 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, InitializeMultiplePositionAndAddLiquidityByStrategyResponse2, 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, REBALANCE_POSITION_PADDING, RebalanceAddLiquidityParam, RebalancePosition, RebalancePositionBinArrayRentalCostQuote, RebalancePositionResponse, RebalanceRemoveLiquidityParam, RebalanceWithDeposit, RebalanceWithWithdraw, RemainingAccountInfo, RemainingAccountsInfoSlice, ResizeSide, ResizeSideEnum, RewardInfo, RewardInfos, SCALE, SCALE_OFFSET, SIMULATION_USER, SeedLiquidityCostBreakdown, SeedLiquidityResponse, SeedLiquiditySingleBinResponse, ShrinkMode, 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, binArrayLbPairFilter, binDeltaToMinMaxBinId, 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, positionLbPairFilter, positionOwnerFilter, positionV2Filter, presetParameter2BaseFactorFilter, presetParameter2BaseFeePowerFactor, presetParameter2BinStepFilter, range, resetUninvolvedLiquidityParams, sParameters, suggestBalancedXParametersFromY, suggestBalancedYParametersFromX, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountIntoBins, toAmountsBothSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, updateBinArray, vParameters, wrapPosition, wrapSOLInstruction };
package/dist/index.js CHANGED
@@ -11328,6 +11328,14 @@ function updateBinArray(activeId, clock, allRewardInfos, binArray) {
11328
11328
  }
11329
11329
  return binArrayClone;
11330
11330
  }
11331
+ function binDeltaToMinMaxBinId(binDelta, activeBinId) {
11332
+ const minBinId = activeBinId - binDelta;
11333
+ const maxBinId = minBinId + binDelta * 2;
11334
+ return {
11335
+ minBinId,
11336
+ maxBinId
11337
+ };
11338
+ }
11331
11339
 
11332
11340
  // src/dlmm/helpers/computeUnit.ts
11333
11341
 
@@ -12029,7 +12037,7 @@ function simulateDepositBin(binId, binStep, amountX, amountY, bin) {
12029
12037
  amountYIntoBin
12030
12038
  };
12031
12039
  }
12032
- var RebalancePosition = class _RebalancePosition {
12040
+ var RebalancePosition = class {
12033
12041
 
12034
12042
 
12035
12043
 
@@ -12073,17 +12081,21 @@ var RebalancePosition = class _RebalancePosition {
12073
12081
  activeBinArrayIdx,
12074
12082
  program.programId
12075
12083
  );
12076
- const activeBinArrayState = await program.account.binArray.fetch(
12077
- activeBinArrayPubkey
12078
- );
12079
12084
  const [lowerBinId, upperBinId] = getBinArrayLowerUpperBinId(activeBinArrayIdx);
12080
12085
  const idx = getBinIdIndexInBinArray(
12081
12086
  new (0, _bnjs2.default)(lbPair.activeId),
12082
12087
  lowerBinId,
12083
12088
  upperBinId
12084
12089
  );
12085
- const activeBin = activeBinArrayState[idx.toNumber()];
12086
- return new _RebalancePosition(
12090
+ let activeBin = null;
12091
+ try {
12092
+ const activeBinArrayState = await program.account.binArray.fetch(
12093
+ activeBinArrayPubkey
12094
+ );
12095
+ activeBin = activeBinArrayState[idx.toNumber()];
12096
+ } catch (error) {
12097
+ }
12098
+ return new RebalancePosition(
12087
12099
  positionAddress,
12088
12100
  positionData,
12089
12101
  lbPair,
@@ -13226,7 +13238,8 @@ async function getTokensMintFromPoolAddress(connection, poolAddress, opt) {
13226
13238
  const poolAccount = await program.account.lbPair.fetchNullable(
13227
13239
  new (0, _web3js.PublicKey)(poolAddress)
13228
13240
  );
13229
- if (!poolAccount) throw new Error("Pool account not found");
13241
+ if (!poolAccount)
13242
+ throw new Error("Pool account not found");
13230
13243
  return {
13231
13244
  tokenXMint: poolAccount.tokenXMint,
13232
13245
  tokenYMint: poolAccount.tokenYMint
@@ -13825,7 +13838,8 @@ async function getTokenBalance(conn, tokenAccount) {
13825
13838
  return acc.amount;
13826
13839
  }
13827
13840
  var parseLogs = (eventParser, logs) => {
13828
- if (!logs.length) throw new Error("No logs found");
13841
+ if (!logs.length)
13842
+ throw new Error("No logs found");
13829
13843
  for (const event of _optionalChain([eventParser, 'optionalAccess', _41 => _41.parseLogs, 'call', _42 => _42(logs)])) {
13830
13844
  return event.data;
13831
13845
  }
@@ -14388,7 +14402,7 @@ var BalancedStrategyBuilder = class {
14388
14402
  };
14389
14403
 
14390
14404
  // src/dlmm/index.ts
14391
- var DLMM = class _DLMM {
14405
+ var DLMM = class {
14392
14406
  constructor(pubkey, program, lbPair, binArrayBitmapExtension, tokenX, tokenY, rewards, clock, opt) {
14393
14407
  this.pubkey = pubkey;
14394
14408
  this.program = program;
@@ -14486,7 +14500,8 @@ var DLMM = class _DLMM {
14486
14500
  program.programId
14487
14501
  );
14488
14502
  const account = await program.account.lbPair.fetchNullable(lpPair);
14489
- if (account) return lpPair;
14503
+ if (account)
14504
+ return lpPair;
14490
14505
  return null;
14491
14506
  } catch (error) {
14492
14507
  return null;
@@ -14534,7 +14549,8 @@ var DLMM = class _DLMM {
14534
14549
  );
14535
14550
  }
14536
14551
  const clockAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _53 => _53[2], 'optionalAccess', _54 => _54.data]);
14537
- if (!clockAccountInfoBuffer) throw new Error(`Clock account not found`);
14552
+ if (!clockAccountInfoBuffer)
14553
+ throw new Error(`Clock account not found`);
14538
14554
  const clock = ClockLayout.decode(clockAccountInfoBuffer);
14539
14555
  accountsToFetch = [
14540
14556
  lbPairAccInfo.reserveX,
@@ -14649,7 +14665,7 @@ var DLMM = class _DLMM {
14649
14665
  owner: reward1MintAccount.owner,
14650
14666
  transferHookAccountMetas: reward1TransferHook
14651
14667
  } : null;
14652
- return new _DLMM(
14668
+ return new DLMM(
14653
14669
  dlmm,
14654
14670
  program,
14655
14671
  lbPairAccInfo,
@@ -14686,7 +14702,8 @@ var DLMM = class _DLMM {
14686
14702
  );
14687
14703
  const clockAccount = accountsInfo.pop();
14688
14704
  const clockAccountInfoBuffer = _optionalChain([clockAccount, 'optionalAccess', _55 => _55.data]);
14689
- if (!clockAccountInfoBuffer) throw new Error(`Clock account not found`);
14705
+ if (!clockAccountInfoBuffer)
14706
+ throw new Error(`Clock account not found`);
14690
14707
  const clock = ClockLayout.decode(clockAccountInfoBuffer);
14691
14708
  const lbPairArraysMap = /* @__PURE__ */ new Map();
14692
14709
  for (let i = 0; i < dlmmList.length; i++) {
@@ -14850,7 +14867,7 @@ var DLMM = class _DLMM {
14850
14867
  lbPairState.rewardInfos[1].mint.toBase58()
14851
14868
  ), () => ( []))
14852
14869
  } : null;
14853
- return new _DLMM(
14870
+ return new DLMM(
14854
14871
  lbPair,
14855
14872
  program,
14856
14873
  lbPairState,
@@ -15056,7 +15073,7 @@ var DLMM = class _DLMM {
15056
15073
  transferHookAccountMetas: []
15057
15074
  // No need, the TokenReserve created just for processing position info, doesn't require any transaction
15058
15075
  };
15059
- const positionData = await _DLMM.processPosition(
15076
+ const positionData = await DLMM.processPosition(
15060
15077
  program,
15061
15078
  lbPairAcc,
15062
15079
  clock,
@@ -15159,7 +15176,7 @@ var DLMM = class _DLMM {
15159
15176
  }
15160
15177
  const positionsLockInfo = await Promise.all(
15161
15178
  positionsWithLock.map(async (position) => {
15162
- const positionData = await _DLMM.processPosition(
15179
+ const positionData = await DLMM.processPosition(
15163
15180
  this.program,
15164
15181
  this.lbPair,
15165
15182
  clock,
@@ -15659,7 +15676,8 @@ var DLMM = class _DLMM {
15659
15676
  this.lbPair,
15660
15677
  _nullishCoalesce(_optionalChain([this, 'access', _71 => _71.binArrayBitmapExtension, 'optionalAccess', _72 => _72.account]), () => ( null))
15661
15678
  );
15662
- if (binArrayIndex === null) shouldStop = true;
15679
+ if (binArrayIndex === null)
15680
+ shouldStop = true;
15663
15681
  else {
15664
15682
  const [binArrayPubKey] = deriveBinArray(
15665
15683
  this.pubkey,
@@ -15670,7 +15688,8 @@ var DLMM = class _DLMM {
15670
15688
  const [lowerBinId, upperBinId] = getBinArrayLowerUpperBinId(binArrayIndex);
15671
15689
  activeIdToLoop = swapForY ? lowerBinId.toNumber() - 1 : upperBinId.toNumber() + 1;
15672
15690
  }
15673
- if (binArraysPubkey.size === count) shouldStop = true;
15691
+ if (binArraysPubkey.size === count)
15692
+ shouldStop = true;
15674
15693
  }
15675
15694
  const accountsToFetch = Array.from(binArraysPubkey).map(
15676
15695
  (pubkey) => new (0, _web3js.PublicKey)(pubkey)
@@ -15719,7 +15738,7 @@ var DLMM = class _DLMM {
15719
15738
  */
15720
15739
  getFeeInfo() {
15721
15740
  const { baseFactor, protocolShare } = this.lbPair.parameters;
15722
- const { baseFeeRatePercentage, maxFeeRatePercentage } = _DLMM.calculateFeeInfo(
15741
+ const { baseFeeRatePercentage, maxFeeRatePercentage } = DLMM.calculateFeeInfo(
15723
15742
  baseFactor,
15724
15743
  this.lbPair.binStep,
15725
15744
  this.lbPair.parameters.baseFeePowerFactor
@@ -15740,13 +15759,13 @@ var DLMM = class _DLMM {
15740
15759
  let activeId = new (0, _anchor.BN)(this.lbPair.activeId);
15741
15760
  const sParameters3 = this.lbPair.parameters;
15742
15761
  const currentTimestamp = Date.now() / 1e3;
15743
- _DLMM.updateReference(
15762
+ DLMM.updateReference(
15744
15763
  activeId.toNumber(),
15745
15764
  vParameterClone,
15746
15765
  sParameters3,
15747
15766
  currentTimestamp
15748
15767
  );
15749
- _DLMM.updateVolatilityAccumulator(
15768
+ DLMM.updateVolatilityAccumulator(
15750
15769
  vParameterClone,
15751
15770
  sParameters3,
15752
15771
  activeId.toNumber()
@@ -15850,7 +15869,7 @@ var DLMM = class _DLMM {
15850
15869
  * @returns {string} price per Lamport of bin
15851
15870
  */
15852
15871
  toPricePerLamport(price) {
15853
- return _DLMM.getPricePerLamport(
15872
+ return DLMM.getPricePerLamport(
15854
15873
  this.tokenX.mint.decimals,
15855
15874
  this.tokenY.mint.decimals,
15856
15875
  price
@@ -15895,7 +15914,7 @@ var DLMM = class _DLMM {
15895
15914
  * value should be used.
15896
15915
  */
15897
15916
  getBinIdFromPrice(price, min) {
15898
- return _DLMM.getBinIdFromPrice(price, this.lbPair.binStep, min);
15917
+ return DLMM.getBinIdFromPrice(price, this.lbPair.binStep, min);
15899
15918
  }
15900
15919
  /**
15901
15920
  * The function `getPositionsByUserAndLbPair` retrieves positions by user and LB pair, including
@@ -15979,7 +15998,7 @@ var DLMM = class _DLMM {
15979
15998
  positions.map(async (position) => {
15980
15999
  return {
15981
16000
  publicKey: position.address(),
15982
- positionData: await _DLMM.processPosition(
16001
+ positionData: await DLMM.processPosition(
15983
16002
  this.program,
15984
16003
  this.lbPair,
15985
16004
  clock,
@@ -16167,7 +16186,7 @@ var DLMM = class _DLMM {
16167
16186
  }
16168
16187
  return {
16169
16188
  publicKey: positionPubKey,
16170
- positionData: await _DLMM.processPosition(
16189
+ positionData: await DLMM.processPosition(
16171
16190
  this.program,
16172
16191
  this.lbPair,
16173
16192
  clock,
@@ -16237,7 +16256,8 @@ var DLMM = class _DLMM {
16237
16256
  const extendPositionIxs = [];
16238
16257
  let currentEndBinId = startBinId + initialPositionWidth - 1;
16239
16258
  while (true) {
16240
- if (currentEndBinId == endBinId) break;
16259
+ if (currentEndBinId == endBinId)
16260
+ break;
16241
16261
  currentEndBinId = Math.min(
16242
16262
  currentEndBinId + MAX_RESIZE_LENGTH.toNumber(),
16243
16263
  endBinId
@@ -17482,7 +17502,7 @@ var DLMM = class _DLMM {
17482
17502
  let activeId = new (0, _anchor.BN)(this.lbPair.activeId);
17483
17503
  const binStep = this.lbPair.binStep;
17484
17504
  const sParameters3 = this.lbPair.parameters;
17485
- _DLMM.updateReference(
17505
+ DLMM.updateReference(
17486
17506
  activeId.toNumber(),
17487
17507
  vParameterClone,
17488
17508
  sParameters3,
@@ -17508,7 +17528,7 @@ var DLMM = class _DLMM {
17508
17528
  );
17509
17529
  }
17510
17530
  binArraysForSwap.set(binArrayAccountToSwap.publicKey, true);
17511
- _DLMM.updateVolatilityAccumulator(
17531
+ DLMM.updateVolatilityAccumulator(
17512
17532
  vParameterClone,
17513
17533
  sParameters3,
17514
17534
  activeId.toNumber()
@@ -17643,7 +17663,7 @@ var DLMM = class _DLMM {
17643
17663
  let activeId = new (0, _anchor.BN)(this.lbPair.activeId);
17644
17664
  const binStep = this.lbPair.binStep;
17645
17665
  const sParameters3 = this.lbPair.parameters;
17646
- _DLMM.updateReference(
17666
+ DLMM.updateReference(
17647
17667
  activeId.toNumber(),
17648
17668
  vParameterClone,
17649
17669
  sParameters3,
@@ -17674,7 +17694,7 @@ var DLMM = class _DLMM {
17674
17694
  }
17675
17695
  }
17676
17696
  binArraysForSwap.set(binArrayAccountToSwap.publicKey, true);
17677
- _DLMM.updateVolatilityAccumulator(
17697
+ DLMM.updateVolatilityAccumulator(
17678
17698
  vParameterClone,
17679
17699
  sParameters3,
17680
17700
  activeId.toNumber()
@@ -18095,7 +18115,8 @@ var DLMM = class _DLMM {
18095
18115
  owner,
18096
18116
  position
18097
18117
  });
18098
- if (!claimTransactions.length) return;
18118
+ if (!claimTransactions.length)
18119
+ return;
18099
18120
  const claimTransactionWithCUIx = await Promise.all(
18100
18121
  claimTransactions.map(async (tx) => {
18101
18122
  const setCUIx = await getEstimatedComputeUnitIxWithBuffer(
@@ -18141,7 +18162,8 @@ var DLMM = class _DLMM {
18141
18162
  })
18142
18163
  )).flat();
18143
18164
  const chunkedClaimAllTx = chunks(claimAllTxs, MAX_CLAIM_ALL_ALLOWED);
18144
- if (chunkedClaimAllTx.length === 0) return [];
18165
+ if (chunkedClaimAllTx.length === 0)
18166
+ return [];
18145
18167
  const chunkedClaimAllTxIx = await Promise.all(
18146
18168
  chunkedClaimAllTx.map(async (txs) => {
18147
18169
  const ixs = txs.map((t) => t.instructions).flat();
@@ -18252,7 +18274,8 @@ var DLMM = class _DLMM {
18252
18274
  })
18253
18275
  )).flat();
18254
18276
  const chunkedClaimAllTx = chunks(claimAllTxs, MAX_CLAIM_ALL_ALLOWED);
18255
- if (chunkedClaimAllTx.length === 0) return [];
18277
+ if (chunkedClaimAllTx.length === 0)
18278
+ return [];
18256
18279
  const chunkedClaimAllTxIxs = await Promise.all(
18257
18280
  chunkedClaimAllTx.map(async (tx) => {
18258
18281
  const ixs = tx.map((t) => t.instructions).flat();
@@ -18348,10 +18371,10 @@ var DLMM = class _DLMM {
18348
18371
  const minPricePerLamport = new (0, _decimaljs2.default)(minPrice).mul(toLamportMultiplier);
18349
18372
  const maxPricePerLamport = new (0, _decimaljs2.default)(maxPrice).mul(toLamportMultiplier);
18350
18373
  const minBinId = new (0, _anchor.BN)(
18351
- _DLMM.getBinIdFromPrice(minPricePerLamport, this.lbPair.binStep, false)
18374
+ DLMM.getBinIdFromPrice(minPricePerLamport, this.lbPair.binStep, false)
18352
18375
  );
18353
18376
  const maxBinId = new (0, _anchor.BN)(
18354
- _DLMM.getBinIdFromPrice(maxPricePerLamport, this.lbPair.binStep, true)
18377
+ DLMM.getBinIdFromPrice(maxPricePerLamport, this.lbPair.binStep, true)
18355
18378
  );
18356
18379
  if (minBinId.toNumber() < this.lbPair.activeId) {
18357
18380
  throw new Error("minPrice < current pair price");
@@ -18691,12 +18714,12 @@ var DLMM = class _DLMM {
18691
18714
  let totalBinArraysCount = new (0, _anchor.BN)(0);
18692
18715
  let totalBinArraysLamports = new (0, _anchor.BN)(0);
18693
18716
  let binArrayBitmapLamports = new (0, _anchor.BN)(0);
18694
- const pricePerLamport = _DLMM.getPricePerLamport(
18717
+ const pricePerLamport = DLMM.getPricePerLamport(
18695
18718
  this.tokenX.mint.decimals,
18696
18719
  this.tokenY.mint.decimals,
18697
18720
  price
18698
18721
  );
18699
- const binIdNumber = _DLMM.getBinIdFromPrice(
18722
+ const binIdNumber = DLMM.getBinIdFromPrice(
18700
18723
  pricePerLamport,
18701
18724
  this.lbPair.binStep,
18702
18725
  !roundingUp
@@ -19075,7 +19098,7 @@ var DLMM = class _DLMM {
19075
19098
  canSyncWithMarketPrice(marketPrice, activeBinId) {
19076
19099
  const marketPriceBinId = this.getBinIdFromPrice(
19077
19100
  Number(
19078
- _DLMM.getPricePerLamport(
19101
+ DLMM.getPricePerLamport(
19079
19102
  this.tokenX.mint.decimals,
19080
19103
  this.tokenY.mint.decimals,
19081
19104
  marketPrice
@@ -19093,7 +19116,8 @@ var DLMM = class _DLMM {
19093
19116
  this.lbPair,
19094
19117
  _nullishCoalesce(_optionalChain([this, 'access', _139 => _139.binArrayBitmapExtension, 'optionalAccess', _140 => _140.account]), () => ( null))
19095
19118
  );
19096
- if (toBinArrayIndex === null) return true;
19119
+ if (toBinArrayIndex === null)
19120
+ return true;
19097
19121
  return swapForY ? marketPriceBinArrayIndex.gt(toBinArrayIndex) : marketPriceBinArrayIndex.lt(toBinArrayIndex);
19098
19122
  }
19099
19123
  /**
@@ -19106,7 +19130,7 @@ var DLMM = class _DLMM {
19106
19130
  async syncWithMarketPrice(marketPrice, owner) {
19107
19131
  const marketPriceBinId = this.getBinIdFromPrice(
19108
19132
  Number(
19109
- _DLMM.getPricePerLamport(
19133
+ DLMM.getPricePerLamport(
19110
19134
  this.tokenX.mint.decimals,
19111
19135
  this.tokenY.mint.decimals,
19112
19136
  marketPrice
@@ -19144,7 +19168,8 @@ var DLMM = class _DLMM {
19144
19168
  );
19145
19169
  accountsToFetch.push(fromBinArrayPubkey);
19146
19170
  const toBinArrayPubkey = (() => {
19147
- if (!toBinArrayIndex) return null;
19171
+ if (!toBinArrayIndex)
19172
+ return null;
19148
19173
  const [toBinArrayPubkey2] = deriveBinArray(
19149
19174
  this.pubkey,
19150
19175
  toBinArrayIndex,
@@ -19828,7 +19853,8 @@ var DLMM = class _DLMM {
19828
19853
  binArrayMap,
19829
19854
  program.programId
19830
19855
  );
19831
- if (!bins.length) return null;
19856
+ if (!bins.length)
19857
+ return null;
19832
19858
  const positionData = [];
19833
19859
  let totalXAmount = new (0, _decimaljs2.default)(0);
19834
19860
  let totalYAmount = new (0, _decimaljs2.default)(0);
@@ -20160,7 +20186,8 @@ var DLMM = class _DLMM {
20160
20186
  const maybeClaimableBinRange = getPositionLowerUpperBinIdWithLiquidity(
20161
20187
  position.positionData
20162
20188
  );
20163
- if (!maybeClaimableBinRange) return [];
20189
+ if (!maybeClaimableBinRange)
20190
+ return [];
20164
20191
  const { lowerBinId, upperBinId } = maybeClaimableBinRange;
20165
20192
  const chunkedBinRange = chunkBinRange(
20166
20193
  lowerBinId.toNumber(),
@@ -20179,7 +20206,8 @@ var DLMM = class _DLMM {
20179
20206
  );
20180
20207
  for (let i = 0; i < 2; i++) {
20181
20208
  const rewardInfo = this.lbPair.rewardInfos[i];
20182
- if (!rewardInfo || rewardInfo.mint.equals(_web3js.PublicKey.default)) continue;
20209
+ if (!rewardInfo || rewardInfo.mint.equals(_web3js.PublicKey.default))
20210
+ continue;
20183
20211
  const preInstructions = [];
20184
20212
  const userRewardToken = _spltoken.getAssociatedTokenAddressSync.call(void 0,
20185
20213
  rewardInfo.mint,
@@ -20220,7 +20248,8 @@ var DLMM = class _DLMM {
20220
20248
  const maybeClaimableBinRange = getPositionLowerUpperBinIdWithLiquidity(
20221
20249
  position.positionData
20222
20250
  );
20223
- if (!maybeClaimableBinRange) return [];
20251
+ if (!maybeClaimableBinRange)
20252
+ return [];
20224
20253
  const { lowerBinId, upperBinId } = maybeClaimableBinRange;
20225
20254
  const chunkedBinRange = chunkBinRange(
20226
20255
  lowerBinId.toNumber(),
@@ -20334,7 +20363,8 @@ var DLMM = class _DLMM {
20334
20363
  };
20335
20364
 
20336
20365
  // src/index.ts
20337
- var index_default = DLMM;
20366
+ var src_default = DLMM;
20367
+
20338
20368
 
20339
20369
 
20340
20370
 
@@ -20503,7 +20533,7 @@ var index_default = DLMM;
20503
20533
 
20504
20534
 
20505
20535
 
20506
- exports.ADMIN = ADMIN; exports.ALT_ADDRESS = ALT_ADDRESS; 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.REBALANCE_POSITION_PADDING = REBALANCE_POSITION_PADDING; exports.RebalancePosition = RebalancePosition; exports.ResizeSide = ResizeSide; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.ShrinkMode = ShrinkMode; 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.binArrayLbPairFilter = binArrayLbPairFilter; 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 = index_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.positionLbPairFilter = positionLbPairFilter; exports.positionOwnerFilter = positionOwnerFilter; exports.positionV2Filter = positionV2Filter; exports.presetParameter2BaseFactorFilter = presetParameter2BaseFactorFilter; exports.presetParameter2BaseFeePowerFactor = presetParameter2BaseFeePowerFactor; exports.presetParameter2BinStepFilter = presetParameter2BinStepFilter; 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;
20536
+ exports.ADMIN = ADMIN; exports.ALT_ADDRESS = ALT_ADDRESS; 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.REBALANCE_POSITION_PADDING = REBALANCE_POSITION_PADDING; exports.RebalancePosition = RebalancePosition; exports.ResizeSide = ResizeSide; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.ShrinkMode = ShrinkMode; 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.binArrayLbPairFilter = binArrayLbPairFilter; exports.binDeltaToMinMaxBinId = binDeltaToMinMaxBinId; 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.positionLbPairFilter = positionLbPairFilter; exports.positionOwnerFilter = positionOwnerFilter; exports.positionV2Filter = positionV2Filter; exports.presetParameter2BaseFactorFilter = presetParameter2BaseFactorFilter; exports.presetParameter2BaseFeePowerFactor = presetParameter2BaseFeePowerFactor; exports.presetParameter2BinStepFilter = presetParameter2BinStepFilter; 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;
20507
20537
  //# sourceMappingURL=index.js.map
20508
20538
 
20509
20539
  // CJS interop: Make default export primary for require() compatibility