Context
Per-block, the scanner recomputes health factors and bucket-sorts positions. Healthy positions can be sampled less often; near-liquidation positions need pre-computed transactions ready to fire; liquidatable positions trigger the executor pipeline. DashMap gives us lock-free concurrent writes across protocol/chain tasks.
Scope
charon-scanner/src/scanner.rs with a HealthScanner struct
- Three
DashMap<Address, Position> buckets: healthy, near-liquidation, liquidatable
- Configurable thresholds in
[bot] section (e.g. liquidatable_threshold = 1.0, near_liquidation_threshold = 1.05)
- Runs on every
newHead from the block listener
- Emits a per-block log line with counts per bucket
- Pushes liquidatable positions into a channel for the executor
Acceptance criteria
References
- PRD section 4c (Health Factor Scanner)
Context
Per-block, the scanner recomputes health factors and bucket-sorts positions. Healthy positions can be sampled less often; near-liquidation positions need pre-computed transactions ready to fire; liquidatable positions trigger the executor pipeline.
DashMapgives us lock-free concurrent writes across protocol/chain tasks.Scope
charon-scanner/src/scanner.rswith aHealthScannerstructDashMap<Address, Position>buckets: healthy, near-liquidation, liquidatable[bot]section (e.g.liquidatable_threshold = 1.0,near_liquidation_threshold = 1.05)newHeadfrom the block listenerAcceptance criteria
dashmapadded to workspace dependencies andcharon-scannerINFO scanner: block=N healthy=X near_liq=Y liquidatable=ZDashMapused in place ofMutex<HashMap>References