Skip to content

Commit 897cf1c

Browse files
add Molecular (#16745)
1 parent 9d0a569 commit 897cf1c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

projects/molecular/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { sumTokens2 } = require("../helper/unwrapLPs")
2+
3+
const POOL_AGGREGATOR_ADDRESS = "0xF4C39ee884b3304CdB35abd256Df95Eb2F5e795B"
4+
const POOL_COLLATERAL_MANAGER = "0xF4C39ee884b3304CdB35abd256Df95Eb2F5e795B"
5+
async function tvl(api){
6+
let pools = await api.call({
7+
abi:ABI.getPoolTotalTvl,
8+
target:POOL_AGGREGATOR_ADDRESS,
9+
})
10+
pools.forEach(({ assets, tvl }) => { api.add(assets, tvl) })
11+
let tokensAndOwners = pools.map(pool=>[pool.assets,POOL_COLLATERAL_MANAGER])
12+
return sumTokens2({ api ,resolveLP:true,tokensAndOwners});
13+
}
14+
15+
module.exports = {
16+
arbitrum: { tvl }
17+
};
18+
19+
const ABI = {
20+
getPoolTotalTvl:"function getPoolTotalTvl() view returns (tuple(uint256 pid, address assets, uint256 tvl)[])"
21+
}

0 commit comments

Comments
 (0)