File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
- const ADDRESSES = require ( '../helper/coreAssets.json' )
2
1
const { cachedGraphQuery } = require ( '../helper/cache' )
3
2
4
3
module . exports = {
@@ -8,15 +7,24 @@ module.exports = {
8
7
}
9
8
10
9
async function tvl ( api ) {
11
- let { tokens } = await cachedGraphQuery ( 'jellyverse' , 'https://graph.mainnet.jellyverse.org/subgraphs/name/jelly/verse' , `{
12
- tokens {
13
- address
14
- symbol
15
- pool { id }
10
+ let { balancers } = await cachedGraphQuery ( 'jellyverse' , 'https://graph.mainnet.jellyverse.org/subgraphs/name/jelly/verse' , `{
11
+ balancers {
12
+ pools {
13
+ address
14
+ tokens {
15
+ symbol
16
+ address
17
+ }
18
+ }
16
19
}
17
20
}` )
18
21
const vault = "0xFB43069f6d0473B85686a85F4Ce4Fc1FD8F00875"
19
- tokens = tokens . filter ( t => ! t . pool ) . map ( t => t . address )
20
- tokens . push ( ADDRESSES . sei . WSEI )
21
- return api . sumTokens ( { owner : vault , tokens } )
22
+ const blacklistedTokens = [ ]
23
+ const tokens = balancers . map ( i => {
24
+ blacklistedTokens . push ( ...i . pools . map ( j => j . address ) )
25
+ return i . pools . map ( j => {
26
+ return j . tokens . map ( k => k . address )
27
+ } ) . flat ( )
28
+ } ) . flat ( )
29
+ return api . sumTokens ( { owner : vault , tokens, blacklistedTokens, } )
22
30
}
You can’t perform that action at this time.
0 commit comments