API & Metrics

A minimal FastAPI service surfaces health and Prometheus metrics.

Endpoints

  • GET /healthz — liveness check; returns 200 OK if server is up.

  • GET /metrics — Prometheus exposition with counters/gauges:

    • eonflow_trades_total{{chain,type}}

    • eonflow_open_positions{{chain}}

    • eonflow_gas_spent_wei{{chain}}

    • eonflow_bot_status (1 running / 0 stopped)

  • GET /info — static capabilities JSON (version, chains, features).

Running

python -m eonflow.api.server

Integrate with Grafana for alerting on non‑zero error rates or dropped WS connections.