Trading Dashboard
The Trading Dashboard is a full-stack monitoring and analysis interface designed to provide transparency into the decision-making process of the AI agents. Built with a FastAPI backend and a React frontend, it transforms raw backtest data and live trade logs into actionable visual insights.
Overview
The dashboard serves as the central hub for:
- Performance Tracking: Visualizing equity growth against benchmark assets (BTC).
- Decision Auditing: Reading the specific "reasoning" and "confidence" metrics generated by the LLM agents for every trade.
- Backtest Management: Comparing multiple historical runs to identify the most effective agent configurations.
- Live Monitoring: Receiving real-time trade execution updates via WebSockets.
Key Features
Performance Metrics Panel
The dashboard calculates and displays critical risk-adjusted return metrics for the selected strategy:
- Total Return: Percentage gain/loss over the period.
- Sharpe Ratio: Risk-adjusted return performance.
- Max Drawdown: The largest peak-to-trough decline.
- Win Rate & Profit Factor: Statistical reliability of the agent's signals.
- Alpha vs. Hold: Performance of the active strategy compared to a simple "Buy and Hold" approach for Bitcoin.
Equity Curve Visualization
The interactive chart plots the portfolio value over time. It overlays trade execution points directly onto the equity curve, allowing you to see exactly where the agents entered or exited the market relative to price action.
Agent Logic & Trade History
Unlike traditional trading platforms that only show "Buy/Sell" orders, this dashboard provides a deep dive into the Agent Reasoning. For every trade, you can view:
- Action & Price: Basic execution details.
- Confidence Score: A 0–100 rating provided by the Supervisor agent.
- Reasoning String: The natural language explanation generated by the agents (Technical, Sentiment, and Fundamental analysis) that led to the decision.
Getting Started
To launch the dashboard, you must run both the backend API and the frontend development server.
1. Start the Backend API
The backend handles data retrieval from the SQLite database and provides the WebSocket stream.
# Navigate to the dashboard backend directory
cd dashboard/backend
# Run the FastAPI server
uvicorn main:app --reload --port 8000
The API will be available at http://localhost:8000. You can view the interactive Swagger documentation at /docs.
2. Start the Frontend
The frontend is a Vite-powered React application.
# Navigate to the dashboard frontend directory
cd dashboard/frontend
# Install dependencies
npm install
# Start the development server
npm run dev
Open your browser to http://localhost:5173 (or the port specified in your terminal) to view the dashboard.
API Documentation
If you wish to extend the dashboard or integrate the data into other tools, the backend provides the following REST endpoints:
| Endpoint | Method | Description |
| :--- | :--- | :--- |
| /api/backtests | GET | Returns a list of all historical backtest summaries. |
| /api/backtests/{id} | GET | Returns detailed metrics, equity curve data, and trade logs for a specific run. |
| /ws | WS | WebSocket endpoint for receiving live trade notifications. |
Data Models
The dashboard uses structured Pydantic models to ensure data consistency between the AI agents and the UI:
class TradeResponse(BaseModel):
id: int
timestamp: str
asset: str
action: str
price: float
reasoning: str # The LLM's justification
confidence: float # 0-100 scale
Real-time Updates
The dashboard includes a built-in status indicator. When the system is running in live-trading mode, the dashboard establishes a WebSocket connection. As soon as the Orchestrator confirms a trade, the UI automatically refreshes the metrics and trade table without requiring a page reload.