How daniel9572/tracefang works
TraceFang is a multi-market trading analysis platform. A user selects a watched instrument and its single bound real-time source; the backend collects quotes and same-source candles, serves local history and live updates, and the web workspace renders the chart and expert-analysis tools. The README also describes watchlists, source management, gold-event analysis, historical-data admission, and persistence. The graph emphasizes documented runtime responsibilities; some subsystem wiring is inferred only at the directory level because its implementation was not sampled.
Main entry points: api.py HTTP and streams · App.tsx Market workspace · services.py Market data services · acquisition.py Acquisition runtime
Components 25
Market workspace
- Market workspace
web/src/App.tsx - Chart rendering
web/src/MarketChart.tsx
Market data runtime
- HTTP and streams
src/tracefang/api.py - Acquisition runtime
src/tracefang/application/acquisition.py - Market data services
src/tracefang/application/services.py - Realtime bars
src/tracefang/application/realtime_bars.py - History retrieval
src/tracefang/application/history.py - Async persistence
src/tracefang/application/persistence.py - Watchlists and instruments
src/tracefang/instruments.py - Source routing
src/tracefang/infrastructure/source_config.py
Provider adapters
- Jin10 channels
src/tracefang/infrastructure/providers/jin10_local/provider.py - Tonghuashun
src/tracefang/infrastructure/providers/tonghuashun_futures/provider.py - Jin10 web
src/tracefang/infrastructure/providers/jin10_web/provider.py
Persistence and history
- Market data store
src/tracefang/infrastructure/postgres/store.py - Raw frame archive
src/tracefang/infrastructure/jetstream/store.py - History admission
src/tracefang/history_management/admission.py - Research history store
src/tracefang/history_management/postgres.py
Trading analysis
- Expert analysis
web/src/ExpertModeWorkspace.tsx - Analysis features
web/src/expertAnalysis.ts - Gold events
src/tracefang/application/gold_events.py
Other components
- Trader
- Market data providers
- Browser
- PostgreSQL
- NATS JetStream
Connections 28
- Trader → Market workspace: selects and views
- Market workspace → HTTP and streams: requests market data
- HTTP and streams → Market workspace: returns REST and live events
- Market workspace → Chart rendering: renders prices
- Market workspace → Expert analysis: opens analysis
- Expert analysis → Analysis features: uses indicators and replay
- HTTP and streams → Watchlists and instruments: reads and updates
- HTTP and streams → Source routing: reads and updates routes
- HTTP and streams → Market data services: requests quotes and candles
- HTTP and streams → Realtime bars: serves live bars
- HTTP and streams → History retrieval: requests missing history
- Acquisition runtime → Market data services: collects selected source
- Market data services → Jin10 channels: requests market data
- Market data services → Tonghuashun: requests market data
- Jin10 channels → Market data providers: receives market feed
- Tonghuashun → Market data providers: requests market feed
- Jin10 web → Market data providers: receives web feed
- Acquisition runtime → Realtime bars: updates live bars
- Realtime bars → Async persistence: queues persistence
- Async persistence → Market data store: writes quotes and candles
- HTTP and streams → Market data store: reads cached data
- Market data store → PostgreSQL: stores market state
- Acquisition runtime → Raw frame archive: archives raw frames
- Raw frame archive → NATS JetStream: persists and replays frames
- History admission → Research history store: validates and admits datasets
- Research history store → PostgreSQL: stores trusted history
- HTTP and streams → Gold events: serves event analysis
- Browser → Market workspace: uses workspace