@sodax/dapp-kit 1.5.5-beta → 1.5.6-beta
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 +12 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/utils/dex-utils.ts +17 -11
package/dist/index.mjs
CHANGED
|
@@ -2297,24 +2297,29 @@ function createSupplyLiquidityParamsProps({
|
|
|
2297
2297
|
const tickSpacing = poolData.tickSpacing;
|
|
2298
2298
|
const tickLower = ClService.priceToTick(minPriceNum, token0, token1, tickSpacing);
|
|
2299
2299
|
const tickUpper = ClService.priceToTick(maxPriceNum, token0, token1, tickSpacing);
|
|
2300
|
-
const slippageMultiplier = BigInt(Math.floor((100 - slippage) * 100));
|
|
2301
|
-
const amount0ForLiquidity = amount0BigInt * slippageMultiplier / 10000n;
|
|
2302
|
-
const amount1ForLiquidity = amount1BigInt * slippageMultiplier / 10000n;
|
|
2303
2300
|
const liquidity = ClService.calculateLiquidityFromAmounts(
|
|
2304
|
-
|
|
2305
|
-
|
|
2301
|
+
amount0BigInt,
|
|
2302
|
+
amount1BigInt,
|
|
2306
2303
|
tickLower,
|
|
2307
2304
|
tickUpper,
|
|
2308
2305
|
BigInt(poolData.currentTick)
|
|
2309
2306
|
);
|
|
2307
|
+
const { amount0Max, amount1Max } = ClService.calculateMaxAmountsForSlippage(
|
|
2308
|
+
liquidity,
|
|
2309
|
+
tickLower,
|
|
2310
|
+
tickUpper,
|
|
2311
|
+
BigInt(poolData.currentTick),
|
|
2312
|
+
poolData.sqrtPriceX96,
|
|
2313
|
+
slippage
|
|
2314
|
+
);
|
|
2310
2315
|
const tokenId = positionId ? BigInt(positionId) : void 0;
|
|
2311
2316
|
return {
|
|
2312
2317
|
poolKey,
|
|
2313
2318
|
tickLower,
|
|
2314
2319
|
tickUpper,
|
|
2315
2320
|
liquidity,
|
|
2316
|
-
amount0Max
|
|
2317
|
-
amount1Max
|
|
2321
|
+
amount0Max,
|
|
2322
|
+
amount1Max,
|
|
2318
2323
|
sqrtPriceX96: poolData.sqrtPriceX96,
|
|
2319
2324
|
positionId,
|
|
2320
2325
|
isValidPosition,
|