Skip to content

Commit

Permalink
ramses fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slasher125 committed Dec 18, 2024
1 parent 1d8455c commit d920dec
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/adaptors/ramses-legacy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,26 @@ const getApy = async () => {
];
const priceKeys = tokens.map((i) => `arbitrum:${i}`).join(',');

const prices = (
await axios.get(`https://coins.llama.fi/prices/current/${priceKeys}`)
).data.coins;
const maxSize = 50;
const pages = Math.ceil(tokens.length / maxSize);
let pricesA = [];
let keys = '';
for (const p of [...Array(pages).keys()]) {
keys = tokens
.slice(p * maxSize, maxSize * (p + 1))
.map((i) => `arbitrum:${i}`)
.join(',')
.replaceAll('/', '');
pricesA = [
...pricesA,
(await axios.get(`https://coins.llama.fi/prices/current/${keys}`)).data
.coins,
];
}
let prices = {};
for (const p of pricesA) {
prices = { ...prices, ...p };
}

const pools = allPairs.map((p, i) => {
const poolMeta = metaData[i];
Expand Down

0 comments on commit d920dec

Please sign in to comment.