forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: suzaku adapter (DefiLlama#11787)
- Loading branch information
1 parent
7366200
commit 3a9fe92
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
} |