From 2f8231aae2eadf7e1a724cb18b91fa3674fe2744 Mon Sep 17 00:00:00 2001 From: viet-nv Date: Tue, 14 Nov 2023 20:08:41 +0700 Subject: [PATCH] fix: zap price impact when increasing liq --- src/components/ElasticZap/ZapDetail.tsx | 4 ++-- src/pages/IncreaseLiquidity/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ElasticZap/ZapDetail.tsx b/src/components/ElasticZap/ZapDetail.tsx index af17ee0b78..02fd066f32 100644 --- a/src/components/ElasticZap/ZapDetail.tsx +++ b/src/components/ElasticZap/ZapDetail.tsx @@ -154,8 +154,8 @@ export const useZapDetail = ({ const amountUsdAfterSwap = (currency0 && currency1 - ? +(newPooledAmount0?.toExact() || 0) * (prices[currency0.wrapped.address] || 0) + - +(newPooledAmount1?.toExact() || 0) * (prices[currency1.wrapped.address] || 0) + ? +(newPosDraft?.amount0?.toExact() || 0) * (prices[currency0.wrapped.address] || 0) + + +(newPosDraft?.amount1?.toExact() || 0) * (prices[currency1.wrapped.address] || 0) : 0) + remainAmountUsd const priceImpact = diff --git a/src/pages/IncreaseLiquidity/index.tsx b/src/pages/IncreaseLiquidity/index.tsx index c5da486433..e2fcff68ac 100644 --- a/src/pages/IncreaseLiquidity/index.tsx +++ b/src/pages/IncreaseLiquidity/index.tsx @@ -1100,7 +1100,7 @@ export default function IncreaseLiquidity() { size="14px" /> - {zapDetail.newPooledAmount0?.toSignificant(10)} {zapSymbol0} + {zapDetail.newPosDraft?.amount0?.toSignificant(10)} {zapSymbol0} )} @@ -1119,7 +1119,7 @@ export default function IncreaseLiquidity() { size="14px" /> - {zapDetail.newPooledAmount1?.toSignificant(10)} {zapSymbol1} + {zapDetail.newPosDraft?.amount1?.toSignificant(10)} {zapSymbol1} )}