Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jan 27, 2025
1 parent 6a3a3b1 commit 9bc3362
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions projects/vicuna/index.js
Original file line number Diff line number Diff line change
@@ -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})
}
}
}

0 comments on commit 9bc3362

Please sign in to comment.