MDF now places 3 levels of resting bids and asks per symbol each cycle,
ensuring order books always have liquidity. CH AI trader falls back to
securities.txt reference prices when books are empty. CH daily obligation
raised to 20.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add clearing house simulation with 10 members (USR01-USR10)
- New clearing_house/ Flask service (port 5004) with dedicated dark-themed portal
- SQLite persistence: member capital, holdings, daily trade counters, settlements
- Members start with €100,000; must trade ≥10 securities per trading day
- Password = member ID (e.g. USR01 logs in with password USR01)
- Real users log in to trade manually; AI (LLM via Groq→HF→Ollama) simulates unoccupied members
- Trade attribution via Kafka trades consumer — detects USRxx- cl_ord_id prefix
- EOD settlement triggered by dashboard session end; calculates unrealized P&L
- Leaderboard at /ch/ with real-time auto-refresh and Human/AI badges
- Member portfolio view: holdings, order entry, trade history, settlement history
- Integrated into nginx (/ch/), entrypoint.sh, docker-compose, and HF Dockerfile
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add AI Analyst service: Ollama (local) + HuggingFace (HF Spaces)
New ai_analyst/ai_analyst.py service consumes trades/snapshots from
Kafka, builds a market-context prompt every 30 min, calls Ollama
(llama3.1:8b) locally or HuggingFace Inference API (Mistral-7B) as
fallback, and publishes insights to the ai_insights Kafka topic.
Dashboard consumes ai_insights and broadcasts via SSE. New full-width
AI Analyst panel displays timestamped insights with animated cards.
- ai_analyst/ai_analyst.py: new service (Ollama-first, HF fallback)
- ai_analyst/Dockerfile: minimal Python image for local compose
- shared/config.py: add AI_INSIGHTS_TOPIC
- dashboard/dashboard.py: consume ai_insights, SSE broadcast
- dashboard/templates/index.html: AI Analyst panel + JS handlers
- Dockerfile: copy ai_analyst.py into HF single-container image
- entrypoint.sh: create ai_insights topic, start ai_analyst.py
- docker-compose.yml: ai_analyst service with OLLAMA_HOST + HF_TOKEN
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Start/End of Day controls and price history chart
- shared/config.py: add CONTROL_TOPIC for start/stop signals
- md_feeder: listen on control topic; pause/resume simulation on stop/start signals, reload securities on start
- dashboard: add SQLite OHLCV history DB (1-min buckets), record every Kafka trade
- dashboard: POST /session/start (reset prices → start), POST /session/end (save closing prices → stop)
- dashboard: GET /history/<symbol>?period=1h|8h|1d|1w|1m returns aggregated OHLCV candles (≤150 bars)
- dashboard UI: Start/End of Day buttons + session status badge in header
- dashboard UI: full-width Price History panel with candlestick + volume chart (canvas)
- docker-compose: mount shared_data volume into dashboard so it can read/write securities.txt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Kafka-based stock exchange simulation with:
- Order matcher engine with SQLite persistence
- FIX protocol OEG server and UI clients
- Frontend order entry with real-time book/trades
- Trading dashboard with SSE streaming and charts
- Market data feeder, consumer, and snapshot viewer
- Docker Compose orchestration for all services
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>