Skip to content

Commit a406249

Browse files
authored
feat: TaoFi uni v3 pool's TVL adapter (#16814)
1 parent b8ef87a commit a406249

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

projects/helper/chains.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"bitkub",
4747
"bitrock",
4848
"bittensor",
49+
"bittensor_evm_mainnet",
4950
"bittorrent",
5051
"blast",
5152
"bob",

projects/taofi/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const USDC_TOKEN_CONTRACT = '0xB833E8137FEDf80de7E908dc6fea43a029142F20';
2+
const WTAO_TOKEN_CONTRACT = '0x9Dc08C6e2BF0F1eeD1E00670f80Df39145529F81';
3+
const POOL = '0x6647dcbeb030dc8E227D8B1A2Cb6A49F3C887E3c'
4+
5+
async function tvl(api) {
6+
const usdcBalance = await api.call({
7+
abi: 'erc20:balanceOf',
8+
target: USDC_TOKEN_CONTRACT,
9+
params: [POOL],
10+
});
11+
const wtaoBalance = await api.call({
12+
abi: 'erc20:balanceOf',
13+
target: WTAO_TOKEN_CONTRACT,
14+
params: [POOL],
15+
});
16+
17+
api.add(USDC_TOKEN_CONTRACT, usdcBalance)
18+
api.add(WTAO_TOKEN_CONTRACT, wtaoBalance)
19+
}
20+
21+
module.exports = {
22+
methodology: 'counts the number of USDC/sTAO tokens of the uni v3 pool.',
23+
bittensor_evm_mainnet: {
24+
tvl,
25+
}
26+
};

0 commit comments

Comments
 (0)