@meteora-ag/dlmm 1.2.2 → 1.2.3

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.js CHANGED
@@ -9337,18 +9337,15 @@ var DLMM = class {
9337
9337
  const maxBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId));
9338
9338
  const useExtension = isOverflowDefaultBinArrayBitmap(minBinArrayIndex) || isOverflowDefaultBinArrayBitmap(maxBinArrayIndex);
9339
9339
  const binArrayBitmapExtension = useExtension ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] : null;
9340
- const activeId = this.lbPair.activeId;
9341
9340
  const strategyParameters = toStrategyParameters(strategy);
9342
- const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(minBinId));
9341
+ const positionAccount = await this.program.account.positionV2.fetch(positionPubKey);
9342
+ const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(positionAccount.lowerBinId));
9343
+ const upperBinArrayIndex = lowerBinArrayIndex.add(new (0, _anchor.BN)(1));
9343
9344
  const [binArrayLower] = deriveBinArray(
9344
9345
  this.pubkey,
9345
9346
  lowerBinArrayIndex,
9346
9347
  this.program.programId
9347
9348
  );
9348
- const upperBinArrayIndex = _anchor.BN.max(
9349
- lowerBinArrayIndex.add(new (0, _anchor.BN)(1)),
9350
- binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId))
9351
- );
9352
9349
  const [binArrayUpper] = deriveBinArray(
9353
9350
  this.pubkey,
9354
9351
  upperBinArrayIndex,