Skip to content

feat: add plume and curve amo #15058

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

Merged
merged 2 commits into from
Jun 14, 2025
Merged
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
49 changes: 40 additions & 9 deletions projects/originether/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,61 @@ const ethTvl = async (api) => {
const isNativeStrategy = (await api.multiCall({ abi: 'uint256:activeDepositedValidators', calls: strategies, permitFailure: true})).map(i => !!i)
const nativeStrategies = strategies.filter((_, i) => isNativeStrategy[i])

// vault balance
const vaultBalance = await api.call({ abi: 'erc20:balanceOf', target: ADDRESSES.ethereum.WETH, params: vault })
api.add(ADDRESSES.ethereum.WETH, vaultBalance)

// add native strategies
for(const nativeStrategy of nativeStrategies) {
const stakingBalance = await api.call({ abi: abi.checkBalance, target: nativeStrategy, params: ADDRESSES.ethereum.WETH })
api.add(ADDRESSES.ethereum.WETH, stakingBalance)
}

// add ETH part of curve LP
// add ETH part of convex OETH/ETH LP
const convexStrategy = '0x1827F9eA98E0bf96550b2FC20F7233277FcD7E63'
const lp = await api.call({ abi: 'address:curvePool', target: convexStrategy})
const ethIndex = await api.call({ abi: 'uint128:ethCoinIndex', target: convexStrategy})
const lpBalance = await api.call({ abi: abi.checkBalance, target: convexStrategy, params: ADDRESSES.ethereum.WETH})
const lpSupply = await api.call({ abi: 'erc20:totalSupply', target: lp})
const ethInPool = await api.call({ abi: 'function balances(uint256) view returns (uint256)', target: lp, params: ethIndex})
const ethLPBalance = (lpBalance / lpSupply) * ethInPool
api.add(ADDRESSES.ethereum.WETH, ethLPBalance)
const convexLp = await api.call({ abi: 'address:curvePool', target: convexStrategy})
const convexEthIndex = await api.call({ abi: 'uint128:ethCoinIndex', target: convexStrategy})
const convexLpBalance = await api.call({ abi: abi.checkBalance, target: convexStrategy, params: ADDRESSES.ethereum.WETH})
const convexLpSupply = await api.call({ abi: 'erc20:totalSupply', target: convexLp})
const convexEthInPool = await api.call({ abi: 'function balances(uint256) view returns (uint256)', target: convexLp, params: convexEthIndex})
const convexEthLPBalance = (convexLpBalance / convexLpSupply) * convexEthInPool
api.add(ADDRESSES.ethereum.WETH, convexEthLPBalance)

// add ETH part of curve OETH/WETH LP
const curveStrategy = '0xba0e352AB5c13861C26e4E773e7a833C3A223FE6'
const curveLp = await api.call({ abi: 'address:curvePool', target: curveStrategy})
const curveEthIndex = await api.call({ abi: 'uint128:hardAssetCoinIndex', target: curveStrategy})
const curveLpBalance = await api.call({ abi: abi.checkBalance, target: curveStrategy, params: ADDRESSES.ethereum.WETH})
const curveLpSupply = await api.call({ abi: 'erc20:totalSupply', target: curveLp})
const curveEthInPool = await api.call({ abi: 'function balances(uint256) view returns (uint256)', target: curveLp, params: curveEthIndex})
const curveEthLPBalance = (curveLpBalance / curveLpSupply) * curveEthInPool
api.add(ADDRESSES.ethereum.WETH, curveEthLPBalance)

return api.sumTokens({ owner: vault, tokens: [ADDRESSES.ethereum.WETH] })
}

async function baseTvl(api) {
const vault = '0x98a0CbeF61bD2D21435f433bE4CD42B56B38CC93'
const aeroAMO = '0xF611cC500eEE7E4e4763A05FE623E2363c86d2Af'
const dripper = await api.call({ target: vault, abi: 'function dripper() view returns (address)' })

// vault balance
const vaultBalance = await api.call({ abi: 'erc20:balanceOf', target: ADDRESSES.base.WETH, params: vault })
api.add(ADDRESSES.base.WETH, vaultBalance)

// add aero AMO
const [amountWeth, _amountOETH] = await api.call({ abi: 'function getPositionPrincipal() view returns (uint256, uint256)', target: aeroAMO })
api.add(ADDRESSES.base.WETH, amountWeth)

return api.sumTokens({ owners: [vault], tokens: [ADDRESSES.base.WETH] })
}

async function plumeTvl(api) {
const vault = '0xc8c8F8bEA5631A8AF26440AF32a55002138cB76a'

const vaultBalance = await api.call({ abi: 'erc20:balanceOf', target: ADDRESSES.plume_mainnet.WETH, params: vault })
api.add(ADDRESSES.plume_mainnet.WETH, vaultBalance)

return api.sumTokens({ owners: [vault], tokens: [ADDRESSES.plume_mainnet.WETH] })
}


Expand All @@ -45,4 +73,7 @@ module.exports = {
base: {
tvl: baseTvl,
},
plume_mainnet: {
tvl: plumeTvl,
}
};
Loading