fix: handle usdc directly in useUSDCPrice (#1683)

This commit is contained in:
Justin Domingue 2021-05-21 16:45:39 -07:00 committed by GitHub
parent 9822e68d5a
commit 02269e9376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,6 +37,11 @@ export default function useUSDCPrice(currency?: Currency): Price<Currency, Token
)
}
// handle usdc
if (currency?.wrapped.equals(USDC)) {
return new Price(USDC, USDC, '1', '1')
}
// use v2 price if available, v3 as fallback
if (v2USDCTrade) {
const { numerator, denominator } = v2USDCTrade.route.midPrice