Skip to content

Commit

Permalink
cache api call
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki authored Jul 26, 2024
1 parent 1646495 commit f433372
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions projects/fwx/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
const { getLogs2 } = require('../helper/cache/getLogs')
const axios = require('axios')
const { getConfig } = require('../helper/cache')

const xliplessDex = "0x82E90fB94fd9a5C19Bf38648DD2C9639Bde67c74";
const xliplessDex = "0x82E90fB94fd9a5C19Bf38648DD2C9639Bde67c74"

module.exports = {
avax: {
tvl,
},
};
}

async function tvl(api) {
const getAssetRes = await axios.get("https://app.fwx.finance/api/v2/assets?chain_id=43114")
const assets = getAssetRes.data.assets
const { assets } = await getConfig('fwx/'+api.chain, "https://app.fwx.finance/api/v2/assets?chain_id=43114")

let tokensAndOwners = [];
for (let i = 0; i < assets.length; i++) {
Expand All @@ -35,4 +34,4 @@ async function tvl(api) {
tokensAndOwners.push([i.underlyingToken, i.underlyingPool])
})
return api.sumTokens({ tokensAndOwners })
}
}

0 comments on commit f433372

Please sign in to comment.