@@ -81,11 +81,11 @@ const config = {
81
81
fromBlock: 3669141,
82
82
},
83
83
*/
84
- basecamp :{
85
- morphoBlue : "0xc7CAd9B1377Eb8103397Cb07Cb5c4f03eb2eBEa8" ,
86
- fromBlock : 4804080 ,
87
- blackList : [ '0x68d6024e5168f16d3453a23b36f393a559be7aef' ] ,
88
- } ,
84
+ // basecamp:{
85
+ // morphoBlue: "0xc7CAd9B1377Eb8103397Cb07Cb5c4f03eb2eBEa8",
86
+ // fromBlock: 4804080,
87
+ // blackList: ['0x68d6024e5168f16d3453a23b36f393a559be7aef'],
88
+ // },
89
89
hyperliquid :{
90
90
morphoBlue : "0x68e37dE8d93d3496ae143F2E900490f6280C57cD" ,
91
91
fromBlock : 1988429 ,
@@ -118,13 +118,25 @@ Object.keys(config).forEach((chain) => {
118
118
const lowerCaseBlacklist = blacklistedMarketIds . map ( id => id . toLowerCase ( ) ) ;
119
119
marketIds = marketIds . filter ( id => ! lowerCaseBlacklist . includes ( id . toLowerCase ( ) ) ) ;
120
120
}
121
- const tokens = (
122
- await api . multiCall ( {
123
- target : morphoBlue ,
124
- calls : marketIds ,
125
- abi : abi . morphoBlueFunctions . idToMarketParams ,
126
- } )
127
- )
121
+ const marketInfo = await api . multiCall ( {
122
+ target : morphoBlue ,
123
+ calls : marketIds ,
124
+ abi : abi . morphoBlueFunctions . idToMarketParams ,
125
+ } ) ;
126
+
127
+ // Filter out MetaMorpho vaults using multiCall
128
+ const withdrawQueueLengths = await api . multiCall ( {
129
+ calls : marketInfo . map ( m => m . collateralToken ) ,
130
+ abi : abi . metaMorphoFunctions . withdrawQueueLength ,
131
+ permitFailure : true ,
132
+ } ) ;
133
+
134
+ const filteredMarketInfo = marketInfo . filter ( ( _ , i ) => {
135
+ const length = withdrawQueueLengths [ i ] ;
136
+ return length === null || length > 30 || length < 0 ;
137
+ } ) ;
138
+
139
+ const tokens = filteredMarketInfo
128
140
. map ( ( i ) => [ i . collateralToken , i . loanToken ] )
129
141
. flat ( ) ;
130
142
0 commit comments