@meteora-ag/dlmm 1.6.0-rc.19 → 1.6.0-rc.20

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
@@ -13044,8 +13044,9 @@ function getAutoFillAmountByRebalancedPosition(rebalancePosition, strategyType)
13044
13044
  new BN15(maxDeltaId),
13045
13045
  liquidityInAskSide
13046
13046
  );
13047
+ const [_, positionAmountY] = rebalancePosition.totalAmounts();
13047
13048
  return {
13048
- amount: amountY,
13049
+ amount: BN15.max(amountY.sub(positionAmountY), new BN15(0)),
13049
13050
  isBidSide: true
13050
13051
  };
13051
13052
  } else if (liquidityInAskSide.lt(liquidityInBidSide)) {
@@ -13066,8 +13067,9 @@ function getAutoFillAmountByRebalancedPosition(rebalancePosition, strategyType)
13066
13067
  new BN15(maxDeltaId),
13067
13068
  liquidityInBidSide
13068
13069
  );
13070
+ const [positionAmountX] = rebalancePosition.totalAmounts();
13069
13071
  return {
13070
- amount: amountX,
13072
+ amount: BN15.max(amountX.sub(positionAmountX), new BN15(0)),
13071
13073
  isBidSide: false
13072
13074
  };
13073
13075
  } else {