Commit 1f00c2a9 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: fetch the usd price from parsed amount (#4612)

parent 84070835
......@@ -243,11 +243,8 @@ export default function Swap() {
[trade, tradeState]
)
// show price estimates based on wrap trade
const inputValue = showWrap ? parsedAmount : trade?.inputAmount
const outputValue = showWrap ? parsedAmount : trade?.outputAmount
const fiatValueInput = useStablecoinValue(inputValue)
const fiatValueOutput = useStablecoinValue(outputValue)
const fiatValueInput = useStablecoinValue(parsedAmounts[Field.INPUT])
const fiatValueOutput = useStablecoinValue(parsedAmounts[Field.OUTPUT])
const stablecoinPriceImpact = useMemo(
() => (routeIsSyncing ? undefined : computeFiatValuePriceImpact(fiatValueInput, fiatValueOutput)),
[fiatValueInput, fiatValueOutput, routeIsSyncing]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment