@meteora-ag/dlmm 1.5.2 → 1.5.3-rc.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.mjs CHANGED
@@ -14846,8 +14846,8 @@ var DLMM = class {
14846
14846
  const binSupply = bin.supply;
14847
14847
  const posShare = posShares[idx];
14848
14848
  const posBinRewardInfo = positionRewardInfos[idx];
14849
- const positionXAmount = binSupply.eq(ZERO) ? ZERO : posShare.mul(bin.xAmount).div(binSupply);
14850
- const positionYAmount = binSupply.eq(ZERO) ? ZERO : posShare.mul(bin.yAmount).div(binSupply);
14849
+ const positionXAmount = binSupply.eq(ZERO) ? new Decimal6(0) : new Decimal6(posShare.toString()).mul(new Decimal6(bin.xAmount.toString())).div(new Decimal6(binSupply.toString()));
14850
+ const positionYAmount = binSupply.eq(ZERO) ? new Decimal6(0) : new Decimal6(posShare.toString()).mul(new Decimal6(bin.yAmount.toString())).div(new Decimal6(binSupply.toString())).floor();
14851
14851
  totalXAmount = totalXAmount.add(new Decimal6(positionXAmount.toString()));
14852
14852
  totalYAmount = totalYAmount.add(new Decimal6(positionYAmount.toString()));
14853
14853
  const feeInfo = feeInfos[idx];
@@ -14910,8 +14910,8 @@ var DLMM = class {
14910
14910
  binYAmount: bin.yAmount.toString(),
14911
14911
  binLiquidity: binSupply.toString(),
14912
14912
  positionLiquidity: posShare.toString(),
14913
- positionXAmount: positionXAmount.toString(),
14914
- positionYAmount: positionYAmount.toString(),
14913
+ positionXAmount: positionXAmount.toFixed(),
14914
+ positionYAmount: positionYAmount.toFixed(),
14915
14915
  positionFeeXAmount: claimableFeeX.toString(),
14916
14916
  positionFeeYAmount: claimableFeeY.toString(),
14917
14917
  positionRewardAmount: claimableRewardsInBin.map(