From c30f410637e8093200d4ae05ea20f8c6add56762 Mon Sep 17 00:00:00 2001 From: felix Date: Fri, 6 Oct 2023 16:21:53 +0800 Subject: [PATCH] bug: fix sqrt_ratio_limit --- sdk/packages/instaswap-core/src/wrap.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/packages/instaswap-core/src/wrap.ts b/sdk/packages/instaswap-core/src/wrap.ts index f9fd5fe..bb98562 100644 --- a/sdk/packages/instaswap-core/src/wrap.ts +++ b/sdk/packages/instaswap-core/src/wrap.ts @@ -273,8 +273,8 @@ export class Wrap { amount: cairo.uint256(BigInt(erc1155AmountIn) * (BigInt(10 ** 18))) // wrap token has 18 decimals }) } - let isToken1 = (Wrap.ERC20Contract.address > Wrap.WERC20Contract.address) ? true : false; - let sqrt_ratio_limit = (Wrap.ERC20Contract.address > Wrap.WERC20Contract.address) ? MAX_SQRT_RATIO : MIN_SQRT_RATIO; + let isToken1 = !(Wrap.ERC20Contract.address > Wrap.WERC20Contract.address) ? true : false; + let sqrt_ratio_limit = !(Wrap.ERC20Contract.address > Wrap.WERC20Contract.address) ? MAX_SQRT_RATIO : MIN_SQRT_RATIO; let tmp = { pool_key: { token0: sortedTokens[0].address,