Skip to content

Commit 59b09c9

Browse files
g1nt0kithomgabriel
andauthored
Chainge (DefiLlama#12019)
Co-authored-by: thomga <[email protected]>
1 parent e5f9518 commit 59b09c9

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

projects/chainge.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1-
const utils = require('./helper/utils');
1+
const ADDRESSES = require('./helper/coreAssets.json')
2+
const { sumTokensExport } = require('./helper/unwrapLPs')
23

3-
// fusion
4-
async function fetch() {
5-
let tvl = await utils.fetchURL('https://info.chainge.finance/api/v1/info/getInfoOuterTvl')
6-
7-
return tvl.data.data.totalTvl
4+
const config = {
5+
rollux: {
6+
chaingeAddress: "0x66ff2f0AC3214758D1e61B16b41e3d5e62CAEcF1",
7+
tokens: [
8+
ADDRESSES.rollux.USDC,
9+
ADDRESSES.rollux.USDT,
10+
ADDRESSES.rollux.WBTC,
11+
ADDRESSES.rollux.WETH,
12+
ADDRESSES.rollux.WSYS,
13+
ADDRESSES.null, // for native SYS
14+
]
15+
}
816
}
917

1018
module.exports = {
11-
methodology: "assets in liquidity are counted as TVL",
12-
fetch
19+
methodology: "assets in liquidity are counted as TVL + balances of all tokens (USDC, USDT, WBTC, WETH, WSYS, and native SYS) held in the Chainge treasury address on the Rollux network. These tokens are used to provide liquidity for cross-chain swaps.",
1320
}
21+
22+
Object.keys(config).forEach(chain => {
23+
const { chaingeAddress, tokens } = config[chain]
24+
module.exports[chain] = {
25+
tvl: sumTokensExport({ owner: chaingeAddress, tokens })
26+
}
27+
})

projects/helper/coreAssets.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,13 @@
10391039
"ETH": "0x7c598c96d02398d89fbcb9d41eab3df0c16f227d",
10401040
"USDT": "0x922d641a426dcffaef11680e5358f34d97d112e1"
10411041
},
1042+
"rollux": {
1043+
"WSYS": "0x4200000000000000000000000000000000000006",
1044+
"USDC": "0x368433cac2a0b8d76e64681a9835502a1f2a8a30",
1045+
"WETH": "0xaa1c53afd099e415208f47fcfa2c880f659e6904",
1046+
"USDT": "0x28c9c7fb3fe3104d2116af26cc8ef7905547349c",
1047+
"WBTC": "0x2a4dc2e946b92ab4a1f7d62844eb237788f9056c"
1048+
},
10421049
"vision": {
10431050
"USDT": "0x1db6cdc620388a0b6046b20cd59503a0839adcff",
10441051
"VBTC": "0x4dE4B92C12dD4584873e72447573382C41da5597",
@@ -1949,4 +1956,4 @@
19491956
"bitkub": {
19501957
"KKUB": "0x67ebd850304c70d983b2d1b93ea79c7cd6c3f6b5"
19511958
}
1952-
}
1959+
}

projects/helper/tokenMapping.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ const fixBalancesTokens = {
8888
},
8989
rollux: {
9090
'0x570baA32dB74279a50491E88D712C957F4C9E409': { coingeckoId: 'uno-re', decimals: 18 },
91+
'0xaa1c53afd099e415208f47fcfa2c880f659e6904': { coingeckoId: 'weth', decimals: 18 },
92+
'0x2a4dc2e946b92ab4a1f7d62844eb237788f9056c': { coingeckoId: 'wrapped-bitcoin', decimals: 8 },
9193
},
9294
taiko: {
9395
'0xd347949f8c85d9f3d6b06bfc4f8c2e07c161f064': { coingeckoId: "loopring", decimals: 18 },

0 commit comments

Comments
 (0)