Skip to content

Commit

Permalink
Update Mozaic to include Theseus Vault relaunch (DefiLlama#11665)
Browse files Browse the repository at this point in the history
Co-authored-by: g1ntoki <[email protected]>
  • Loading branch information
twilkinson573 and g1nt0ki authored Sep 18, 2024
1 parent a398dbe commit 732f7ab
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions projects/mozaic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ const vaults = {
kava: "0x5712ab97A299a8A4544BCc728B7f3E9663965443",
}

const theseusVaults = {
arbitrum: { vault: '0x6D8E0Ac94fb79Cd3520f546ce1c23A6F27F16EaC', gmxPlugin: '0xD4497259a3535ae311AB0F6ad68Da43a676919Db' },
}

async function tvl(api) {
if (theseusVaults[api.chain]) {
const { vault, gmxPlugin } = theseusVaults[api.chain]
const tokens = await api.call({ abi: 'address[]:getAcceptedTokens', target: vault })
const gmxPoolAbi = "function getPools() view returns ((uint8 poolId, address indexToken, address longToken, address shortToken, address marketToken)[])"
const gmxTokens = await api.call({ abi: gmxPoolAbi, target: gmxPlugin })
const ownerTokens = [[tokens, vault], [gmxTokens.map(t => t.marketToken), gmxPlugin]]
await api.sumTokens({ ownerTokens })
}


const vault = vaults[api.chain];
const tokens = await api.call({ abi: 'function getAcceptingTokens () view returns (address[])', target: vault, });
const bals = await api.multiCall({ abi: 'function getStakedAmountPerToken(address token) view returns (uint256)', calls: tokens, target: vault })
Expand Down

0 comments on commit 732f7ab

Please sign in to comment.