Skip to content

Commit 4f44606

Browse files
committed
Add theo-network integration for TVL calculation # 12673
1 parent 3eb0929 commit 4f44606

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

projects/theo-network/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { getConfig } = require('../helper/cache')
2+
3+
const config = {
4+
ethereum: {},
5+
arbitrum: {},
6+
base: {},
7+
}
8+
9+
Object.keys(config).forEach(chain => {
10+
module.exports[chain] = {
11+
tvl: async (api) => {
12+
const { [chain]: data } = await getConfig('theo-network', "https://vaults.theo.xyz/vaults/vaultInfo");
13+
14+
const calls = Object.values(data).map(i => i.contract)
15+
const tokens = Object.values(data).map(i => i.asset)
16+
const bals = await api.multiCall({ abi: 'uint256:totalBalance', calls })
17+
api.add(tokens, bals)
18+
}
19+
}
20+
})

0 commit comments

Comments
 (0)