Skip to content

Commit

Permalink
fix: set liquidity fetch timeout to 1sec CurveV1Factory
Browse files Browse the repository at this point in the history
  • Loading branch information
Verisana committed Nov 22, 2022
1 parent 137d891 commit 9bf6630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dex/curve-v1-factory/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number, string> = {
Expand Down
3 changes: 2 additions & 1 deletion src/dex/curve-v1-factory/curve-v1-pool-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -285,7 +286,7 @@ export class CurveV1FactoryPoolManager {
usdTotalExcludingBasePool: number;
}[];
};
}>(URL);
}>(URL, LIQUIDITY_FETCH_TIMEOUT);
},
),
);
Expand Down

0 comments on commit 9bf6630

Please sign in to comment.