Skip to content

Commit 7cae2d1

Browse files
committed
fix jellyverse
1 parent 5d26773 commit 7cae2d1

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

projects/jellyverse/index.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const ADDRESSES = require('../helper/coreAssets.json')
21
const { cachedGraphQuery } = require('../helper/cache')
32

43
module.exports = {
@@ -8,15 +7,24 @@ module.exports = {
87
}
98

109
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+
}
1619
}
1720
}`)
1821
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, })
2230
}

0 commit comments

Comments
 (0)