Skip to content

Commit 0194217

Browse files
committed
feat: add ignore accounts option
1 parent 3d1ac97 commit 0194217

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/config/schema.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ export const ConfigSchema = z.object({
113113
description: "Port to expose some vital signals and metrics",
114114
env: "PORT",
115115
}),
116+
/**
117+
* These accounts will not be liquidated
118+
*/
119+
ignoreAccounts: optionalAddressArrayLike().register(zommandRegistry, {
120+
flags: "--ignore-accounts <addresses...>",
121+
description: "These accounts will not be liquidated",
122+
env: "IGNORE_ACCOUNTS",
123+
}),
116124
/**
117125
* Only check this account during local debug session
118126
*/

src/services/Scanner.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ export class Scanner {
131131
`filtered out ${before - accounts.length} restaking accounts`,
132132
);
133133
}
134+
if (this.config.ignoreAccounts) {
135+
const before = accounts.length;
136+
const ignoreAccounts = new Set(
137+
this.config.ignoreAccounts?.map(a => a.toLowerCase()),
138+
);
139+
accounts = accounts.filter(
140+
ca => !ignoreAccounts.has(ca.creditAccount.toLowerCase()),
141+
);
142+
this.log.debug(
143+
`filtered out ${before - accounts.length} ignored accounts`,
144+
);
145+
}
134146
const time = Math.round((Date.now() - start) / 1000);
135147
this.log.debug(
136148
`${accounts.length} accounts to liquidate${blockS}, time: ${time}s`,

0 commit comments

Comments
 (0)