Skip to content

Commit

Permalink
zerolend fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slasher125 committed Nov 25, 2024
1 parent 6efcc61 commit 83ef4d8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/adaptors/zerolend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,19 @@ const apy = async () => {
)
);

const { pricesByAddress, pricesBySymbol } = await getPrices(
underlyingTokens.flat().concat(rewardTokens.flat(Infinity))
);
const allTokens = underlyingTokens.flat().concat(rewardTokens.flat(Infinity));
const pricesByAddress = {};
const pricesBySymbol = {};

for (let i = 0; i < allTokens.length; i += 50) {
const chunk = allTokens.slice(i, i + 50);
const {
pricesByAddress: chunkPricesByAddress,
pricesBySymbol: chunkPricesBySymbol,
} = await getPrices(chunk);
Object.assign(pricesByAddress, chunkPricesByAddress);
Object.assign(pricesBySymbol, chunkPricesBySymbol);
}

const pools = data.map(([chain, markets], i) => {
const chainPools = markets.map((pool, idx) => {
Expand Down

0 comments on commit 83ef4d8

Please sign in to comment.