Skip to content

Commit 8eec7d5

Browse files
aviggianog1nt0ki
andauthored
Add SizeCredit (DefiLlama#11013)
* Add SizeCredit * code refactor --------- Co-authored-by: g1nt0ki <[email protected]>
1 parent 2e60b7e commit 8eec7d5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

projects/size-credit/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const { sumTokensExport } = require('../helper/unwrapLPs')
2+
const ADDRESSES = require('../helper/coreAssets.json')
3+
4+
const AUSDC_CONTRACT = '0x4e65fe4dba92790696d040ac24aa414708f5c0ab'
5+
const SZDEBT_CONTRACT = '0xb0a00c4b3d77c896f46dc6b204695e22de7a185d'
6+
const SIZE_PROXY_CONTRACT = '0xC2a429681CAd7C1ce36442fbf7A4a68B11eFF940'
7+
const tokens = [
8+
ADDRESSES.base.WETH,
9+
AUSDC_CONTRACT,
10+
]
11+
12+
async function borrowed(api) {
13+
const totalDebt = await api.call({ abi: 'erc20:totalSupply', target: SZDEBT_CONTRACT, });
14+
15+
return api.add(ADDRESSES.base.USDbC, totalDebt)
16+
}
17+
18+
module.exports = {
19+
base: {
20+
tvl: sumTokensExport({ tokens, owner: SIZE_PROXY_CONTRACT }),
21+
borrowed
22+
}
23+
}

0 commit comments

Comments
 (0)