Skip to content

Commit 97f5236

Browse files
maxwengGeraldHost
andauthored
Add Support to Base (DefiLlama#12974)
Co-authored-by: Gerald <[email protected]>
1 parent f7cc477 commit 97f5236

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

projects/union-finance/index.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
21
const ADDRESSES = require('../helper/coreAssets.json');
32
const methodologies = require('../helper/methodologies');
43

54
const config = {
65
ethereum: {
76
userManager: "0x49c910Ba694789B58F53BFF80633f90B8631c195",
8-
DAI: ADDRESSES.ethereum.DAI,
9-
uDAI: "0x954F20DF58347b71bbC10c94827bE9EbC8706887",
7+
underlying: ADDRESSES.ethereum.DAI,
8+
uToken: "0x954F20DF58347b71bbC10c94827bE9EbC8706887",
109
},
1110
arbitrum: {
1211
userManager: "0xb71F3D4342AaE0b8D531E14D2CF2F45d6e458A5F",
13-
DAI: ADDRESSES.optimism.DAI,
14-
uDAI: "0x954F20DF58347b71bbC10c94827bE9EbC8706887",
12+
underlying: ADDRESSES.arbitrum.DAI,
13+
uToken: "0x954F20DF58347b71bbC10c94827bE9EbC8706887",
1514
},
1615
optimism: {
1716
userManager: "0x8E195D65b9932185Fcc76dB5144534e0f3597628",
18-
DAI: ADDRESSES.optimism.DAI,
19-
uDAI: "0xE478b5e7A423d7CDb224692d0a816CA146A744b2",
17+
underlying: ADDRESSES.optimism.DAI,
18+
uToken: "0xE478b5e7A423d7CDb224692d0a816CA146A744b2",
19+
},
20+
base: {
21+
userManager: "0xfd745A1e2A220C6aC327EC55d2Cb404CD939f56b",
22+
underlying: ADDRESSES.base.USDC,
23+
uToken: "0xc2447f36FfdA08E278D25D08Ea91D942f0C2d6ea",
2024
},
2125
};
2226

@@ -28,19 +32,20 @@ const abi = {
2832
};
2933

3034
async function tvl(api) {
31-
const { userManager, DAI, uDAI } = config[api.chain]
35+
const { userManager, underlying, uToken } = config[api.chain]
36+
console.log({ userManager, underlying, uToken })
3237
const bals = await api.batchCall([
3338
{ target: userManager, abi: abi.totalStaked },
34-
{ target: uDAI, abi: abi.totalRedeemable },
35-
{ target: uDAI, abi: abi.totalReserves },
39+
{ target: uToken, abi: abi.totalRedeemable },
40+
{ target: uToken, abi: abi.totalReserves },
3641
])
37-
bals.forEach(i => api.add(DAI, i))
42+
bals.forEach(i => api.add(underlying, i))
3843
}
3944

4045
async function borrowed(api) {
41-
const { DAI, uDAI } = config[api.chain]
42-
const borrows = await api.call({ target: uDAI, abi: abi.totalBorrows, })
43-
api.add(DAI, borrows)
46+
const { underlying, uToken } = config[api.chain]
47+
const borrows = await api.call({ target: uToken, abi: abi.totalBorrows, })
48+
api.add(underlying, borrows)
4449
}
4550

4651
module.exports = {

0 commit comments

Comments
 (0)