Skip to content

Commit 08ee93b

Browse files
committed
fix: alert on zero hf situation
1 parent 266cf45 commit 08ee93b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/services/Scanner.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { type ILogger, Logger } from "../log/index.js";
2727
import type MulticallSpy from "../MulticallSpy.js";
2828
import type Client from "./Client.js";
2929
import type { ILiquidatorService } from "./liquidate/index.js";
30+
import type { INotifier } from "./notifier/index.js";
3031

3132
const RESTAKING_CMS: Partial<Record<NetworkType, Address>> = {
3233
Mainnet:
@@ -383,6 +384,9 @@ class ScannerDiagnoster {
383384
@DI.Inject(DI.CreditAccountService)
384385
caService!: ICreditAccountsService;
385386

387+
@DI.Inject(DI.Notifier)
388+
notifier!: INotifier;
389+
386390
#drpc?: WorkaroundCAS;
387391
#alchemy?: WorkaroundCAS;
388392

@@ -452,6 +456,10 @@ class ScannerDiagnoster {
452456
this.log.debug(
453457
`found ${alchemyAccs.length} liquidatable accounts (${alchemySuccess} successful, ${alchemyZeroHF} zero HF) in block ${blockNumber} with alchemy`,
454458
);
459+
this.notifier.alert({
460+
plain: `Found ${numZeroHF} zero HF accounts in block ${blockNumber}, second pass ${dprcZeroHF} drpc, ${alchemyZeroHF} alchemy`,
461+
markdown: `Found ${numZeroHF} zero HF accounts in block ${blockNumber}, second pass ${dprcZeroHF} drpc, ${alchemyZeroHF} alchemy`,
462+
});
455463
return alchemyZeroHF < dprcZeroHF ? alchemyAccs : drpcAccs;
456464
} catch (e) {
457465
this.log.error(e);

0 commit comments

Comments
 (0)