Skip to content

Commit 05b1b86

Browse files
userFRMclaude
andcommitted
v2.0.0: CLI, MCP server, REST+WS server, mdBook docs, zero-alloc FPSS
New products: - tdx CLI (tools/cli/) — 61 endpoints via endpoint registry - MCP server (tools/mcp/) — 64 tools for LLM integration - REST+WS server (tools/server/) — drop-in Java terminal replacement, v3 API - mdBook docs site (docs-site/) — 33 pages, GitHub Pages Breaking: - FpssEvent split into FpssData + FpssControl - FPSS is fully sync (no tokio), LMAX Disruptor ring buffer - OHLCVC derivation opt-in/out via connect_no_ohlcvc() Core improvements: - Endpoint registry auto-generated from proto at build time - sonic-rs replaces serde_json in all tools - Zero-alloc FPSS hot path (reusable buffers, tuple return) - Full SDK parity (Python/Go/C++/FFI all match Rust API) - v3 REST paths matching ThetaData OpenAPI spec - 43 criterion benchmarks, 159 tests - SIMD FIT removed (was regression) - All Codex + Gemini + Kimi findings addressed Audited by: Codex (GPT-5.4), Gemini 3.1 Pro, Kimi k2.5 Verified against live ThetaData servers (free tier) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8146fef commit 05b1b86

151 files changed

Lines changed: 43332 additions & 448 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: false
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
environment:
17+
name: github-pages
18+
url: ${{ steps.deployment.outputs.page_url }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: peaceiris/actions-mdbook@v2
22+
with:
23+
mdbook-version: latest
24+
- run: mdbook build docs-site
25+
- uses: actions/upload-pages-artifact@v3
26+
with:
27+
path: docs-site/book
28+
- id: deployment
29+
uses: actions/deploy-pages@v4

CHANGELOG.md

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,62 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0.0] - 2026-03-27
9+
10+
### New Products
11+
12+
- **`tdx` CLI** (`tools/cli/`) — command-line tool with all 61 endpoints + Greeks + IV.
13+
Dynamically generated from endpoint registry. `cargo install thetadatadx-cli`
14+
- **MCP Server** (`tools/mcp/`) — Model Context Protocol server giving LLMs instant
15+
access to 64 tools (61 endpoints + ping + greeks + IV) over JSON-RPC stdio.
16+
Works with Claude Code, Cursor, Codex.
17+
- **REST+WS Server** (`tools/server/`) — drop-in replacement for the Java terminal.
18+
v3 API on port 25503, WebSocket on 25520 with real FPSS bridge. sonic-rs JSON.
19+
- **mdBook documentation site** (`docs-site/`) — 33 pages covering API reference,
20+
guides, SDK docs, wire protocol internals. Deployed to GitHub Pages.
21+
22+
### Breaking Changes
23+
24+
- **FpssEvent split**`FpssEvent::Quote { .. }` is now `FpssEvent::Data(FpssData::Quote { .. })`.
25+
Control events are `FpssEvent::Control(FpssControl::*)`. Migration: wrap your match arms.
26+
- **OHLCVC derivation opt-in/out**`connect()` still derives OHLCVC (default).
27+
New `connect_no_ohlcvc()` disables it for lower overhead on full trade streams.
28+
- **FpssClient is fully sync** — no tokio in the streaming path. LMAX Disruptor
29+
ring buffer. Callback API: `FnMut(&FpssEvent)`.
30+
31+
### Added
32+
33+
- **Endpoint registry** — auto-generated from proto at build time. Single source of
34+
truth consumed by CLI, MCP, server. 61 endpoints.
35+
- **Repo reorganization**`tools/cli/`, `tools/mcp/`, `tools/server/` (was `crates/*`)
36+
- **sonic-rs** — SIMD-accelerated JSON in CLI, MCP, and server (replaces serde_json)
37+
- **Zero-alloc FPSS hot path** — reusable frame buffer, tuple return (no Vec per frame),
38+
pre-allocated decode buffer, wrapping_add for delta parity
39+
- **Full SDK parity** — all FPSS methods (subscribe_full_trades, contract_lookup,
40+
active_subscriptions, etc.) exposed in Python, Go, C++, FFI
41+
- **Full trade stream docs** — explains the server's quote+trade+OHLC bundle behavior
42+
- **v3 REST API** — server routes match ThetaData's OpenAPI v3 spec (was v2)
43+
- **43 benchmarks** — 10 per-module bench files covering every hot path
44+
45+
### Fixed
46+
47+
- **SIMD FIT removed** — was 2.2x slower than scalar (regression). Pure scalar now.
48+
- **Server trade_greeks routes** — 5 option history trade_greeks endpoints were silently
49+
dropped due to subcategory mismatch in path generation
50+
- **All Gemini findings** — hot-path allocations, wrapping_add, BufWriter, find_header
51+
fallback, DATE marker handling, MCP sanitization, Price dedup
52+
- **All Codex findings** — server security (CORS, shutdown auth), CLI expect(), MCP
53+
JSON-RPC validation, stale docs
54+
- **Auth response parsing** — subscription fields are integers not strings
55+
56+
### Performance
57+
58+
- FPSS frame read: zero-alloc (reusable buffer)
59+
- FPSS decode: zero-alloc (tuple return, pre-allocated tick buffer)
60+
- Delta: wrapping_add (matches Java, no branch)
61+
- Required column validation (skip rows on missing headers, no garbage parse)
62+
- 43 criterion benchmarks across all modules
63+
864
## [1.2.2] - 2026-03-26
965

1066
### Added
@@ -41,17 +97,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4197
`Control(FpssControl)` for lifecycle events (LoginSuccess, Disconnected, MarketOpen, etc.),
4298
and `RawData` for unparsed frames. This enables `match` arms that handle all data without
4399
touching control flow, and vice versa — an intentional improvement not present in Java.
44-
- **SIMD FIT decoding** — SSE2-accelerated bulk nibble extraction on x86_64. Scans 16 bytes
45-
at a time for special nibbles (field/row separators, negative marker), reducing branch
46-
misprediction overhead in the FIT hot path.
47100
- **Streaming `_stream` endpoint variants**`stock_history_trade_stream`,
48101
`stock_history_quote_stream`, `option_history_trade_stream`, `option_history_quote_stream`
49102
process gRPC response chunks via callback without materializing the full response in memory.
50103
Ideal for endpoints returning millions of rows.
51104
- **Slab-recycled zstd decompressor** — thread-local `(Decompressor, Vec<u8>)` pair reuses
52105
the working buffer across calls. The internal slab retains its capacity, avoiding allocator
53106
pressure for repeated decompressions of similar-sized payloads.
54-
- **148 tests** — new tests for OHLCVC accumulator, FpssEvent split, SIMD FIT, and
107+
- **148 tests** — new tests for OHLCVC accumulator, FpssEvent split, and
55108
streaming endpoints.
56109

57110
### Fixed (PR #12)
@@ -135,8 +188,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
135188

136189
### Performance
137190

138-
- **SIMD FIT decoding** — SSE2-accelerated nibble extraction on x86_64 reduces per-tick
139-
decode latency for the FPSS hot path.
140191
- **Slab-recycled zstd** — thread-local decompressor reuses its working buffer, eliminating
141192
per-chunk allocation overhead.
142193
- **Streaming `_stream` endpoints** — process gRPC responses chunk-by-chunk without

0 commit comments

Comments
 (0)