Skip to content

Commit 761f254

Browse files
committed
feat: add TVL calculation for Zoo Protocol
1 parent 213034c commit 761f254

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

projects/zoofi-io/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
async function tvl(api) {
2+
const zooProtocol = '0xc0fA386aE92f18A783476d09121291A1972C30Dc'
3+
const assets = await api.call({ abi: 'address[]:assetTokens', target: zooProtocol })
4+
const vaults = (await api.multiCall({ abi: 'function getVaultAddresses(address) view returns (address[])', calls: assets, target: zooProtocol })).flat()
5+
const bals = await api.multiCall({ abi: 'uint256:assetBalance', calls: vaults })
6+
const tokens = await api.multiCall({ abi: 'address:assetToken', calls: vaults })
7+
api.add(tokens, bals)
8+
}
9+
10+
module.exports = {
11+
doublecounted: true,
12+
berachain: { tvl }
13+
}

0 commit comments

Comments
 (0)