1
-
2
1
const ADDRESSES = require ( '../helper/coreAssets.json' ) ;
3
2
const methodologies = require ( '../helper/methodologies' ) ;
4
3
5
4
const config = {
6
5
ethereum : {
7
6
userManager : "0x49c910Ba694789B58F53BFF80633f90B8631c195" ,
8
- DAI : ADDRESSES . ethereum . DAI ,
9
- uDAI : "0x954F20DF58347b71bbC10c94827bE9EbC8706887" ,
7
+ underlying : ADDRESSES . ethereum . DAI ,
8
+ uToken : "0x954F20DF58347b71bbC10c94827bE9EbC8706887" ,
10
9
} ,
11
10
arbitrum : {
12
11
userManager : "0xb71F3D4342AaE0b8D531E14D2CF2F45d6e458A5F" ,
13
- DAI : ADDRESSES . optimism . DAI ,
14
- uDAI : "0x954F20DF58347b71bbC10c94827bE9EbC8706887" ,
12
+ underlying : ADDRESSES . arbitrum . DAI ,
13
+ uToken : "0x954F20DF58347b71bbC10c94827bE9EbC8706887" ,
15
14
} ,
16
15
optimism : {
17
16
userManager : "0x8E195D65b9932185Fcc76dB5144534e0f3597628" ,
18
- DAI : ADDRESSES . optimism . DAI ,
19
- uDAI : "0xE478b5e7A423d7CDb224692d0a816CA146A744b2" ,
17
+ underlying : ADDRESSES . optimism . DAI ,
18
+ uToken : "0xE478b5e7A423d7CDb224692d0a816CA146A744b2" ,
19
+ } ,
20
+ base : {
21
+ userManager : "0xfd745A1e2A220C6aC327EC55d2Cb404CD939f56b" ,
22
+ underlying : ADDRESSES . base . USDC ,
23
+ uToken : "0xc2447f36FfdA08E278D25D08Ea91D942f0C2d6ea" ,
20
24
} ,
21
25
} ;
22
26
@@ -28,19 +32,20 @@ const abi = {
28
32
} ;
29
33
30
34
async function tvl ( api ) {
31
- const { userManager, DAI , uDAI } = config [ api . chain ]
35
+ const { userManager, underlying, uToken } = config [ api . chain ]
36
+ console . log ( { userManager, underlying, uToken } )
32
37
const bals = await api . batchCall ( [
33
38
{ target : userManager , abi : abi . totalStaked } ,
34
- { target : uDAI , abi : abi . totalRedeemable } ,
35
- { target : uDAI , abi : abi . totalReserves } ,
39
+ { target : uToken , abi : abi . totalRedeemable } ,
40
+ { target : uToken , abi : abi . totalReserves } ,
36
41
] )
37
- bals . forEach ( i => api . add ( DAI , i ) )
42
+ bals . forEach ( i => api . add ( underlying , i ) )
38
43
}
39
44
40
45
async function borrowed ( api ) {
41
- const { DAI , uDAI } = config [ api . chain ]
42
- const borrows = await api . call ( { target : uDAI , abi : abi . totalBorrows , } )
43
- api . add ( DAI , borrows )
46
+ const { underlying , uToken } = config [ api . chain ]
47
+ const borrows = await api . call ( { target : uToken , abi : abi . totalBorrows , } )
48
+ api . add ( underlying , borrows )
44
49
}
45
50
46
51
module . exports = {
0 commit comments