From 7f1bbd7e41caf3675de6bea6eec068bfac20dc77 Mon Sep 17 00:00:00 2001 From: Fabien C Date: Thu, 6 Nov 2025 12:06:27 +0200 Subject: [PATCH] Feat/add rocky (#16956) --- projects/rocky/config.js | 11 +++++++++++ projects/rocky/index.js | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 projects/rocky/config.js create mode 100644 projects/rocky/index.js diff --git a/projects/rocky/config.js b/projects/rocky/config.js new file mode 100644 index 000000000..5e5053d9d --- /dev/null +++ b/projects/rocky/config.js @@ -0,0 +1,11 @@ + +const config = { + sei: { + address: "0x7b90821232074285a9ee9bee868bcc36231f8e32", + fromBlock: 175855916, + }, +} + +module.exports = { + config +} \ No newline at end of file diff --git a/projects/rocky/index.js b/projects/rocky/index.js new file mode 100644 index 000000000..8de01cb44 --- /dev/null +++ b/projects/rocky/index.js @@ -0,0 +1,19 @@ +const {sumTokens2 } = require("../helper/unwrapLPs.js") +const { + config, + } = require("./config.js"); + +module.exports = { + methodology: `TVL is retrieved on-chain by getting the total assets managed by the Rocketizer contracts`, +}; + +async function tvl(api) { + const chainConfig = config[api.chain] + const {address: parallelizerAddress, fromBlock} = chainConfig + const collaterals = await api.call({ abi: 'address[]:getCollateralList', target: parallelizerAddress, block: fromBlock}) + return sumTokens2({ api, owner: parallelizerAddress, tokens: collaterals }) +} + +Object.keys(config).forEach(chain => { + module.exports[chain] = { tvl } +});