Skip to content

Commit

Permalink
update treehouse DefiLlama#11737
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki authored and tlatkdgus1 committed Nov 25, 2024
1 parent 4fcdb9c commit 4f3beee
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions projects/treehouse/index.js
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,
}
}
}

0 comments on commit 4f3beee

Please sign in to comment.