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.
Starting the TUI
Section titled “Starting the TUI”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:
# Using the hydra binaryhydra tui
# Or from sourcebun run tuiThe 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).
Interface Overview
Section titled “Interface Overview”The dashboard is divided into several functional areas:
Status Bar
Section titled “Status Bar”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.
Summary Bar
Section titled “Summary Bar”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.
Account Metrics
Section titled “Account Metrics”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.
Markets List
Section titled “Markets List”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.
Market Summary
Section titled “Market Summary”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.
Strategy / Edge Analysis
Section titled “Strategy / Edge Analysis”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.
Reference Prices
Section titled “Reference Prices”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.
Event Log
Section titled “Event Log”A scrollable view of recent system events and strategy signals. You can toggle between raw and formatted log modes.
Keyboard Controls
Section titled “Keyboard Controls”The TUI uses the following keyboard shortcuts for navigation and control:
| Key | Action |
|---|---|
q | Quit the TUI |
? | Toggle help modal |
ESC | Close any open modal |
up / down | Navigate through the market list |
Enter | Open Market Detail Modal |
c | Open Config Modal (Armed Mode must be disabled) |
l | Toggle log mode between Raw and Formatted |
a | Arm/Disarm emergency controls (requires confirmation) |
Market Detail Modal
Section titled “Market Detail Modal”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.
Config Modal
Section titled “Config Modal”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.
Emergency Controls (Armed Mode Only)
Section titled “Emergency Controls (Armed Mode Only)”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:
| Key | Action |
|---|---|
p | Pause trading operations |
r | Resume trading operations |
c | Cancel all open orders across all markets |
k | Kill Switch: Immediately cancels all orders and halts the bot |
Process Isolation
Section titled “Process Isolation”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.