From 17de0a263f6f163ca3baabe415cba3494a6efd20 Mon Sep 17 00:00:00 2001 From: molecular Date: Sun, 19 Oct 2025 12:31:38 +0800 Subject: [PATCH] add Molecular --- projects/molecular/index.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 projects/molecular/index.js diff --git a/projects/molecular/index.js b/projects/molecular/index.js new file mode 100644 index 0000000000..19049b0523 --- /dev/null +++ b/projects/molecular/index.js @@ -0,0 +1,21 @@ +const { sumTokens2 } = require("../helper/unwrapLPs") + +const POOL_AGGREGATOR_ADDRESS = "0xF4C39ee884b3304CdB35abd256Df95Eb2F5e795B" +const POOL_COLLATERAL_MANAGER = "0xF4C39ee884b3304CdB35abd256Df95Eb2F5e795B" +async function tvl(api){ + let pools = await api.call({ + abi:ABI.getPoolTotalTvl, + target:POOL_AGGREGATOR_ADDRESS, + }) + pools.forEach(({ assets, tvl }) => { api.add(assets, tvl) }) + let tokensAndOwners = pools.map(pool=>[pool.assets,POOL_COLLATERAL_MANAGER]) + return sumTokens2({ api ,resolveLP:true,tokensAndOwners}); +} + +module.exports = { + arbitrum: { tvl } + }; + +const ABI = { + getPoolTotalTvl:"function getPoolTotalTvl() view returns (tuple(uint256 pid, address assets, uint256 tvl)[])" +} \ No newline at end of file