diff --git a/src/custom/state/price/updater.ts b/src/custom/state/price/updater.ts index 78d89fa95..69ad66a23 100644 --- a/src/custom/state/price/updater.ts +++ b/src/custom/state/price/updater.ts @@ -18,6 +18,7 @@ import { useActiveWeb3React } from 'hooks/web3' import useDebounce from 'hooks/useDebounce' import useIsOnline from 'hooks/useIsOnline' import { QuoteInformationObject } from './reducer' +import { WETH9_EXTENDED } from '@src/custom/constants/tokens' const DEBOUNCE_TIME = 350 const REFETCH_CHECK_INTERVAL = 10000 // Every 10s @@ -146,8 +147,15 @@ export default function FeesUpdater(): null { // Don't refetch if: // - window is not visible // - some parameter is missing + // - it is a wrapping operation if (!chainId || !sellToken || !buyToken || !typedValue || !windowVisible) return + const isWrapping = + (sellCurrency?.isNative && buyCurrency?.wrapped.equals(WETH9_EXTENDED[chainId])) || + (sellCurrency?.wrapped.equals(WETH9_EXTENDED[chainId]) && buyCurrency?.isNative) + + if (isWrapping) return + // Don't refetch if the amount is missing const kind = independentField === Field.INPUT ? OrderKind.SELL : OrderKind.BUY const amount = tryParseAmount(typedValue, (kind === OrderKind.SELL ? sellCurrency : buyCurrency) ?? undefined)