@@ -4,6 +4,11 @@ const { compoundExports2 } = require('../helper/compound')
4
4
const config = {
5
5
bsc : {
6
6
endpoint : 'https://api.thegraph.com/subgraphs/name/venusprotocol/venus-isolated-pools' ,
7
+ corePools : [ '0xfd36e2c2a6789db23113685031d7f16329158384' ] ,
8
+ } ,
9
+ ethereum : {
10
+ endpoint : 'https://api.thegraph.com/subgraphs/name/venusprotocol/venus-isolated-pools-ethereum' ,
11
+ corePools : [ '0x67aA3eCc5831a65A5Ba7be76BED3B5dc7DB60796' ] ,
7
12
}
8
13
}
9
14
@@ -12,9 +17,10 @@ Object.keys(config).forEach(chain => {
12
17
} )
13
18
14
19
async function getPools ( api ) {
15
- const { endpoint } = config [ api . chain ]
16
- const { pools } = await cachedGraphQuery ( 'venus-v4' , endpoint , `{ pools { id }}` )
17
- return pools . map ( i => i . id )
20
+ const { endpoint, corePools } = config [ api . chain ]
21
+ const poolSet = new Set ( corePools . map ( i => i . toLowerCase ( ) ) )
22
+ const { pools } = await cachedGraphQuery ( 'venus-v4/' + api . chain , endpoint , `{ pools { id }}` )
23
+ return pools . map ( i => i . id ) . filter ( i => ! poolSet . has ( i . toLowerCase ( ) ) )
18
24
}
19
25
20
26
async function tvl ( ...args ) {
@@ -29,4 +35,4 @@ async function borrowed(...args) {
29
35
const pools = await getPools ( api )
30
36
const tvls = pools . map ( i => compoundExports2 ( { comptroller : i , fetchBalances : true , } ) )
31
37
return sdk . util . sumChainTvls ( tvls . map ( i => i . borrowed ) ) ( ...args )
32
- }
38
+ }
0 commit comments