Skip to content

Commit

Permalink
feat: suzaku adapter (#11787)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloetjo authored Sep 30, 2024
1 parent de9e0c1 commit bd7be24
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions projects/suzaku/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { getLogs2 } = require('../helper/cache/getLogs')

async function tvl(api) {
const logs = await getLogs2({ api, factory: '0xE5296638Aa86BD4175d802A210E158688e41A93c', eventAbi: 'event AddEntity(address indexed entity)', fromBlock: 20011312, })
const COLLATERALS = logs.map(log => log.entity)
const tokens = await api.multiCall({ abi: 'address:asset', calls: COLLATERALS, })
return api.sumTokens({ tokensAndOwners2: [tokens, COLLATERALS] })
}

module.exports = {
start: 1727654400,
avax: {
tvl,
},
}

0 comments on commit bd7be24

Please sign in to comment.