Skip to content

Commit

Permalink
fix: crash zap (#2245)
Browse files Browse the repository at this point in the history
  • Loading branch information
namgold authored Sep 18, 2023
1 parent 0f929f4 commit b5df129
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/pages/RemoveLiquidity/ZapOut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,14 @@ export default function ZapOut({
parsedAmounts[independentTokenField] && independentTokenPrice
? parseFloat((parsedAmounts[independentTokenField] as TokenAmount).toSignificant(6)) * independentTokenPrice
: 0

const noZapDependentAmount = noZapAmounts[dependentTokenField]
const priceImpact =
priceToSwap &&
noZapAmounts[dependentTokenField] &&
noZapDependentAmount &&
amountOut &&
computePriceImpact(
priceToSwap,
noZapAmounts[dependentTokenField] as CurrencyAmount<Currency>,
amountOut as CurrencyAmount<Currency>,
)
!priceToSwap.equalTo(0) &&
!noZapDependentAmount.equalTo(0) &&
computePriceImpact(priceToSwap, noZapDependentAmount, amountOut as CurrencyAmount<Currency>)

const priceImpactWithoutFee = pair && priceImpact ? computePriceImpactWithoutFee([pair], priceImpact) : undefined

Expand Down

0 comments on commit b5df129

Please sign in to comment.