Skip to content

Market data review - #11

Open
hengky888 wants to merge 3 commits into
mainfrom
market-data-review
Open

Market data review#11
hengky888 wants to merge 3 commits into
mainfrom
market-data-review

Conversation

@hengky888

Copy link
Copy Markdown
Owner

No description provided.

claude and others added 3 commits August 12, 2026 07:04
Single implementation-ready design of record for the market data
subsystem, covering the unified data-source API, the GBM simulator, and
the Massive REST client, plus the shared price cache, SSE streaming, the
FastAPI wiring, and the watchlist/trade routes that consume them.

Written against the as-built code rather than as a forward-looking spec:
every code snippet is the shipped implementation, and the numeric
constants (seed prices, GBM parameters, correlations, simulated
universe) were diffed against source to confirm they match.

Documents the reasoning behind the non-obvious choices — why the SSE
stream emits unconditionally and computes direction per connection, why
ensure_priced exists alongside add_ticker, why the no-residue guarantee
is achieved by ordering rather than rollback, why the cache rounds at
the write boundary, and why there is no runtime failover from Massive to
the simulator.

The four split documents are superseded. market_data_design.md moves to
archive/MARKET_DATA_DESIGN_V2.md (renamed to avoid a case-collision with
the existing archive/MARKET_DATA_DESIGN.md on case-insensitive
filesystems), and the ten cross-references in the remaining companion
docs are repointed at the new sections.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MtZb6BTTzEFNEzR6kq1wJ4
Instructor redo: consolidated market data design doc, rebuilt from clean main
Reviews backend/app/market/ as of b45d882. Records the 127-test/97%
coverage baseline and what this branch resolved since main (per-call
APIRouter, SSE tests, symbol normalization, ensure_priced).

Findings still open, each verified by execution:
- No FastAPI app exists; create_stream_router has no production caller
- add_ticker bypasses the simulated universe that ensure_priced enforces,
  so the watchlist path can stream invented prices
- GBM dt is not derived from update_interval
- The stream emits nothing on an empty priced set, contradicting its
  documented "silence means disconnected" contract
- daily change % (PLAN.md:381) cannot be sourced from current data
- The {seq, ts, prices} SSE envelope is undocumented in PLAN.md

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants