From 9bf6630b3117ebaa247d216d3a98d0cb282088c6 Mon Sep 17 00:00:00 2001 From: Verisana Date: Tue, 22 Nov 2022 12:49:20 +0000 Subject: [PATCH] fix: set liquidity fetch timeout to 1sec CurveV1Factory --- src/dex/curve-v1-factory/constants.ts | 2 ++ src/dex/curve-v1-factory/curve-v1-pool-manager.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dex/curve-v1-factory/constants.ts b/src/dex/curve-v1-factory/constants.ts index 3670de2a3..4467d1d91 100644 --- a/src/dex/curve-v1-factory/constants.ts +++ b/src/dex/curve-v1-factory/constants.ts @@ -15,6 +15,8 @@ export const POOL_EXCHANGE_GAS_COST = 200 * 1000; // This is a liquidity threshold used for pool state update export const MIN_LIQUIDITY_IN_USD = 10; +export const LIQUIDITY_FETCH_TIMEOUT = 1000; + // Pooltracker relevant variables export const CURVE_API_URL = 'https://api.curve.fi/api/getPools'; export const NETWORK_ID_TO_NAME: Record = { diff --git a/src/dex/curve-v1-factory/curve-v1-pool-manager.ts b/src/dex/curve-v1-factory/curve-v1-pool-manager.ts index dda3d9f81..729987205 100644 --- a/src/dex/curve-v1-factory/curve-v1-pool-manager.ts +++ b/src/dex/curve-v1-factory/curve-v1-pool-manager.ts @@ -5,6 +5,7 @@ import { IDexHelper } from '../../dex-helper'; import { TaskScheduler } from '../../lib/task-scheduler'; import { CURVE_API_URL, + LIQUIDITY_FETCH_TIMEOUT, LIQUIDITY_UPDATE_PERIOD_MS, NETWORK_ID_TO_NAME, STATE_UPDATE_PERIOD_MS, @@ -285,7 +286,7 @@ export class CurveV1FactoryPoolManager { usdTotalExcludingBasePool: number; }[]; }; - }>(URL); + }>(URL, LIQUIDITY_FETCH_TIMEOUT); }, ), );