Skip to content

Commit bbb1d9a

Browse files
matejos0xpeluche
andauthored
Add Api3 curator TVL (#18533)
Co-authored-by: 0xpeluche <110820448+0xpeluche@users.noreply.github.com>
1 parent 7a4d305 commit bbb1d9a

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

projects/api3/index.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
const sdk = require('@defillama/sdk');
21
const { sumTokens2 } = require('../helper/unwrapLPs')
2+
const { getCuratorExport } = require("../helper/curators");
33

44
const api3_token = '0x0b38210ea11411557c13457d4da7dc6ea731b88a'
55
const api3_dao_pool = '0x6dd655f10d4b9e242ae186d9050b68f725c76d76'
66
const api3CirculatingSupply = "0xcD34bC5B03C954268d27c9Bc165a623c318bD0a8"
77

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+
}
1418

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 })
1723
}
1824

1925
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.',
2028
ethereum: {
21-
staking: stakingTVL, // tvl / staking
22-
tvl: () => ({})
29+
...getCuratorExport(configs).ethereum,
30+
staking,
2331
},
24-
methodology: 'API3 TVL is all API3 token staked in the API3 DAO Pool contract',
2532
}

0 commit comments

Comments
 (0)