From eaa892ab76494bcc9ea80a466033724f46999b4f Mon Sep 17 00:00:00 2001 From: Jaimi Patel Date: Wed, 18 Oct 2023 21:39:20 +0100 Subject: [PATCH] fix: add firm quote 2s timeout --- src/dex/dexalot/constants.ts | 2 ++ src/dex/dexalot/dexalot.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dex/dexalot/constants.ts b/src/dex/dexalot/constants.ts index b9841a015..67ad1f7f9 100644 --- a/src/dex/dexalot/constants.ts +++ b/src/dex/dexalot/constants.ts @@ -27,3 +27,5 @@ export const DEXALOT_RESTRICT_TTL_S = 60 * 30; // 30 minutes export const DEXALOT_RESTRICTED_CACHE_KEY = 'restricted'; export const DEXALOT_MIN_SLIPPAGE_FACTOR_THRESHOLD_FOR_RESTRICTION = new BigNumber('0.001'); + +export const DEXALOT_FIRM_QUOTE_TIMEOUT_MS = 2000; diff --git a/src/dex/dexalot/dexalot.ts b/src/dex/dexalot/dexalot.ts index eaa63ed89..90c795153 100644 --- a/src/dex/dexalot/dexalot.ts +++ b/src/dex/dexalot/dexalot.ts @@ -56,6 +56,7 @@ import { DEXALOT_RESTRICT_TTL_S, DEXALOT_RATELIMIT_CACHE_VALUE, DEXALOT_BLACKLIST_CACHES_TTL_S, + DEXALOT_FIRM_QUOTE_TIMEOUT_MS, } from './constants'; import { BI_MAX_UINT256 } from '../../bigint-constants'; import { ethers } from 'ethers'; @@ -580,7 +581,7 @@ export class Dexalot extends SimpleExchange implements IDex { const rfq: RFQResponse = await this.dexHelper.httpRequest.post( `${DEXALOT_API_URL}/api/rfq/firm`, rfqParams, - undefined, + DEXALOT_FIRM_QUOTE_TIMEOUT_MS, { 'x-apikey': this.dexalotAuthToken }, ); if (!rfq) {