In financial trading, milliseconds matter. Traditional data processing tools often struggle to keep up with modern markets, where thousands of trades per second generate massive streams of data that need to be processed, analyzed, and visualized in real-time.
In this post, we'll build a comprehensive real-time trading dashboard using Deephaven, demonstrating its table-oriented approach to financial data processing.
The challenge of real-time trading data
Modern trading systems face several critical challenges:
- Volume: Markets generate millions of data points per second.
- Latency: Decisions must be made in microseconds to milliseconds.
- Complexity: Multiple data sources need to be correlated and analyzed simultaneously.
- Reliability: System failures can result in significant financial losses.
Traditional approaches often require complex architectures with multiple systems that handle ingestion, processing, storage, and visualization separately. Deephaven provides a unified platform where all these operations happen in a single environment.
Setting up our real-time trading environment
Let's start by creating a simulated real-time market data feed and building our dashboard step by step.
Simulating market data
First, we'll create a realistic market data simulator that generates ticking data for multiple symbols:

Real-time price calculations
Now let's add some sophisticated real-time calculations that traders typically need:

Real-time portfolio tracking
Let's create a portfolio that tracks our positions and P&L in real-time:

Advanced real-time analytics
Risk monitoring
Real-time risk monitoring is crucial for any trading operation. Let's implement some key risk metrics:

Market microstructure analysis
Let's analyze the bid-ask spread and market depth:

Real-time alerts and notifications

Bringing it all together: The real-time dashboard
Now that we've built all the components, let's see how they work together. All these tables update automatically as market data flows in - portfolio P&L, risk metrics, alerts, and market quality all refresh in real-time without any additional code.
Your live dashboard includes:
trading_signals: Real-time prices with technical indicators (SMA, EMA, VWAP) and buy/sell signalsportfolio_pnl: Current position values and unrealized P&L updating with every price tickportfolio_summary: Aggregate portfolio metrics showing total value and returnrisk_metrics: Position-level risk calculations including VaR and volatility measuresrisk_alerts: Filtered view showing only positions that breach risk thresholdsspread_analysis: Market microstructure data with bid-ask spreads and depthprice_alerts: Significant price movements and high-volume events as they happen
Each table updates automatically as new market data arrives. Open any table in the Deephaven UI to see live updates, sort, filter, or create custom visualizations. You can also use Deephaven's plotting capabilities to visualize this data:

All visualizations update in real-time as the underlying tables change - no polling, no manual refreshes, no complex event handlers.
How the architecture works
A few characteristics of the table-oriented approach are worth noting:
Unified operations: Data ingestion, processing, and visualization all work with the same table abstraction. There's no separate system for streaming versus batch, or for analytics versus visualization.
Automatic propagation: When market_data updates, all dependent tables (trading_signals, portfolio_pnl, risk_metrics) update automatically. You define the relationships once, and Deephaven handles the update propagation.
Incremental updates: Only changed data gets reprocessed. When a single price ticks, Deephaven recalculates only the affected rows in dependent tables, not the entire dataset.
Columnar storage: Tables use columnar storage internally, which is efficient for both memory usage and analytical queries on large datasets.
These properties make the platform well-suited for high-frequency data processing where both latency and throughput matter.
Performance considerations for production
When deploying this dashboard to production trading systems, consider these optimization strategies:
Data retention: For high-frequency data, implement retention policies to keep memory usage manageable:
Selective updates: For computationally expensive indicators, sample at lower frequencies:
Partitioned tables: For historical data storage, partition by symbol for efficient queries:
Selective subscriptions: Only subscribe to the specific tables and columns your UI needs, rather than the entire dashboard. This reduces network overhead and browser memory usage.
Deephaven's incremental computation engine ensures that only changed data is reprocessed, making these strategies highly effective even with thousands of updates per second.
Complete code example
For your convenience, here's the complete working code for building a real-time trading dashboard with Deephaven:
Complete Real-Time Trading Dashboard Code

From data to dashboard in 100 lines
In this post, we built a complete real-time trading dashboard that handles market data ingestion, technical analysis, portfolio tracking, risk monitoring, market microstructure analysis, and real-time alerting - all in under 100 lines of executable Python code. This demonstrates Deephaven's core strengths:
Unified platform: Everything from data ingestion to analytics to visualization happens in one system. No message queues, no separate stream processors, no complex orchestration.
Automatic real-time updates: Every table in our dashboard updates automatically as market data flows in. Portfolio P&L, risk metrics, and alerts all refresh without polling, event handlers, or manual triggers.
Incremental computation: Deephaven only recalculates what changed. When a single price updates, only the affected rows in dependent tables are recomputed - not the entire dataset.
Table-oriented thinking: By modeling our system as interconnected tables rather than event streams or objects, we get declarative, composable logic that's easy to understand, test, and modify.
The dashboard we built handles multiple symbols, calculates sophisticated indicators (VWAP, SMA, EMA, volatility), tracks portfolio performance, monitors risk metrics, analyzes market quality, and generates alerts - all updating in real-time with sub-millisecond latency. This level of functionality would typically require a complex multi-system architecture, but Deephaven's unified platform makes it straightforward.
Ready to build your own real-time trading dashboard? Get started with Deephaven Community and experience the power of real-time, table-oriented data processing for yourself.
Note
Check out the next article in our series for a deep dive into the Deephaven UI and how to build interactive dashboards with real-time data visualization. Read the UI guide here.