Skip to content

Claude/market data backend design tc26mr - #167

Open
zuoang25 wants to merge 2 commits into
ed-donner:mainfrom
zuoang25:claude/market-data-backend-design-tc26mr
Open

Claude/market data backend design tc26mr#167
zuoang25 wants to merge 2 commits into
ed-donner:mainfrom
zuoang25:claude/market-data-backend-design-tc26mr

Conversation

@zuoang25

@zuoang25 zuoang25 commented Sep 4, 2026

Copy link
Copy Markdown

No description provided.

zuoang25 and others added 2 commits September 4, 2026 22:03
* "Update Claude PR Assistant workflow"

* "Update Claude Code Review workflow"
Write planning/MARKET_DATA_DESIGN.md covering the full market data
subsystem: the PriceUpdate model, the thread-safe PriceCache, the
MarketDataSource interface both implementations honour, the GBM
simulator (model, time step, Cholesky-correlated moves, shock events),
the Massive REST client (polling budget, threading, two-level error
handling), the factory, the SSE endpoint and wire format, FastAPI
lifecycle integration, watchlist coordination, configuration, testing
strategy, edge cases, and known gaps.

Numerical claims about the simulator are verified against the running
implementation; Appendix A reproduces the verification script and its
output (correlation matrix positive-definiteness, realised volatility
and correlation vs targets). References are given for the GBM model,
the Cholesky construction, the Massive API limits, and the SSE spec.

Also point CLAUDE.md at the new document.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5pzyDaXVowQAY4YPLSM1C
Copilot AI lite review requested due to automatic review settings September 4, 2026 22:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are a few documentation/config-example correctness issues (stored as inline comments) that should be fixed to avoid misleading readers copying the examples.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a comprehensive, implementation-aligned design document for the market data backend and wires it into the repository’s documentation pointers, plus minor adjustments to Claude Code workflow configuration comments.

Changes:

  • Added planning/MARKET_DATA_DESIGN.md detailing the market data subsystem architecture, interfaces, simulator, Massive client, cache, SSE stream, and integration/testing notes.
  • Updated CLAUDE.md to reference the new market data design document alongside existing summaries/archives.
  • Tweaked Claude Code GitHub workflow prompts/arguments (and an example comment) for code review automation.
File summaries
File Description
planning/MARKET_DATA_DESIGN.md New detailed market data backend design document (architecture, APIs, examples, testing, known gaps).
CLAUDE.md Adds a pointer to the new market data design doc in the repo’s documentation index.
.github/workflows/claude.yml Adjusts a commented claude_args example line (documentation-only).
.github/workflows/claude-code-review.yml Updates Claude Code Review workflow prompt/args to enable commenting behavior.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

return router
```

**3. `PriceCache.version` reads without the lock.** Safe today — a CPython `int` read is atomic under the GIL — but inconsistent with every other accessor, and not guaranteed under a free-threaded build (PEP 703 [17]). One-line fix:
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'
# claude_args: '--allowed-tools Bash(gh pr *)'

This document is the full design of the market data subsystem: the unified data-source interface, the built-in Geometric Brownian Motion (GBM) simulator, the Massive (formerly Polygon.io) REST client, the shared price cache, and the Server-Sent Events (SSE) endpoint that pushes prices to the browser. Every code block below is either verbatim from the implementation or a worked example that runs against it.

Numerical claims in §6 (volatility calibration, correlation targets, positive-definiteness of the correlation matrix) were verified by running the implementation; the verification script is reproduced in [Appendix A](#appendix-a--reproducing-the-calibration-checks) so it can be re-run in a Jupyter notebook.
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.

3 participants