Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add grow vault tvl #13014

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions projects/treehouse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,23 @@ const nav = await api.call({
api.add(ADDRESSES.ethereum.WSTETH, nav)
}

// NAV of grow vault. 1 gtETH === 1 wstETH
async function addGrowAutovaultNav(api) {
const gtEth_autovault = '0x5Fde59415625401278c4d41C6beFCe3790eb357f'
const gtETH_totalSupply = await api.call({ abi: 'erc20:totalSupply', target: gtEth_autovault})
const wstETH_balance = await api.call({ target: gtEth_autovault, abi: 'function convertToAssets(uint256) view returns (uint256)', params: gtETH_totalSupply, })

api.add(ADDRESSES.ethereum.WSTETH, wstETH_balance, { skipChain: true })
}


async function tvl(api) {
const vault = '0x551d155760ae96050439ad24ae98a96c765d761b'
const tokens = await api.call({ abi: 'address[]:getAllowableAssets', target: vault })
await api.sumTokens({ owner: vault, tokens })

await getInFlightLidoRedemptionNav(api)
await addGrowAutovaultNav(api)

const storage = await api.call({ abi: 'address:strategyStorage', target: vault })
const strategies = await api.fetchList({ lengthAbi: 'getStrategyCount', itemAbi: 'getStrategyAddress', target: storage })
Expand Down
Loading