Skip to content

Commit

Permalink
Feat: Zoth zeusd (#13035)
Browse files Browse the repository at this point in the history
Co-authored-by: Paras Jain <paras@zoth.io>
  • Loading branch information
0xpeluche and shinchann221 authored Jan 13, 2025
1 parent f247e11 commit af5345e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/zoth-zeusd/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const router = '0x2f52C3664Ff2b12A1A8Bc7B6020C7E92DBa781aE'
const ZTLN = '0xfEd3D6557Dc46A1B25d0A6F666513Cb33835864B'

const abi = {
getAllSubVaults: 'function getAllSubVaults() view returns (address[] collaterals, (string integrationType, address collateralAddress, address subVaultAddress, uint256 price, uint256 ltv, bool isActive, uint256 registeredAt, uint256 lastUpdatedAt, uint8 tokenType)[] details)'
}

const tvl = async (api) => {
const activeVaults = await api.call({ target: router, abi: abi.getAllSubVaults })

const tokensAndOwners = activeVaults.details.map((vault) => {
const { collateralAddress, subVaultAddress} = vault
return [collateralAddress, subVaultAddress]
})

return api.sumTokens({ tokensAndOwners, blacklistedTokens: [ZTLN] })
}

module.exports = {
ethereum: { tvl }
}

0 comments on commit af5345e

Please sign in to comment.