@magmaprotocol/magma-clmm-sdk 0.5.4 → 0.5.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.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1235,8 +1235,8 @@ var ClmmPoolUtil = class {
|
|
|
1235
1235
|
liquidity = estimateLiquidityForCoinB(curSqrtPrice, lowerSqrtPrice, coinAmount);
|
|
1236
1236
|
}
|
|
1237
1237
|
const coinAmounts = ClmmPoolUtil.getCoinAmountFromLiquidity(liquidity, curSqrtPrice, lowerSqrtPrice, upperSqrtPrice, roundUp);
|
|
1238
|
-
const tokenLimitA =
|
|
1239
|
-
const tokenLimitB =
|
|
1238
|
+
const tokenLimitA = roundUp ? d(coinAmounts.coinA.toString()).mul(1 + slippage).toString() : d(coinAmounts.coinA.toString()).mul(1 - slippage).toString();
|
|
1239
|
+
const tokenLimitB = roundUp ? d(coinAmounts.coinB.toString()).mul(1 + slippage).toString() : d(coinAmounts.coinB.toString()).mul(1 - slippage).toString();
|
|
1240
1240
|
return {
|
|
1241
1241
|
coinAmountA: coinAmounts.coinA,
|
|
1242
1242
|
coinAmountB: coinAmounts.coinB,
|
|
@@ -2880,7 +2880,7 @@ var _TransactionUtil = class {
|
|
|
2880
2880
|
{ amountSecond: BigInt(reverSlippageAmount(amount, slippage)), amountFirst: BigInt(amount) },
|
|
2881
2881
|
coinType,
|
|
2882
2882
|
buildVector
|
|
2883
|
-
) : _TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(amount), coinType,
|
|
2883
|
+
) : _TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(amount), coinType, false, true);
|
|
2884
2884
|
}
|
|
2885
2885
|
/**
|
|
2886
2886
|
* fix add liquidity fix token for coin amount
|