File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ const config = {
3+ sei : {
4+ address : "0x7b90821232074285a9ee9bee868bcc36231f8e32" ,
5+ fromBlock : 175855916 ,
6+ } ,
7+ }
8+
9+ module . exports = {
10+ config
11+ }
Original file line number Diff line number Diff line change 1+ const { sumTokens2 } = require ( "../helper/unwrapLPs.js" )
2+ const {
3+ config,
4+ } = require ( "./config.js" ) ;
5+
6+ module . exports = {
7+ methodology : `TVL is retrieved on-chain by getting the total assets managed by the Rocketizer contracts` ,
8+ } ;
9+
10+ async function tvl ( api ) {
11+ const chainConfig = config [ api . chain ]
12+ const { address : parallelizerAddress , fromBlock} = chainConfig
13+ const collaterals = await api . call ( { abi : 'address[]:getCollateralList' , target : parallelizerAddress , block : fromBlock } )
14+ return sumTokens2 ( { api, owner : parallelizerAddress , tokens : collaterals } )
15+ }
16+
17+ Object . keys ( config ) . forEach ( chain => {
18+ module . exports [ chain ] = { tvl }
19+ } ) ;
You can’t perform that action at this time.
0 commit comments