File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type {
33 CreditAccountsService ,
44 NetworkType ,
55} from "@gearbox-protocol/sdk" ;
6- import { PERCENTAGE_FACTOR } from "@gearbox-protocol/sdk" ;
6+ import { MAX_UINT16 , PERCENTAGE_FACTOR } from "@gearbox-protocol/sdk" ;
77import { iCreditManagerV3Abi } from "@gearbox-protocol/types/abi" ;
88import type { Address , Block } from "viem" ;
99import { getContract } from "viem" ;
@@ -102,10 +102,14 @@ export class Scanner {
102102 ) ;
103103 accounts = acc ? [ acc ] : [ ] ;
104104 } else {
105+ let maxHealthFactor = Number ( this . config . hfThreshold ) ;
106+ if ( this . config . optimistic && this . config . isPartial ) {
107+ maxHealthFactor = Number ( MAX_UINT16 ) ;
108+ }
105109 accounts = await this . caService . getCreditAccounts (
106110 {
107111 minHealthFactor : 0 ,
108- maxHealthFactor : Number ( this . config . hfThreshold ) ,
112+ maxHealthFactor,
109113 includeZeroDebt : false ,
110114 creditManager : this . config . debugManager ,
111115 } ,
You can’t perform that action at this time.
0 commit comments