Skip to content

Commit 03207cf

Browse files
g1nt0kiwfm-slava
andauthored
Restake-fi (DefiLlama#8956)
* Add restake-finance project * 'restake-finance': fix code * code refactor --------- Co-authored-by: Slava Matvienco <[email protected]>
1 parent 398ff4e commit 03207cf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

projects/restake-finance/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const StakePools = [
2+
'0xe384251B5f445A006519A2197bc6bD8E5fA228E5',
3+
'0x0448FddC3f4D666eC81DAc8172E60b8e5852386c',
4+
'0x357DEeD02020b73F8A124c4ea2bE3B6A725aaeC2',
5+
'0xD7BC2FE1d0167BD2532587e991abE556E3a66f3b',
6+
'0xD5193B851bf7C751BBA862Eca1298D4B4Cb17B81',
7+
];
8+
9+
async function tvl(_1, _2, _3, { api }) {
10+
const bals = await api.multiCall({ abi: 'uint256:getTotalUnderlying', calls: StakePools })
11+
const configs = await api.multiCall({ abi: "function getConfig() view returns ((address underlying, address protocolToken, uint16 maxStakers))", calls: StakePools })
12+
const tokens = configs.map(i => i.underlying)
13+
api.add(tokens, bals)
14+
}
15+
16+
module.exports = {
17+
ethereum: {
18+
tvl,
19+
}
20+
};

0 commit comments

Comments
 (0)