Skip to content

Commit b07b36f

Browse files
committed
track bitzip: DefiLlama#12866
1 parent ba03fd3 commit b07b36f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

projects/bitzap/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
const config = {
3+
btr: { factory: '0xe4fb0d76c7ba28dd4d115ff63c0b14d8d7f9838a', },
4+
}
5+
6+
Object.keys(config).forEach(chain => {
7+
const { factory, } = config[chain]
8+
module.exports[chain] = {
9+
tvl: async (api) => {
10+
const pools = await api.fetchList({ lengthAbi: 'pool_count', itemAbi: 'pool_list', target: factory })
11+
const tokens = await api.multiCall({ abi: 'function get_coins(address) view returns (address[])', calls: pools, target: factory })
12+
const ownerTokens = pools.map((p, i) => [tokens[i], p])
13+
return api.sumTokens({ ownerTokens, blacklistedTokens: pools })
14+
}
15+
}
16+
})

0 commit comments

Comments
 (0)