Skip to content

Complete Market Data backend implementation - #6

Merged
hengky888 merged 1 commit into
mainfrom
claude/issue-4-20260729-0751
Jul 29, 2026
Merged

Complete Market Data backend implementation#6
hengky888 merged 1 commit into
mainfrom
claude/issue-4-20260729-0751

Conversation

@hengky888

Copy link
Copy Markdown
Owner

Summary

Completes the Market Data backend implementation and all 9 recommended hardening items.

Validation

  • uv sync --extra dev — passed
  • uv run pytest -v — 127 tests passed
  • uv run ruff check app/ tests/ — all checks passed

Main changes

  • Added symbol normalisation and simulation-symbol handling
  • Added pricing availability errors and ensure_priced
  • Improved SSE tick delivery and connection direction tracking
  • Added cache version locking
  • Added simulator fallback for invalid correlation matrices
  • Added configurable Massive polling interval
  • Added escalation after consecutive polling failures
  • Expanded automated test coverage
  • Corrected backend setup command in README

Generated with Claude Code

Adds symbols.py (normalize_symbol/SIMULATED_UNIVERSE/is_simulated),
UnknownSymbolError/PricingUnavailableError + ensure_priced on the
MarketDataSource interface (implemented in both the simulator and
Massive client), rewrites the SSE generator to emit every tick with
per-connection direction in a {seq, ts, prices} envelope, locks the
PriceCache.version read, falls back to independent draws on a
non-PSD correlation matrix, reads MASSIVE_POLL_INTERVAL from env,
and escalates repeated Massive poll failures to ERROR after 3
consecutive failures. Also fixes backend/README.md's `uv sync --dev`
to `uv sync --extra dev` (dev is an optional extra, not a group).

Addresses all 9 items in planning/market_data_summary.md's
"Recommended Implementation Order", including tests.

Co-authored-by: hengky888 <291320016+hengky888@users.noreply.github.com>
@hengky888
hengky888 merged commit 6f3e36f into main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant