Skip to content

Commit 4da4f0e

Browse files
added thesauros protocol information
Update index.js
1 parent a84196d commit 4da4f0e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

projects/thesauros/index.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const config = {
2+
arbitrum: [
3+
'0x57C10bd3fdB2849384dDe954f63d37DfAD9d7d70', // tUSDC
4+
]
5+
};
6+
7+
const abi = "function getDepositBalance(address user, address vault) view returns (uint256 balance)";
8+
9+
module.exports = {
10+
methodology: "TVL displays the total amount of assets stored in the Thesauros contracts.",
11+
start: '2025-09-19',
12+
hallmarks: [[1758283200, "Protocol launch"]],
13+
};
14+
15+
Object.keys(config).forEach((chain) => {
16+
module.exports[chain] = { tvl: (api) => tvl(api, config[chain]) };
17+
});
18+
19+
const tvl = async (api, vaults) => {
20+
const [providers, assets] = await Promise.all([
21+
api.multiCall({ calls: vaults, abi: "address:activeProvider" }),
22+
api.multiCall({ calls: vaults, abi: "address:asset" }),
23+
]);
24+
25+
const balances = await api.multiCall({ calls: vaults.map((vault, i) => ({ target: providers[i], params: [vault, vault] })), abi })
26+
api.add(assets, balances)
27+
};

0 commit comments

Comments
 (0)