diff --git a/projects/vicuna/index.js b/projects/vicuna/index.js new file mode 100644 index 0000000000..c57965e8ab --- /dev/null +++ b/projects/vicuna/index.js @@ -0,0 +1,17 @@ +const { getConfig } = require('../helper/cache'); +const { sumTokens2 } = require("../helper/unwrapLPs"); + +module.exports = { + sonic: { + tvl: async (api) => { + const pools = await getConfig('vicuna','https://raw.githubusercontent.com/VicunaFinance-com/vicuna-frontend/refs/heads/main/config/sonic.json'); + + // Extract earnedTokenAddress from each pool + const vaults = pools.map(pool => pool.vaultAddress) + const tokens = await api.multiCall({ abi: 'address:want', calls: vaults}) + const balances = await api.multiCall({ abi: 'uint256:balance', calls: vaults}) + api.add(tokens, balances) + return sumTokens2({ resolveLP: true, api}) + } + } + } \ No newline at end of file