@meteora-ag/dlmm 1.5.0-rc.4 → 1.5.0-rc.6

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.mjs CHANGED
@@ -10520,13 +10520,15 @@ var SIMULATION_USER = new PublicKey(
10520
10520
  var PRECISION = 18446744073709552e3;
10521
10521
  var MAX_CLAIM_ALL_ALLOWED = 2;
10522
10522
  var MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = 26;
10523
- var MAX_BIN_PER_TX = 69;
10524
10523
  var MAX_ACTIVE_BIN_SLIPPAGE = 3;
10525
10524
  var ILM_BASE = new PublicKey(
10526
10525
  "MFGQxwAmB91SwuYX36okv2Qmdc9aMuHTwWGUrp4AtB1"
10527
10526
  );
10528
10527
  var MAX_EXTRA_BIN_ARRAYS = 3;
10529
10528
  var U64_MAX = new BN("18446744073709551615");
10529
+ var MAX_BINS_PER_POSITION = dlmm_zc_default.constants.find(
10530
+ ({ name }) => name == "POSITION_MAX_LENGTH"
10531
+ )?.value;
10530
10532
 
10531
10533
  // src/dlmm/error.ts
10532
10534
  import { AnchorError } from "@coral-xyz/anchor";
@@ -15038,7 +15040,9 @@ var DLMM = class {
15038
15040
  lowerBinArrayIndex.add(new BN14(1))
15039
15041
  );
15040
15042
  const binArraysCount = (await this.binArraysToBeCreate(lowerBinArrayIndex, upperBinArrayIndex)).length;
15041
- const positionCount = Math.ceil((maxBinId - minBinId + 1) / MAX_BIN_PER_TX);
15043
+ const positionCount = Math.ceil(
15044
+ (maxBinId - minBinId + 1) / Number(MAX_BINS_PER_POSITION)
15045
+ );
15042
15046
  const binArrayCost = binArraysCount * BIN_ARRAY_FEE;
15043
15047
  const positionCost = positionCount * POSITION_FEE;
15044
15048
  return {
@@ -15186,8 +15190,8 @@ var DLMM = class {
15186
15190
  );
15187
15191
  initPositionIxs.push(initPositionIx);
15188
15192
  const binArrayIndexes = getBinArrayIndexesCoverage(
15189
- new BN14(minBinId),
15190
- new BN14(maxBinId)
15193
+ new BN14(lowerBinId),
15194
+ new BN14(upperBinId)
15191
15195
  ).filter((idx) => !binArrayIndexSet.has(idx.toNumber()));
15192
15196
  const createBinArrayIxs = await this.createBinArraysIfNeeded(
15193
15197
  binArrayIndexes,
@@ -16482,7 +16486,7 @@ var DLMM = class {
16482
16486
  preInstructions.push(createUserTokenXIx);
16483
16487
  preInstructions.push(createUserTokenYIx);
16484
16488
  const binArrayBitmapExtension = this.binArrayBitmapExtension ? this.binArrayBitmapExtension.publicKey : this.program.programId;
16485
- const removeLiquidityTx = await this.program.methods.removeLiquidityByRange2(fromBinId, toBinId, bps.toNumber(), {
16489
+ const removeLiquidityTx = await this.program.methods.removeLiquidityByRange2(lowerBinId, upperBinId, bps.toNumber(), {
16486
16490
  slices
16487
16491
  }).accountsPartial({
16488
16492
  position,
@@ -29518,9 +29522,9 @@ export {
29518
29522
  ILM_BASE,
29519
29523
  LBCLMM_PROGRAM_IDS,
29520
29524
  MAX_ACTIVE_BIN_SLIPPAGE,
29525
+ MAX_BINS_PER_POSITION,
29521
29526
  MAX_BIN_ARRAY_SIZE,
29522
29527
  MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX,
29523
- MAX_BIN_PER_TX,
29524
29528
  MAX_CLAIM_ALL_ALLOWED,
29525
29529
  MAX_EXTRA_BIN_ARRAYS,
29526
29530
  MAX_FEE_RATE,