Skip to content

Commit 77f6502

Browse files
0xMarkussWayneAl
authored andcommitted
feat: add xAssets protocol (DefiLlama#14503)
1 parent fac8f0c commit 77f6502

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

projects/xAssets/index.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
const ADDRESSES = require('../helper/coreAssets.json')
2+
const sdk = require('@defillama/sdk');
3+
const { sumTokens2 } = require('../helper/unwrapLPs');
4+
5+
const CONTRACT_ADDRESS = '0x10baa5c14ebde8681e83b2503682b3f45b8dc4c2';
6+
7+
const TOKENS = {
8+
WXFI: {
9+
address: ADDRESSES.crossfi.WXFI,
10+
decimals: 18
11+
},
12+
WETH: {
13+
address: '0xa084d905e3F35C6B86B5E672C2e72b0472ddA1e3',
14+
decimals: 18
15+
},
16+
USDC: {
17+
address: '0x7bBcE15166bBc008EC1aDF9b3D6bbA0602FCE7Ba',
18+
decimals: 6
19+
},
20+
USDT: {
21+
address: '0x38E88b1ed92065eD20241A257ef3713A131C9155',
22+
decimals: 6
23+
},
24+
WBTC: {
25+
address: '0x417c85B9D0826501d7399FEeF417656774d333cc',
26+
decimals: 8
27+
}
28+
};
29+
30+
async function tvl(timestamp, block, chainBlocks) {
31+
const balances = await sumTokens2({
32+
chain: 'crossfi',
33+
block: chainBlocks['crossfi'],
34+
owner: CONTRACT_ADDRESS,
35+
tokens: Object.values(TOKENS).map(token => token.address),
36+
resolveLP: false,
37+
failOnError: false,
38+
});
39+
40+
return balances;
41+
}
42+
43+
module.exports = {
44+
methodology: `Measures the total value locked (TVL) in the xAssets Real World Assets (RWA) protocol on CrossFi chain.
45+
TVL is calculated by summing the balances of:
46+
- WXFI (Wrapped XFI)
47+
- WETH (Wrapped ETH)
48+
- USDC
49+
- USDT
50+
- WBTC
51+
52+
that are held by the main xAssets contract at ${CONTRACT_ADDRESS}.
53+
54+
The protocol holds liquidity in multiple tokens to back real-world assets tokenized on the CrossFi chain.`,
55+
crossfi: {
56+
tvl,
57+
},
58+
timetravel: false,
59+
misrepresentedTokens: false,
60+
};

0 commit comments

Comments
 (0)