Skip to content

Commit 7f1bbd7

Browse files
Feat/add rocky (#16956)
1 parent 238835e commit 7f1bbd7

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

projects/rocky/config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
const config = {
3+
sei: {
4+
address: "0x7b90821232074285a9ee9bee868bcc36231f8e32",
5+
fromBlock: 175855916,
6+
},
7+
}
8+
9+
module.exports = {
10+
config
11+
}

projects/rocky/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const {sumTokens2 } = require("../helper/unwrapLPs.js")
2+
const {
3+
config,
4+
} = require("./config.js");
5+
6+
module.exports = {
7+
methodology: `TVL is retrieved on-chain by getting the total assets managed by the Rocketizer contracts`,
8+
};
9+
10+
async function tvl(api) {
11+
const chainConfig = config[api.chain]
12+
const {address: parallelizerAddress, fromBlock} = chainConfig
13+
const collaterals = await api.call({ abi: 'address[]:getCollateralList', target: parallelizerAddress, block: fromBlock})
14+
return sumTokens2({ api, owner: parallelizerAddress, tokens: collaterals })
15+
}
16+
17+
Object.keys(config).forEach(chain => {
18+
module.exports[chain] = { tvl }
19+
});

0 commit comments

Comments
 (0)