Skip to content

Add detailed market data backend design document - #156

Open
RuquiaAlam wants to merge 1 commit into
ed-donner:mainfrom
RuquiaAlam:claude/market-data-backend-design-7rg7dc
Open

Add detailed market data backend design document#156
RuquiaAlam wants to merge 1 commit into
ed-donner:mainfrom
RuquiaAlam:claude/market-data-backend-design-7rg7dc

Conversation

@RuquiaAlam

Copy link
Copy Markdown

Adds planning/MARKET_DATA_DESIGN.md, a full design reference for the market data subsystem covering the unified API, GBM simulator, and Massive (Polygon.io) REST client.

Contents:

  • Unified API: MarketDataSource ABC and the shared PriceCache, with the producer-writes/consumer-reads rule that makes sources interchangeable
  • Data model: PriceUpdate, derived change/direction properties, SSE serialization
  • Simulator: GBM math and dt derivation, Cholesky-correlated sector moves, random shock events, seed prices and per-ticker parameters
  • Massive API: snapshot endpoint, rate-limit-driven poll intervals, asyncio.to_thread offloading, two-level error handling
  • SSE endpoint: wire format, version-gated change detection, reconnect and disconnect behavior, EventSource client example
  • Integration contracts for the API layer: FastAPI lifespan wiring, watchlist coordination, trade fills and portfolio valuation
  • Error handling matrix, testing strategy with example tests, tuning reference, and open design items

Code snippets reflect the implementation in backend/app/market/.

Adds planning/MARKET_DATA_DESIGN.md, a full design reference for the
market data subsystem covering the unified API, GBM simulator, and
Massive (Polygon.io) REST client.

Contents:
- Unified API: MarketDataSource ABC and the shared PriceCache, with the
  producer-writes/consumer-reads rule that makes sources interchangeable
- Data model: PriceUpdate, derived change/direction properties, SSE
  serialization
- Simulator: GBM math and dt derivation, Cholesky-correlated sector
  moves, random shock events, seed prices and per-ticker parameters
- Massive API: snapshot endpoint, rate-limit-driven poll intervals,
  asyncio.to_thread offloading, two-level error handling
- SSE endpoint: wire format, version-gated change detection, reconnect
  and disconnect behavior, EventSource client example
- Integration contracts for the API layer: FastAPI lifespan wiring,
  watchlist coordination, trade fills and portfolio valuation
- Error handling matrix, testing strategy with example tests, tuning
  reference, and open design items

Code snippets reflect the implementation in backend/app/market/.
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