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

Latch #12879

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Latch #12879

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
22 changes: 22 additions & 0 deletions projects/latch/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { sumTokens2 } = require('../helper/unwrapLPs');

const tvl = async (api) => {
const depositPools = [
'0xFE606EEc8Eb8e6Ad8E8654968a15650F5331a023',
'0x7cC08f23a6E8222c86a62fCE3d4d252dd1b8f90C',
]

const tokens = await api.multiCall({ abi: 'address:ASSET_TOKEN', calls: depositPools })
const stakingPools = await api.multiCall({ abi: 'address:treasury', calls: depositPools })
const nextTreasuries = await api.multiCall({ abi: 'address:nextTreasury', calls: stakingPools })
const withdrawPools = await api.multiCall({ abi: 'address:withdrawPool', calls: stakingPools })

await sumTokens2({ api, tokens, owners: depositPools.concat(withdrawPools), })
return sumTokens2({ api, tokens, owners: nextTreasuries.concat(stakingPools), fetchCoValentTokens: true, tokenConfig: { onlyWhitelisted: false, } })
};

module.exports = {
ethereum: {
tvl,
},
};
Loading