File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
projects/reservoir-protocol Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ const config = {
2
+ ethereum : [
3
+ // https://docs.reservoir.xyz/products/proof-of-reserves
4
+ '0x0c7e4342534e6e8783311dCF17828a2aa0951CC7' ,
5
+ '0x9BB2c38F57883E5285b7c296c66B9eEA4769eF80' ,
6
+ '0x99A95a9E38e927486fC878f41Ff8b118Eb632b10' ,
7
+ // '0x31Eae643b679A84b37E3d0B4Bd4f5dA90fB04a61', - exluded RUSD because it is project's own token
8
+ ]
9
+ }
10
+
11
+ Object . keys ( config ) . forEach ( chain => {
12
+ const funds = config [ chain ]
13
+ module . exports [ chain ] = {
14
+ tvl : async ( api ) => {
15
+ const tokens = await api . multiCall ( { abi : 'address:underlying' , calls : funds } )
16
+ const bals = await api . multiCall ( { abi : 'uint256:totalValue' , calls : funds } )
17
+ const decimals = await api . multiCall ( { abi : 'uint8:decimals' , calls : tokens } )
18
+ bals . forEach ( ( v , i ) => bals [ i ] = v * 10 ** ( decimals [ i ] - 18 ) )
19
+ api . add ( tokens , bals )
20
+ }
21
+ }
22
+ } )
You can’t perform that action at this time.
0 commit comments