@meteora-ag/dlmm 1.0.39-rc.7 → 1.0.39-rc.9

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
@@ -9912,15 +9912,13 @@ var DLMM = class {
9912
9912
  const binArray = binArrays[count];
9913
9913
  if (binArray) {
9914
9914
  const bins = binArray.account.bins;
9915
- if (bins[bins.length - 1].liquiditySupply.gt(new BN9(0))) {
9915
+ if (bins.every(({ liquiditySupply }) => !liquiditySupply.isZero())) {
9916
9916
  count++;
9917
9917
  } else {
9918
9918
  const lastBinWithLiquidityIndex = bins.findIndex(
9919
9919
  ({ liquiditySupply }) => liquiditySupply.isZero()
9920
9920
  );
9921
9921
  console.log(
9922
- bins[lastBinWithLiquidityIndex].amountX.toString(),
9923
- bins[lastBinWithLiquidityIndex].amountY.toString(),
9924
9922
  bins[lastBinWithLiquidityIndex - 1].amountX.toString(),
9925
9923
  bins[lastBinWithLiquidityIndex - 1].amountY.toString()
9926
9924
  );
@@ -9929,7 +9927,7 @@ var DLMM = class {
9929
9927
  }
9930
9928
  }
9931
9929
  }
9932
- return binPriceWithLastLiquidity;
9930
+ return Number(binPriceWithLastLiquidity) / (2 ** 64 - 1);
9933
9931
  }
9934
9932
  /** Private static method */
9935
9933
  static async getBinArrays(program, lbPairPubkey) {