forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fcdb9c
commit 4f3beee
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json'); | ||
const { sumTokensExport } = require('../helper/unwrapLPs'); | ||
const { sumTokens2 } = require('../helper/unwrapLPs') | ||
|
||
async function tvl(api) { | ||
const vault = '0x551d155760ae96050439ad24ae98a96c765d761b' | ||
const tokens = await api.call({ abi: 'address[]:getAllowableAssets', target: vault }) | ||
await api.sumTokens({ owner: vault, tokens }) | ||
|
||
const storage = await api.call({ abi: 'address:strategyStorage', target: vault }) | ||
const strategies = await api.fetchList({ lengthAbi: 'getStrategyCount', itemAbi: 'getStrategyAddress', target: storage }) | ||
return sumTokens2({ | ||
api, owners: strategies, fetchCoValentTokens: true, resolveUniV3: true, tokenConfig: { | ||
onlyWhitelisted: false, | ||
} | ||
}) | ||
} | ||
|
||
module.exports = { | ||
methodology: 'Token balance in vault and strategy contracts', | ||
start: 1725926400, // Tuesday, September 10, 2024 12:00:00 AM | ||
ethereum: { | ||
tvl: sumTokensExport({ owner: '0x551d155760ae96050439AD24Ae98A96c765d761B', tokens: [ADDRESSES.ethereum.WSTETH], }), | ||
tvl, | ||
} | ||
} | ||
} |