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() { ...@@ -243,11 +243,8 @@ export default function Swap() {
[trade, tradeState] [trade, tradeState]
) )
// show price estimates based on wrap trade const fiatValueInput = useStablecoinValue(parsedAmounts[Field.INPUT])
const inputValue = showWrap ? parsedAmount : trade?.inputAmount const fiatValueOutput = useStablecoinValue(parsedAmounts[Field.OUTPUT])
const outputValue = showWrap ? parsedAmount : trade?.outputAmount
const fiatValueInput = useStablecoinValue(inputValue)
const fiatValueOutput = useStablecoinValue(outputValue)
const stablecoinPriceImpact = useMemo( const stablecoinPriceImpact = useMemo(
() => (routeIsSyncing ? undefined : computeFiatValuePriceImpact(fiatValueInput, fiatValueOutput)), () => (routeIsSyncing ? undefined : computeFiatValuePriceImpact(fiatValueInput, fiatValueOutput)),
[fiatValueInput, fiatValueOutput, routeIsSyncing] [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