From f43db3391b8c2f069b45915600bab9d7fe2d4c2b Mon Sep 17 00:00:00 2001 From: surbhi Date: Mon, 8 Dec 2025 16:20:39 -0400 Subject: [PATCH] removing abs in decimal adjustment calculation for slippage --- src/hooks/usePartyPool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/usePartyPool.ts b/src/hooks/usePartyPool.ts index 0451ff6..5e73275 100644 --- a/src/hooks/usePartyPool.ts +++ b/src/hooks/usePartyPool.ts @@ -197,7 +197,7 @@ export function useSwapAmounts( // Convert Q128 format to decimal (price = priceValue / 2^128) // Then apply decimal conversion: 10^18 / 10^outputTokenDecimals const priceQ128 = Number(priceInt128) / 2 ** 128; - const decimalAdjustment = 10 ** Math.abs(route.outputTokenDecimal - route.inputTokenDecimal); + const decimalAdjustment = 10 ** (route.outputTokenDecimal - route.inputTokenDecimal); const marketPrice = priceQ128 / decimalAdjustment; const swapOutputAmountDecimal = Number(swapOutputAmount) / 10 ** route.outputTokenDecimal; const swapInputAmountDecimal = Number(swapInputAmount) / 10 ** route.inputTokenDecimal;