File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 1
- const { sumTokensExport } = require ( "../helper/chain/ton" ) ;
1
+ const { call } = require ( '../helper/chain/ton' )
2
+ const { sumTokens } = require ( "../helper/chain/ton" ) ;
2
3
const ADDRESSES = require ( "../helper/coreAssets.json" ) ;
3
4
4
- const tonpoolsContractAddress =
5
- "EQA7y9QkiP4xtX_BhOpY4xgVlLM7LPcYUA4QhBHhFZeL4fTa" ;
5
+ const tonpoolsContractAddress = "EQA7y9QkiP4xtX_BhOpY4xgVlLM7LPcYUA4QhBHhFZeL4fTa" ;
6
6
7
- const tonpoolUSDTContractAddress =
8
- "EQDrSz9W4tjwnqy1F4z-O4Vkdp8g2YP94cmh12X5RbYpejCw" ;
7
+ const tonpoolUSDTContractAddress = "EQDrSz9W4tjwnqy1F4z-O4Vkdp8g2YP94cmh12X5RbYpejCw" ;
8
+
9
+ async function tvl ( api ) {
10
+ const result = await call ( { target : tonpoolUSDTContractAddress , abi : 'poolBalances' } )
11
+ api . add ( ADDRESSES . ton . USDT , result [ 1 ] )
12
+ await sumTokens ( { api, owners : [ tonpoolsContractAddress ] , tokens : [ ADDRESSES . null ] , } )
13
+ }
9
14
10
15
module . exports = {
11
16
methodology : "Ton Pools's TVL includes all deposited supported assets" ,
12
17
ton : {
13
- tvl : sumTokensExport ( {
14
- owners : [ tonpoolsContractAddress , tonpoolUSDTContractAddress ] ,
15
- tokens : [ ADDRESSES . null ] ,
16
- } ) ,
18
+ tvl,
17
19
} ,
18
20
} ;
19
21
You can’t perform that action at this time.
0 commit comments