From 55b5e22b8ad0edba5e8c114fcd11f8caa39b5ab4 Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Tue, 27 Feb 2024 18:04:33 +0600 Subject: [PATCH] fix: increase quote refresh interval for Swap and TWAP (#3935) --- apps/cowswap-frontend/src/common/updaters/FeesUpdater.ts | 2 +- .../src/modules/tradeQuote/hooks/useTradeQuotePolling.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/cowswap-frontend/src/common/updaters/FeesUpdater.ts b/apps/cowswap-frontend/src/common/updaters/FeesUpdater.ts index 5998a39bda..f772988e29 100644 --- a/apps/cowswap-frontend/src/common/updaters/FeesUpdater.ts +++ b/apps/cowswap-frontend/src/common/updaters/FeesUpdater.ts @@ -28,7 +28,7 @@ import { getPriceQuality } from 'api/gnosisProtocol/api' import { useVerifiedQuotesEnabled } from '../hooks/featureFlags/useVerifiedQuotesEnabled' export const TYPED_VALUE_DEBOUNCE_TIME = 350 -export const SWAP_QUOTE_CHECK_INTERVAL = ms`10s` // Every 10s +export const SWAP_QUOTE_CHECK_INTERVAL = ms`30s` // Every 30s const RENEW_FEE_QUOTES_BEFORE_EXPIRATION_TIME = ms`30s` // Will renew the quote if there's less than 30 seconds left for the quote to expire const WAITING_TIME_BETWEEN_EQUAL_REQUESTS = ms`5s` // Prevents from sending the same request to often (max, every 5s) diff --git a/apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts b/apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts index 5eb4206544..faf2ae5625 100644 --- a/apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts +++ b/apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts @@ -19,8 +19,7 @@ import { useQuoteParams } from './useQuoteParams' import { tradeQuoteParamsAtom } from '../state/tradeQuoteParamsAtom' -// Every 10s -export const PRICE_UPDATE_INTERVAL = 10_000 +export const PRICE_UPDATE_INTERVAL = ms`30s` const AMOUNT_CHANGE_DEBOUNCE_TIME = ms`300` // Solves the problem of multiple requests