Skip to content

Commit

Permalink
Update update-apy.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakMooney authored Oct 11, 2024
1 parent fac6bb6 commit 855c979
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions update-apy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const axios = require('axios');
const fs = require('fs');

const tokenHypervisors = [
"0x0000000000000000000000000000000000000000",
"0x52ee1FFBA696c5E9b0Bc177A9f8a3098420EA691",
"0x330DFC5Bc1a63A1dCf1cD5bc9aD3D5e5E61Bcb6C",
"0xfA392dbefd2d5ec891eF5aEB87397A89843a8260",
Expand All @@ -15,13 +16,18 @@ const fetchData = async () => {
data: {}
};

for (const hypervisor of tokenHypervisors) {
try {
const response = await axios.get(`https://wire2.gamma.xyz/arbitrum/hypervisors/${hypervisor}/feeReturns/daily`);
filteredData.data[hypervisor] = { feeApy: response.data.feeApy };
} catch (error) {
console.error(`Failed to fetch data for ${hypervisor}, error`);
}
try {
const response = await axios.get(
`https://wire2.gamma.xyz/arbitrum/hypervisors/feeReturns/daily`
);

const feeReturns = response?.data;

tokenHypervisors && tokenHypervisors.length && tokenHypervisors.forEach((address) => {
filteredData.data[address] = { feeApy: feeReturns?.feeApy };
});
} catch (error) {
console.error(`Failed to fetch hypervisor data, error`);
}

fs.writeFileSync('apy-data.json', JSON.stringify(filteredData, null, 2));
Expand Down

0 comments on commit 855c979

Please sign in to comment.