Skip to content

Commit

Permalink
fix min liquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
vuonghuuhung committed Sep 17, 2024
1 parent 9f8e476 commit d435cb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/oraiswap-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/oraiswap-v3",
"version": "0.1.7-beta.1",
"version": "0.1.7-beta.2",
"main": "build/index.js",
"files": [
"build/"
Expand Down
8 changes: 4 additions & 4 deletions packages/oraiswap-v3/src/zap-consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ export class ZapConsumer {
});
});

const res1 = getLiquidityByX(BigInt(amountInToX), lowerTick, upperTick, sqrtPrice, true);
const res2 = getLiquidityByY(BigInt(amountInToY), lowerTick, upperTick, sqrtPrice, true);
const res1 = getLiquidityByX(BigInt(actualAmountXReceived.returnAmount), lowerTick, upperTick, sqrtPrice, true);
const res2 = getLiquidityByY(BigInt(actualAmountYReceived.returnAmount), lowerTick, upperTick, sqrtPrice, true);
message.minimumLiquidity =
res1.l > res2.l
? (BigInt(res2.l) * BigInt(100 - slippage)) / 100n
Expand Down Expand Up @@ -698,8 +698,8 @@ export class ZapConsumer {
});
});

const res1 = getLiquidityByX(BigInt(amountInToX), lowerTick, upperTick, BigInt(pool.pool.sqrt_price), true);
const res2 = getLiquidityByY(BigInt(amountInToY), lowerTick, upperTick, BigInt(pool.pool.sqrt_price), true);
const res1 = getLiquidityByX(BigInt(xRouteInfo.returnAmount), lowerTick, upperTick, BigInt(pool.pool.sqrt_price), true);
const res2 = getLiquidityByY(BigInt(yRouteInfo.returnAmount), lowerTick, upperTick, BigInt(pool.pool.sqrt_price), true);
messages.minimumLiquidity =
res1.l > res2.l
? (BigInt(res2.l) * BigInt(100 - slippage)) / 100n
Expand Down

0 comments on commit d435cb0

Please sign in to comment.