File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments