File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ const tokens = [
2
+ '0xEf5AAcB3c38a5Be7785a361008e27fb0328a62B5' , // secured private credit token
3
+ // '0xE16f2eC94E8a0819EB93022c45E05D582f4E5c15', // private credit token
4
+ ] ;
5
+
6
+ async function tvl ( _ , _1 , _2 , { api } ) {
7
+ const uTokens = await api . multiCall ( { abi : 'address:usdc' , calls : tokens } )
8
+ return api . sumTokens ( { tokensAndOwners2 : [ uTokens , tokens , ] } )
9
+ }
10
+ async function borrowed ( _ , _1 , _2 , { api } ) {
11
+ const uTokens = await api . multiCall ( { abi : 'address:usdc' , calls : tokens } )
12
+ const bals = ( await api . multiCall ( { abi : 'uint256:totalPooledUSD' , calls : tokens } ) ) . map ( i => i / 1e12 )
13
+ const inContracts = ( await api . multiCall ( { abi : 'address:reserveUSD' , calls : tokens } ) ) . map ( i => i * - 1 )
14
+ api . add ( uTokens , bals )
15
+ api . add ( uTokens , inContracts )
16
+ return api . getBalances ( )
17
+ }
18
+
19
+ module . exports = {
20
+ methodology : "Sums the locked collateral amounts and depositor token balances." ,
21
+ ethereum : {
22
+ tvl, borrowed,
23
+ } ,
24
+ } ;
You can’t perform that action at this time.
0 commit comments