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

Lazyotter: add rho markets vault tvl calculation #11642

Merged
merged 13 commits into from
Sep 16, 2024
12 changes: 11 additions & 1 deletion projects/lazyotter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ const aaveVaults = ["0xF91caE959D134065f39DDaa41d66E254dfaFc6f8", "0x81A47E298d6
const ambientVaultHelper = "0x9b5BD88893d73d114d252Cff7CFd4f2705eEFAe7"
const ambientVaults = ["0x07ab0C3A3D9e286ba790FF57f205970bC462BB21", "0x018B3ac371344735025cB01d79871Be0e4AB351C", "0x7D1E707011bA5be76806037532c266fA6eb0699f", "0xe18acadfb098fbf4017108a5C83Fa901B062a53d", "0xfbB0D0cB3324Ec90c6667D9E2b8B98dB8F73a3e6"]

// [USDC, USDT, wstETH, weETH, wrsETH, STONE]
const rhoMarketsVault = [
"0x1BA2A898b5EfB716557696e3E42E6479882fCDE1",
"0x87131c9Bb4878067742dd5D60596ED3b353493FD",
"0xfAe6c6E62bc5374a229960891Ec9707e8671a219",
"0x74a28efb7275c3871aCCaE2917f6EE073039042d",
"0x4220F7297eBa7cE583826eC754A0CBE29E4e6F6f",
"0x235ea5d1EA9407334E0AF8F45BA6c9A69DF9AC18"
]

async function tvl(api) {
await api.erc4626Sum2({ calls: aaveVaults, });
await api.erc4626Sum2({ calls: aaveVaults.concat(rhoMarketsVault), });
const ambAssets = await api.multiCall({ abi: 'uint256:totalAssets', calls: ambientVaults})
const calls = ambAssets.map((v, i) => ({ params: [ambientVaults[i], v]}))
const res = await api.multiCall({ abi: 'function previewAmountByAsset(address vault, uint256 assets) view returns (uint256, uint256)', calls, target: ambientVaultHelper})
Expand Down
Loading