File tree Expand file tree Collapse file tree 1 file changed +7
-33
lines changed
Expand file tree Collapse file tree 1 file changed +7
-33
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,13 @@ class DataFetcher {
186186 {id_gt: "${ lastId } "},
187187 ${ onlyNegativeNetFlowrate ? '{totalNetFlowRate_lt: 0,},' : '' }
188188 {token: "${ _tokenLowerCase } "},
189- {or: [{maybeCriticalAtTimestamp_lt: "${ timestamp } "}, {balanceUntilUpdatedAt_lt: "0"}]}
189+ {or: [
190+ {maybeCriticalAtTimestamp_lt: "${ timestamp } "},
191+ {and: [
192+ {balanceUntilUpdatedAt_lte: "0"},
193+ {activeOutgoingStreamCount_gt: 0}
194+ ]}
195+ ]}
190196 ]
191197 }
192198 ) {
@@ -207,38 +213,6 @@ class DataFetcher {
207213 ) ;
208214 }
209215
210- /**
211- * Fetches critical accounts at a specific timestamp.
212- * @param timestamp - The timestamp to fetch critical accounts at.
213- * @returns A promise that resolves to an array of critical accounts.
214- */
215- async getCriticalAccountsAt ( timestamp : number ) : Promise < CriticalAccount [ ] > {
216- return this . _queryAllPages (
217- ( lastId : string ) => `{
218- accountTokenSnapshots (first: ${ MAX_ITEMS } ,
219- where: {
220- and: [
221- {id_gt: "${ lastId } "},
222- {or: [{maybeCriticalAtTimestamp_lt: "${ timestamp } "}, {balanceUntilUpdatedAt_lt: "0"}]}
223- ]
224- }
225- ){
226- id
227- totalNetFlowRate
228- totalCFANetFlowRate
229- token {
230- id
231- symbol
232- }
233- account {
234- id
235- }
236- }
237- }` ,
238- res => res . data . data . accountTokenSnapshots ,
239- i => i
240- ) ;
241- }
242216 /**
243217 * Fetches all super tokens.
244218 * @param isListed - Whether to fetch listed tokens or not.
You can’t perform that action at this time.
0 commit comments