From 7f111926f5e59f865e81c57d3aca17ea13878bd4 Mon Sep 17 00:00:00 2001 From: Mantas S Date: Wed, 25 Sep 2024 10:57:26 +0300 Subject: [PATCH] Update index.ts --- src/factory/providers/solana/orca/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/factory/providers/solana/orca/index.ts b/src/factory/providers/solana/orca/index.ts index d0969c7..f737511 100644 --- a/src/factory/providers/solana/orca/index.ts +++ b/src/factory/providers/solana/orca/index.ts @@ -58,8 +58,10 @@ async function tvl(params: ITvlParams): Promise> { } const poolInfo = (await axios.get(WHIRLPOOL_Endpoint)).data; + const filteredPools = poolInfo.whirlpools.filter((pool) => pool.tvl >= 1000); + const promisesForTokenBalance = []; - poolInfo.whirlpools.forEach((pool) => { + filteredPools.forEach((pool) => { promisesForTokenBalance.push( getTokenBalance(pool.tokenA.mint, pool.address, web3), ); @@ -68,7 +70,7 @@ async function tvl(params: ITvlParams): Promise> { ); }); const results = await Promise.all(promisesForTokenBalance); - poolInfo.whirlpools.forEach((pool) => { + filteredPools.forEach((pool) => { if (!balances[pool.tokenA.mint]) { balances[pool.tokenA.mint] = BigNumber(results[0]); } else {