The Mission Control dashboard is a read-only Flask application that gives you a live view of your trading engine’s state — equity, realized P&L, drawdown, open exposure, signals, and the execution ledger — all served directly from theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/deniszidbaev-cmyk/polyclaw-trading/llms.txt
Use this file to discover all available pages before exploring further.
runtime/*.json files that the pipeline stages write. It never reads .env.local, never touches wallet keys or OpenClaw configuration, and never invokes any trading command.
Starting the dashboard
Default binding: loopback only
By default, the dashboard binds to127.0.0.1:8080. This means it is only reachable from the same machine. Requests from any other host are refused at the network level.
Configuration
| Variable | Default | Description |
|---|---|---|
DASHBOARD_HOST | 127.0.0.1 | Bind host. Non-loopback values require DASHBOARD_AUTH_TOKEN. |
DASHBOARD_PORT | 8080 | TCP port to listen on. |
DASHBOARD_AUTH_TOKEN | (empty — no auth) | Bearer token or X-Auth-Token value required on all routes except / and /health. |
.env.local:
Authentication
WhenDASHBOARD_AUTH_TOKEN is set, all routes except the root (/) and /health require the token in one of two headers:
hmac.compare_digest to prevent timing attacks. A missing or incorrect token returns HTTP 401:
API endpoints
GET /health
Health check — no authentication required. Returns
200 when bankroll_state.json and trade_gate_status.json are present and fresh; 503 when they are missing or stale.GET /api/stats
Consolidated KPIs: equity, working bank, daily budget, daily spend, P&L (total and today), win rate, active positions, exposure, drawdown, risk multiplier, execution mode, and candidate markets.
GET /api/positions
Current open positions from
runtime/open_positions_snapshot.json, including market name, side, size, price, and unrealized P&L.GET /api/history
Recent execution history from
runtime/trade_history.json or the latest runtime/executions/YYYYMMDD.json. Includes status (dry_run, executed, failed), conviction, and P&L.GET /api/decisions
Current decisions from
runtime/decisions.json: market, direction, amount, confidence, strategy, timeframe, and reason.GET /api/equity
Equity history from
runtime/equity_history.json — up to the last 180 data points with equity, working bank, reserve, and drawdown percentage./api/sources — Source freshness
runtime/*.json file:
age_seconds exceeds max(600, SIGNAL_INTERVAL_SEC × 2). The /api/stats endpoint reflects this: a stale bankroll_state.json or trade_gate_status.json sets "block_reason": "stale_runtime".
Security design
The dashboard enforces several layers of protection: Strict filename whitelist. Runtime filenames are validated against the regex^[A-Za-z0-9._-]+\.json$ before being joined to the runtime root, and consecutive dots are explicitly rejected. This prevents path traversal attacks — a dynamically resolved filename can never escape the runtime/ directory.
Response size cap. Each JSON file is capped at 10 MB before being read. Oversized files are treated as unavailable.
Security headers. Every response includes a Content Security Policy with per-request nonces, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer, and a Permissions-Policy that disables camera, microphone, and geolocation.
No secrets in scope. The dashboard process never reads .env.local, OpenClaw configuration, wallet private keys, or any file outside runtime/. It cannot invoke trading commands.
What the dashboard reads
The dashboard reads the followingruntime/ files:
| File | Endpoint(s) |
|---|---|
bankroll_state.json | /api/stats, /health |
trade_gate_status.json | /api/stats, /health |
market_analysis.json | /api/stats |
open_positions_snapshot.json | /api/stats, /api/positions |
trade_history.json | /api/stats, /api/history |
decisions.json | /api/decisions, /api/sources |
equity_history.json | /api/equity, /api/sources |
executions/YYYYMMDD.json | /api/history (fallback) |
bankroll_state.json and trade_gate_status.json have not been generated yet (e.g., before the first pipeline run), the dashboard falls back to legacy SQLite metrics from data/bot.db. This backwards-compatibility path is labeled "source_mode": "legacy_sqlite" in the /api/stats response.
Checking dashboard health
runtime_ready is false, the HTTP status code is 503. Use this endpoint for Docker health checks or uptime monitoring without exposing authenticated routes.