Skip to content

Commit

Permalink
Add SizeCredit (#11013)
Browse files Browse the repository at this point in the history
* Add SizeCredit

* code refactor

---------

Co-authored-by: g1nt0ki <[email protected]>
  • Loading branch information
aviggiano and g1nt0ki authored Jul 19, 2024
1 parent 2e60b7e commit 8eec7d5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions projects/size-credit/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { sumTokensExport } = require('../helper/unwrapLPs')
const ADDRESSES = require('../helper/coreAssets.json')

const AUSDC_CONTRACT = '0x4e65fe4dba92790696d040ac24aa414708f5c0ab'
const SZDEBT_CONTRACT = '0xb0a00c4b3d77c896f46dc6b204695e22de7a185d'
const SIZE_PROXY_CONTRACT = '0xC2a429681CAd7C1ce36442fbf7A4a68B11eFF940'
const tokens = [
ADDRESSES.base.WETH,
AUSDC_CONTRACT,
]

async function borrowed(api) {
const totalDebt = await api.call({ abi: 'erc20:totalSupply', target: SZDEBT_CONTRACT, });

return api.add(ADDRESSES.base.USDbC, totalDebt)
}

module.exports = {
base: {
tvl: sumTokensExport({ tokens, owner: SIZE_PROXY_CONTRACT }),
borrowed
}
}

0 comments on commit 8eec7d5

Please sign in to comment.