How ksksrbiz-arch/day-trade works
paper-trader is a paper-only trading and measurement system, with a broader autonomous research/control center. Its documented core workflow turns RSS news into structured labels, applies a deterministic strategy, submits paper orders, and measures performance against a benchmark; archived labels also support deterministic replay. The repository additionally contains optional RL, prediction, agent, and visualization subsystems. Relationships are limited to README statements and shown source references; unsampled modules are represented by their exact paths without inferred call chains.
Main entry points: runtime.py Agent runtime · tools.py Agent tools · engine.py Prediction engine · labels.py Label model
Components 34
Signals and execution
- News ingestion
trader/news.py - News labeler
trader/labeler.py - Label model
trader/labels.py - Deterministic strategy
trader/strategy.py - Paper broker
trader/broker.py - Trading configuration
trader/config.py - RL trader
trader/rl/trader.py
Replay and measurement
- Replay harness
trader/backtest.py - Slippage simulator
trader/simbroker.py - Performance metrics
trader/metrics.py - Walk-forward analysis
trader/walkforward.py - Point-in-time data
trader/crsp/query.py
Research and autonomy
- Signal confluence
trader/alpha.py - Market brain
trader/market_brain.py - Agent runtime
trader/agents/runtime.py - Agent orchestrator
trader/agents/orchestrator.py - Action governor
trader/agents/governor.py - Agent memory
trader/agents/memory.py - Agent state
trader/agents/state.py - Agent tools
trader/agents/tools.py - Cloudflare AI client
trader/agents/cloudflare.py - Insight mesh
trader/mesh.py - Prediction engine
trader/predict/engine.py - Prediction store
trader/predict/store.py - ML inference
trader/ml/infer.py
Control and visualization
- Dashboard API
dashboard/app.py - Bot controls
dashboard/bots.py - Brain page
brain/app/brain/page.tsx - 3D brain scene
brain/src/scene/BrainScene.tsx - Live data hook
brain/src/useLive.ts
Other components
- Operator
- RSS feeds
- Anthropic Claude
- Alpaca paper
Connections 34
- RSS feeds → News ingestion: provides items
- News ingestion → News labeler: feeds news
- Anthropic Claude → News labeler: extracts features
- News labeler → Label model: emits labels
- Label model → Deterministic strategy: drives decisions
- Deterministic strategy → Paper broker: submits trades
- Paper broker → Alpaca paper: places paper orders
- Label model → Replay harness: replays history
- Replay harness → Slippage simulator: simulates fills
- Replay harness → Performance metrics: scores results
- Walk-forward analysis → Point-in-time data: queries history
trader/crsp/query.py - Operator → Dashboard API: uses
dashboard/app.py - Dashboard API → Bot controls: imports controls
dashboard/app.py - Operator → Brain page: opens
brain/app/brain/page.tsx - Brain page → 3D brain scene: renders scene
- 3D brain scene → Live data hook: uses live hook
brain/src/scene/BrainScene.tsx - Live data hook → 3D brain scene: updates scene
brain/src/useLive.ts - Live data hook → Insight mesh: reads topology
- Agent runtime → Insight mesh: publishes insights
trader/agents/runtime.py - Agent runtime → Prediction engine: runs cycle
trader/agents/runtime.py - Prediction engine → Prediction store: records predictions
trader/predict/engine.py - Prediction engine → Point-in-time data: loads prices
trader/predict/engine.py - Agent orchestrator → Agent memory: recalls context
trader/agents/orchestrator.py - Agent orchestrator → Agent tools: selects tools
trader/agents/orchestrator.py - Agent tools → Action governor: governs actions
trader/agents/tools.py - Action governor → Agent memory: records actions
trader/agents/governor.py - Agent tools → Cloudflare AI client: scores headlines
trader/agents/tools.py - Agent runtime → Agent state: checkpoints state
trader/agents/runtime.py - Agent runtime → Insight mesh: snapshots mesh
trader/agents/runtime.py - Agent tools → ML inference: uses inference
trader/agents/tools.py - Signal confluence → ML inference: scores signals
trader/alpha.py - Signal confluence → Prediction engine: gets prediction score
trader/alpha.py - Operator → RL trader: opts into mode
- RL trader → Deterministic strategy: uses guardrails
trader/rl/trader.py