Skip to content

Commit 24abc95

Browse files
authored
Add Brunch (DefiLlama#14262)
1 parent bfc758e commit 24abc95

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

projects/brunch/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const { sumTokens2 } = require("../helper/unwrapLPs");
2+
3+
module.exports = {
4+
methodology:
5+
"TVL counts the collateral tokens that are deposited within the respective Brunch vault",
6+
};
7+
8+
const config = {
9+
sonic: {
10+
vaultFactory: "0x486265E7BAedFF677aec98f7769Cf737657E009a",
11+
},
12+
};
13+
14+
Object.keys(config).forEach((chain) => {
15+
const { vaultFactory } = config[chain];
16+
module.exports[chain] = {
17+
tvl: async (api) => {
18+
const vaults = await api.fetchList({ lengthAbi: 'allVaultsLength', itemAbi: 'allVaults', target: vaultFactory })
19+
const tokens = await api.multiCall({ abi: 'address:collateralToken', calls: vaults })
20+
return sumTokens2({ tokensAndOwners2: [tokens, vaults], api })
21+
}
22+
}
23+
})

0 commit comments

Comments
 (0)