|
1 | | -const sdk = require('@defillama/sdk'); |
2 | 1 | const { sumTokens2 } = require('../helper/unwrapLPs') |
| 2 | +const { getCuratorExport } = require("../helper/curators"); |
3 | 3 |
|
4 | 4 | const api3_token = '0x0b38210ea11411557c13457d4da7dc6ea731b88a' |
5 | 5 | const api3_dao_pool = '0x6dd655f10d4b9e242ae186d9050b68f725c76d76' |
6 | 6 | const api3CirculatingSupply = "0xcD34bC5B03C954268d27c9Bc165a623c318bD0a8" |
7 | 7 |
|
8 | | -const stakingTVL = async (api) => { |
9 | | - const balances = {} |
10 | | - const locked_and_vested = await api.call({ |
11 | | - target: api3CirculatingSupply, |
12 | | - abi: "uint256:getLockedVestings", |
13 | | - }) |
| 8 | +const configs = { |
| 9 | + blockchains: { |
| 10 | + ethereum: { |
| 11 | + morphoVaultOwners: [ |
| 12 | + '0x9f0566F2E8Ff51901DD0C0E7aad937A94931f75C', |
| 13 | + '0x5a9AA3219dD1cBEF6A18Fd221464E071DF2677c2' |
| 14 | + ] |
| 15 | + } |
| 16 | + } |
| 17 | +} |
14 | 18 |
|
15 | | - sdk.util.sumSingleBalance(balances,api3_token,locked_and_vested * -1, api.chain) |
16 | | - return sumTokens2({ owner: api3_dao_pool, tokens: [api3_token], balances, api }) |
| 19 | +const staking = async (api) => { |
| 20 | + const balances = await api.call({ target: api3CirculatingSupply, abi: "uint256:getLockedVestings" }) |
| 21 | + api.add(api3_token, -balances) |
| 22 | + return sumTokens2({ owner: api3_dao_pool, tokens: [api3_token], api }) |
17 | 23 | } |
18 | 24 |
|
19 | 25 | module.exports = { |
| 26 | + ...getCuratorExport(configs), |
| 27 | + methodology: 'Api3 TVL is all Api3 token staked in the Api3 DAO Pool contract and all assets that are deposited in all vaults curated by Api3.', |
20 | 28 | ethereum: { |
21 | | - staking: stakingTVL, // tvl / staking |
22 | | - tvl: () => ({}) |
| 29 | + ...getCuratorExport(configs).ethereum, |
| 30 | + staking, |
23 | 31 | }, |
24 | | - methodology: 'API3 TVL is all API3 token staked in the API3 DAO Pool contract', |
25 | 32 | } |
0 commit comments