File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ const { sumTokens2 } = require ( "../helper/unwrapLPs" ) ;
2
+
3
+ module . exports = {
4
+ methodology :
5
+ "TVL counts the collateral tokens that are deposited within the respective Brunch vault" ,
6
+ } ;
7
+
8
+ const config = {
9
+ sonic : {
10
+ vaultFactory : "0x486265E7BAedFF677aec98f7769Cf737657E009a" ,
11
+ } ,
12
+ } ;
13
+
14
+ Object . keys ( config ) . forEach ( ( chain ) => {
15
+ const { vaultFactory } = config [ chain ] ;
16
+ module . exports [ chain ] = {
17
+ tvl : async ( api ) => {
18
+ const vaults = await api . fetchList ( { lengthAbi : 'allVaultsLength' , itemAbi : 'allVaults' , target : vaultFactory } )
19
+ const tokens = await api . multiCall ( { abi : 'address:collateralToken' , calls : vaults } )
20
+ return sumTokens2 ( { tokensAndOwners2 : [ tokens , vaults ] , api } )
21
+ }
22
+ }
23
+ } )
You can’t perform that action at this time.
0 commit comments