Skip to content

Commit

Permalink
Merge pull request #533 from jaimi-io/fix/dexalot
Browse files Browse the repository at this point in the history
fix: add firm quote 2s timeout for Dexalot
  • Loading branch information
aburkut authored Oct 19, 2023
2 parents 951cecd + eaa892a commit 05999e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dex/dexalot/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
3 changes: 2 additions & 1 deletion src/dex/dexalot/dexalot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -580,7 +581,7 @@ export class Dexalot extends SimpleExchange implements IDex<DexalotData> {
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) {
Expand Down

0 comments on commit 05999e1

Please sign in to comment.