How lexian-6/volatility_surface_trader works
Volatility Surface Trader is a replay-based options research simulator. Users select real or synthetic market data, inspect an OTM volatility surface and option-chain edges, place trades, and review portfolio P&L and risk. The real-data path collects IBKR historical bars, merges them into replay snapshots, and loads them in the dashboard; synthetic replay is an alternative. The graph preserves documented dashboard capabilities, but several source excerpts are partial, so uncertain internal wiring is omitted.
Main entry points: app.py Interactive Dashboard · ibkr_client.py IBKR Chain Client · data Replay Snapshots · replay.py Historical Replay Server
Components 16
Market Data Collection
- Historical Bar Collector
ib_chain_collector/collect_history.py - Snapshot Merger
ib_chain_collector/merge_history.py - Live Chain Collector
ib_chain_collector/stream_chain.py - IBKR Chain Client
vol_surface_trader/core/ibkr_client.py
Replay Data
- Replay Snapshots
vol_surface_trader/data - Historical Replay Server
vol_surface_trader/data/replay.py - Synthetic Session Generator
vol_surface_trader/core/replay_engine.py - Trading Replay Engine
vol_surface_trader/core/replay_engine.py
Volatility Analytics
- Option Pricing
vol_surface_trader/core/pricing.py - IV Surface And Edges
vol_surface_trader/core/vol_surface.py
Trading And Risk
- Market And Trade Models
vol_surface_trader/core/models.py - Positions And Risk
vol_surface_trader/core/portfolio.py
Dashboard
- Interactive Dashboard
vol_surface_trader/dashboard/app.py - Surface Visualization
vol_surface_trader/dashboard/visualization.py
Other components
- Researcher
- IBKR TWS / Gateway
Connections 20
- Researcher → Interactive Dashboard: selects and trades
- IBKR TWS / Gateway → Historical Bar Collector: historical bars
- Historical Bar Collector → Snapshot Merger: writes bar files
- Snapshot Merger → Replay Snapshots: writes snapshots
- IBKR TWS / Gateway → Live Chain Collector: live quotes
- Live Chain Collector → Replay Snapshots: writes snapshots
- IBKR TWS / Gateway → IBKR Chain Client: market data
- Replay Snapshots → Historical Replay Server: loads snapshots
- Interactive Dashboard → Historical Replay Server: selects real replay
- Interactive Dashboard → Synthetic Session Generator: requests simulation
- Synthetic Session Generator → Trading Replay Engine: generates session states
- Historical Replay Server → Interactive Dashboard: emits snapshots
- Interactive Dashboard → Trading Replay Engine: controls playback and trades
- Trading Replay Engine → Positions And Risk: updates positions and P&L
- Positions And Risk → Option Pricing: calculates option Greeks
- Interactive Dashboard → IV Surface And Edges: builds OTM surface and edges
- IV Surface And Edges → Option Pricing: solves implied volatility
- Interactive Dashboard → Surface Visualization: renders analysis
- Interactive Dashboard → IBKR Chain Client: requests chain data
- IBKR Chain Client → IBKR TWS / Gateway: requests quotes and contracts