fix: reduce price fetching to every 2m (#4622)

* fix: reduce price fetching to every 2m

* fix: grammar
This commit is contained in:
Zach Pomerantz 2022-09-13 15:16:01 -07:00 committed by GitHub
parent 884dee2db3
commit 6fe2c92cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -44,7 +44,8 @@ export function useRoutingAPITrade<TTradeType extends TradeType>(
})
const { isLoading, isError, data, currentData } = useGetQuoteQuery(queryArgs ?? skipToken, {
pollingInterval: ms`15s`,
// Price-fetching is informational and costly, so it's done less frequently.
pollingInterval: routerPreference === RouterPreference.PRICE ? ms`2m` : ms`15s`,
})
const quoteResult: GetQuoteResult | undefined = useIsValidBlock(Number(data?.blockNumber) || 0) ? data : undefined