Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mantasfam committed Sep 25, 2024
1 parent 8a476e8 commit 7f11192
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/factory/providers/solana/orca/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ async function tvl(params: ITvlParams): Promise<Partial<ITvlReturn>> {
}

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),
);
Expand All @@ -68,7 +70,7 @@ async function tvl(params: ITvlParams): Promise<Partial<ITvlReturn>> {
);
});
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 {
Expand Down

0 comments on commit 7f11192

Please sign in to comment.