Skip to content

Commit cb73456

Browse files
committed
track reservoir DefiLlama#11478
1 parent 36d5d85 commit cb73456

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

projects/reservoir-protocol/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
})

0 commit comments

Comments
 (0)