Skip to content

Commit 719452c

Browse files
add zarban treasury (DefiLlama#13252)
Co-authored-by: g1nt0ki <[email protected]>
1 parent e8213f7 commit 719452c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

projects/treasury/zarban.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const ADDRESSES = require('../helper/coreAssets.json')
2+
const { sumTokens } = require("../helper/sumTokens");
3+
4+
const abi = {
5+
"sin": "function sin(address) view returns (uint256)",
6+
"zar": "function zar(address) view returns (uint256)",
7+
}
8+
const vatAddress = "0x975Eb113D580c44aa5676370E2CdF8f56bf3F99F" // Scs vat contract
9+
const vowAddress = "0x10e6593cdda8c58a1d0f14c5164b376352a55f2f" // Scs vow contract
10+
const ZAR = "0xd946188A614A0d9d0685a60F541bba1e8CC421ae" // ZAR token address
11+
12+
const tvlConfig = {
13+
permitFailure: true,
14+
tokens: [
15+
ADDRESSES.arbitrum.ARB, // ARB
16+
ZAR, // ZAR
17+
'0x1b0aB2827C4d25B3387C1D1bc9c076Fe0c7EdFb9', // zZar
18+
ADDRESSES.arbitrum.DAI, // DAI
19+
'0xbb027125E073ad4D500a89889bC0C93abb63B710', // zDai
20+
ADDRESSES.arbitrum.WBTC, // WBTC
21+
'0x76806eA64f2609C7B2B2C638dA1fa66237fB1073', // zWbtc
22+
ADDRESSES.arbitrum.WETH, // WETH
23+
'0xd22c4E46a3E10eF6f1CD0cDABf68e292966229f7', // zWETH
24+
],
25+
owners: ["0xed42d47538f6bf191533a9943ceedc13b261809d"], // liquidity market's collector,
26+
}
27+
28+
async function treasuryTvl(timestamp, block, chainBlocks, { api }) {
29+
30+
// liquidity market treasury
31+
const balances = await sumTokens({ ...api, api, ...tvlConfig }) || {}
32+
33+
// stablecoin system treasury
34+
const zarBalance = await api.call({ abi: abi.zar, params: [vowAddress], target: vatAddress })
35+
const sinBalance = await api.call({ abi: abi.sin, params: [vowAddress], target: vatAddress })
36+
balances[ZAR] = Number(balances[ZAR]||0) + ((zarBalance - sinBalance) / 1e27)
37+
38+
return balances
39+
}
40+
41+
module.exports = {
42+
arbitrum: { tvl: treasuryTvl }
43+
}

0 commit comments

Comments
 (0)