Skip to content

Commit

Permalink
update StakeStone Berachain Vault (#13005)
Browse files Browse the repository at this point in the history
Co-authored-by: g1nt0ki <[email protected]>
  • Loading branch information
stakestone-scdev and g1nt0ki authored Jan 8, 2025
1 parent dbcc218 commit a88f5c1
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions projects/stakestone-berastone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ const vaultABI = {
"assetsBorrowed": "function assetsBorrowed() external view returns (uint256)"
}

const Vault = '0x8f88aE3798E8fF3D0e0DE7465A0863C9bbB577f0';
const ETHVault = '0x8f88aE3798E8fF3D0e0DE7465A0863C9bbB577f0';
const BTCVault = '0xf401Cc9f467c7046796D9A8b44b0c1348b4DEec7';

const Tvl = async (api) => {
const usedTVL = await api.call({ abi: vaultABI.assetsBorrowed, target: Vault })
api.add(ADDRESSES.ethereum.WETH, usedTVL);
const tvl = async (api) => {
// to include assets moved to boyco vault
const usedTVL = await api.call({ abi: vaultABI.assetsBorrowed, target: ETHVault })
api.add(ADDRESSES.ethereum.STONE, usedTVL);

const underlyings = await api.call({ abi: vaultABI.getUnderlyings, target: Vault })
return api.sumTokens({ owner: Vault, tokens: underlyings })
const vaults = [ETHVault, BTCVault];
const tokens = await api.multiCall({ abi: vaultABI.getUnderlyings, calls: vaults})
return api.sumTokens({ ownerTokens: tokens.map((t, i) => [t, vaults[i]]) })
}

module.exports = {
doublecounted: true,
ethereum: {
tvl: Tvl,
tvl,
}
}
}

0 comments on commit a88f5c1

Please sign in to comment.