|
1 | | -async function tvl_plume_mainnet(api) { |
2 | | - const mineralVaults = ["0x5107272921A750A20d492Fb41Acf0b770b09a624"]; |
3 | | - const issuerReserveWallets = ["0xCcBA2623B2CE6148c09d8E676B81E472D85c21Ea"]; |
| 1 | +const mineralVaults = ["0x9D08946Ca5856f882A56c29042FbEDC5142663b9"]; |
4 | 2 |
|
| 3 | +async function tvl_ethereum(api) { |
5 | 4 | const totalSupplies = await api.multiCall({ abi: 'erc20:totalSupply', calls: mineralVaults }); |
6 | | - const issuerReserveBalances = await api.multiCall({ |
7 | | - abi: 'erc20:balanceOf', |
8 | | - calls: mineralVaults.flatMap(token => issuerReserveWallets.map(owner => ({ target: token, params: owner }))) |
9 | | - }); |
10 | | - |
11 | | - const circulatingSupplies = mineralVaults.map((vault, index) => { |
12 | | - const reserveBalances = issuerReserveWallets |
13 | | - .map((_, j) => BigInt(issuerReserveBalances[index * issuerReserveWallets.length + j])) |
14 | | - .reduce((a, b) => a + b, 0n); |
15 | | - return { |
16 | | - vault, |
17 | | - circulating: BigInt(totalSupplies[index]) - reserveBalances |
18 | | - }; |
19 | | - }); |
| 5 | + api.add(mineralVaults, totalSupplies); |
| 6 | +} |
20 | 7 |
|
21 | | - circulatingSupplies.forEach(({ vault, circulating }) => api.add(vault, circulating)); |
| 8 | +async function tvl_plume_mainnet(api) { |
| 9 | + const totalSupplies = await api.multiCall({ abi: 'erc20:totalSupply', calls: mineralVaults }); |
| 10 | + api.add(mineralVaults, totalSupplies); |
22 | 11 | } |
23 | 12 |
|
24 | 13 | module.exports = { |
25 | 14 | methodology: "TVL is the total supply of tokens, each representing a fully-backed real-world oil & gas asset from Mineral Vault funds.", |
| 15 | + ethereum: { tvl: tvl_ethereum }, |
26 | 16 | plume_mainnet: { tvl: tvl_plume_mainnet }, |
27 | 17 | } |
0 commit comments