Skip to content

[cli] startup log does not declare read-only mode — operator watching Grafana dashboard cannot distinguish read-only from misconfiguration or scanner failure #262

@obchain

Description

@obchain

PR: #51 (feat/23-testnet-config)
File: crates/charon-cli/src/main.rs (run_listen startup info! block, line 82 and run_listen entry)
Refs #51

Problem

When running in read-only mode (flashloan and liquidator maps both empty), the startup info! log emits:

config loaded chains=1 protocols=1 flashloan_sources=0 liquidators=0 min_profit_usd=5

No explicit log line states the bot is in read-only mode. An operator watching the Grafana dashboard sees all liquidation-execution Prometheus counters at zero and cannot tell whether:

  • (a) There are genuinely no liquidatable positions, or
  • (b) The bot is in read-only mode and would not liquidate even if positions existed.

The charon_executor_opportunities_dropped_total counter (PR #50) never fires in read-only mode, making the dashboard silent on the liquidation path.

Impact

Operational confusion during testnet Grafana demo. Operators may incorrectly conclude the scanner or executor is broken when the bot is functioning correctly in intentional read-only mode.

Fix

  1. Add explicit log at run_listen entry point:
let read_only = config.flashloan.is_empty() || config.liquidator.is_empty();
if read_only {
    info!("running in READ-ONLY mode: block listener + scanner + metrics active, no liquidations will be submitted");
}
  1. Add a Prometheus gauge to the metrics (PR feat(metrics): Prometheus exporter + pipeline instrumentation #50 crate):
charon_run_mode 0   # 0 = read-only, 1 = live

Set to 0 at startup in read-only mode, 1 otherwise. Display on Grafana dashboard as a status indicator so demo observers immediately see the mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlayer:rustRust crates (core / scanner / protocols / executor / cli)priority:p2-polishNice-to-have / polishstatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions