Skip to content

Commit 62d6480

Browse files
authored
Update: BUIDL (DefiLlama#13044)
1 parent f275e70 commit 62d6480

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

projects/securitize/index.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
const ADDRESSES = require('../helper/coreAssets.json')
1+
const CONFIG = {
2+
ethereum: [
3+
'0x7712c34205737192402172409a8f7ccef8aa2aec', // BUIDL
4+
'0x6a9DA2D710BB9B700acde7Cb81F10F1fF8C89041' // BUIDL-I
5+
],
6+
polygon: ['0x2893ef551b6dd69f661ac00f11d93e5dc5dc0e99'], // BUIDL
7+
avax: ['0x53fc82f14f009009b440a706e31c9021e1196a2f'], // BUIDL
8+
optimism: ['0xa1cdab15bba75a80df4089cafba013e376957cf5'], // BUIDL
9+
arbitrum: ['0xa6525ae43edcd03dc08e775774dcabd3bb925872'], // BUIDL
10+
}
11+
12+
const tvl = async (api) => {
13+
const tokens = CONFIG[api.chain]
14+
const supplies = await api.multiCall({ calls: tokens, abi: 'erc20:totalSupply' })
215

3-
const BUIDL = {
4-
ethereum: '0x7712c34205737192402172409a8f7ccef8aa2aec',
5-
polygon: '0x2893ef551b6dd69f661ac00f11d93e5dc5dc0e99',
6-
avax: '0x53fc82f14f009009b440a706e31c9021e1196a2f',
7-
optimism: '0xa1cdab15bba75a80df4089cafba013e376957cf5',
8-
arbitrum: '0xa6525ae43edcd03dc08e775774dcabd3bb925872',
16+
supplies.forEach((supply) => {
17+
api.addUSDValue(supply / 1e6)
18+
})
919
}
1020

11-
Object.keys(BUIDL).forEach((chain) => {
12-
module.exports[chain] = { tvl: async (api) => { api.add(ADDRESSES.ethereum.USDC, await api.call({ target: BUIDL[chain], abi: 'erc20:totalSupply' }), { skipChain: true }) } }
13-
})
21+
Object.keys(CONFIG).forEach((chain) => {
22+
module.exports[chain] = { tvl }
23+
})

0 commit comments

Comments
 (0)