From 9835d67e547ad0a8a55702a3a98e9595fc829e68 Mon Sep 17 00:00:00 2001 From: surbhi Date: Mon, 8 Dec 2025 18:17:49 -0400 Subject: [PATCH] removing limitPrice calucating from the swap execution --- src/hooks/usePartyPool.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hooks/usePartyPool.ts b/src/hooks/usePartyPool.ts index 7b2dd59..0509ef7 100644 --- a/src/hooks/usePartyPool.ts +++ b/src/hooks/usePartyPool.ts @@ -360,9 +360,7 @@ export function useSwap() { await publicClient.waitForTransactionReceipt({ hash: approvalHash }); console.log('✅ Approval confirmed'); - // STEP 2: Calculate limit price and deadline - const slippageBasisPoints = BigInt(Math.floor(slippagePercent * 100)); - const limitPrice = (Q96 * (10000n + slippageBasisPoints)) / 10000n; + // STEP 2: Calculate deadline const deadline = BigInt(Math.floor(Date.now() / 1000) + 1200); console.log('🚀 Executing swap with params:', { @@ -372,12 +370,12 @@ export function useSwap() { inputTokenIndex, outputTokenIndex, maxAmountIn: maxAmountIn.toString(), - limitPrice: limitPrice.toString(), + limitPrice: '0 (no limit)', deadline: deadline.toString(), unwrap: false, }); - // STEP 3: Execute the swap transaction + // STEP 3: Execute the swap transaction with no limit price const hash = await walletClient.writeContract({ address: poolAddress, abi: IPartyPoolABI, @@ -389,7 +387,7 @@ export function useSwap() { BigInt(inputTokenIndex), BigInt(outputTokenIndex), maxAmountIn, - limitPrice, + 0n, // no limit price deadline, false, // unwrap '0x', // cbData (empty bytes)