Skip to content

TUI Dashboard

The Hydra includes a terminal-based user interface (TUI) for real-time monitoring and emergency control. It provides a high-signal view of the bot’s state, market data, and strategy decisions.

The TUI runs as a separate process and connects to a running bot instance via IPC. Ensure the bot is already running before starting the TUI.

To start the TUI, run:

Terminal window
# Using the hydra binary
hydra tui
# Or from source
bun run tui

The TUI reads the IPC configuration (host and port) from your configuration file (defaulting to config.example.yaml if BOT_CONFIG environment variable is not set).

The dashboard is divided into several functional areas:

Located at the top, the status bar shows:

  • Mode: Current operating mode (e.g., live, paper, replay).
  • WS: WebSocket connection status to Polymarket (UP/DOWN).
  • Risk: Current state of the risk circuit breakers.
  • Arming Status: Shows if emergency controls are ARMED or SAFE.
  • Rec: Current recording statistics if the recorder is active.
  • Time: Current system time.

Shows aggregate statistics across all monitored markets:

  • Total number of monitored markets and reference price feeds.
  • Total position size across YES and NO tokens (formatted as YES:X/NO:Y).
  • Number of currently open orders.

The summary bar also displays real-time account metrics from the RiskManager:

  • Bal: Current USDC balance. In paper trading, this starts at initialBalanceUSDC.
  • Real: Realized Profit/Loss from closed positions (after fees).
  • Unrl: Unrealized Profit/Loss across all open positions (position value minus cost basis).
  • DD: Current drawdown percentage from peak equity (high water mark).

These metrics update in real-time as market prices change and trades execute.

A navigation pane on the left allows you to select which market’s details to view in the central panels. Use arrow keys to navigate.

Displays detailed information for the selected market:

  • Orderbook: Best bid and ask prices for both YES and NO tokens.
  • Sum/Spread: Combined price of YES and NO tokens and the resulting market spread.
  • Positions: Current position size for the selected market.

Shows real-time analysis for the selected market:

  • Theoretical Probability: Computed fair value based on reference prices and time to expiry.
  • Implied Probability: Market’s current price.
  • Edge: The difference between theoretical probability and the current executable price (Ask for buying, Bid for selling).
  • Signal: Current trading signal (e.g., BUY YES, BUY NO, or HOLD) and the reason for the decision.

Displays the latest prices from Binance for assets relevant to the monitored markets, including the age of each price update to help detect stale data.

A scrollable view of recent system events and strategy signals. You can toggle between raw and formatted log modes.

The TUI uses the following keyboard shortcuts for navigation and control:

KeyAction
qQuit the TUI
?Toggle help modal
ESCClose any open modal
up / downNavigate through the market list
EnterOpen Market Detail Modal
cOpen Config Modal (Armed Mode must be disabled)
lToggle log mode between Raw and Formatted
aArm/Disarm emergency controls (requires confirmation)

Pressing Enter on a selected market opens a detailed modal window containing:

  • Market Info: Full question, expiry time, and time window progress.
  • Strike Pricing: Opening price (or “awaiting capture”), strike price, and current spot.
  • Orderbook Depth: Visual representation of bids and asks.
  • Strategy Analysis: Detailed breakdown of theoretical vs. implied probability and current edge.

Pressing c allows you to view the current bot configuration in a searchable modal. This is useful for verifying strategy parameters without leaving the dashboard.

To prevent accidental execution, emergency controls are disabled by default. You must press a and type ARM when prompted to enable them. Once ARMED, the following keys are active:

KeyAction
pPause trading operations
rResume trading operations
cCancel all open orders across all markets
kKill Switch: Immediately cancels all orders and halts the bot

The TUI is designed to be completely decoupled from the bot’s core trading logic. If the TUI process is closed or crashes, the bot will continue to operate normally. You can stop and restart the TUI at any time without affecting active trades or strategy execution.