Commit 5fedaf6
authored
fix: align endpoint docs with upstream operations + interval normaliser (#527)
* docs(option/history): align option_history_quote with upstream
Mirror the upstream operation spec at docs.thetadata.us/operations/
option_history_quote.html. The previous doc claimed `interval="0"`
returned every quote change tick-by-tick; that value is not in the
upstream enum and the SDK silently normalises it to `100ms`. Replace
with the documented presets (tick / 10ms / .../ 1h) and default 1s.
Mark `strike` and `right` optional (default `*` and `both`); they are
optional at the wire level and the SDK builder treats them the same
way. Correct `start_time` / `end_time` to HH:MM:SS.SSS wall-clock with
the upstream defaults (09:30:00 / 16:00:00). Add `start_date` /
`end_date` for multi-day requests and document the one-month / must-
specify-expiration constraints called out by the upstream spec.
Refs ThetaData v3 spec for /v3/option/history/quote.
* docs(option/history): align trade/ohlc/eod/open_interest/trade_quote
Mirror the upstream operation specs at docs.thetadata.us/operations/
for the option_history_{trade, ohlc, eod, open_interest, trade_quote}
endpoints.
Common fixes across the family:
- strike and right are optional with default `*` and `both` (the SDK
was already constructing the wire wildcards through wire_strike_opt
/ wire_right_opt; only the doc badge was wrong).
- start_time / end_time take HH:MM:SS.SSS wall-clock with defaults
09:30:00 / 16:00:00, not 'milliseconds from midnight'.
- expiration accepts YYYY-MM-DD as well as YYYYMMDD, plus `*` for
all expirations.
- Add start_date / end_date as builder optionals; document the
single-`date` override semantics from upstream.
- Call out the upstream one-month / must-specify-expiration ceiling
on multi-day requests.
ohlc additionally pulls the new `tick` and `10ms` presets into the
interval enum and marks interval optional with default `1s`.
trade_quote additionally documents the `exclusive` flag with its
upstream `true` default.
* docs(option/history): align greeks family with upstream
Apply the same parity sweep to the 11 greeks endpoints:
option_history_greeks_{all, eod, implied_volatility, first_order,
second_order, third_order} and
option_history_trade_greeks_{all, implied_volatility, first_order,
second_order, third_order}.
For each:
- strike / right marked optional with upstream defaults (`*` / `both`)
- start_time / end_time documented as HH:MM:SS.SSS with the upstream
09:30:00 / 16:00:00 defaults
- expiration accepts YYYY-MM-DD and YYYYMMDD plus `*`
- interval (where applicable) marked optional, default `1s`, enum
extended to include `tick` and `10ms`
- Greeks inputs (annual_dividend, rate_type with full Treasury enum,
rate_value, version) documented with their upstream defaults and
allowed values
- start_date / end_date listed as builder optionals on the intraday
greeks endpoints; greeks_eod keeps start_date / end_date required
per upstream
- underlyer_use_nbbo (greeks_eod only) documents its `false` default
Multi-day one-month / must-specify-expiration ceiling called out where
upstream documents it.
* docs(option/{at_time,snapshot,list}): align param surface with upstream
Same parity sweep as the option/history family — strike and right are
optional with default `*` and `both`; min_time on snapshot endpoints
is HH:MM:SS.SSS, not milliseconds; expiration accepts YYYY-MM-DD and
wildcard `*`; Greeks-input defaults documented.
option_list_dates and option_list_contracts: request_type lower-case
trade/quote is the upstream enum; SDK still accepts the historical
TRADE/QUOTE casing.
option_list_strikes already mirrored upstream exactly — no change
needed.
* docs(stock,index): align interval / time / venue surface with upstream
Apply the same parity sweep to the stock and index history /
snapshot / at_time pages. interval is optional with a `1s` default
and the upstream enum extended to `tick` and `10ms`. start_time /
end_time are documented as HH:MM:SS.SSS ET wall-clock with the
upstream 09:30:00 / 16:00:00 defaults instead of 'milliseconds from
midnight'. The `Use "0"` claim is removed across the board — the
SDK does not have a tick-by-tick sentinel that maps to a real
upstream value, and the doc was implying behaviour the wire does
not expose.
venue (stock-only) is documented with the upstream `nqb` / `utp_cta`
enum and `nqb` default. min_time on stock snapshots takes the same
HH:MM:SS.SSS form.
stock_history_trade_quote: exclusive flag documented with the `true`
upstream default.
* fix(mdds): align interval normalisation and validator with upstream
normalize_interval now maps `"0"` to `"tick"` instead of `"100ms"`.
The historical mapping contradicted the previously-documented
every-event semantics — the upstream enum spells that as `tick`, and
the SDK silently downgraded user requests to a 100ms sample without
warning. Mapping `0` to `tick` makes the behaviour match the doc
without breaking callers that picked an interval explicitly. The
small-ms snap range now also exposes `10ms`, which is the upstream
preset between `tick` and `100ms` that the SDK previously skipped.
validate_interval (CLI / MCP entry point) now enforces the upstream
enum verbatim plus the SDK's millisecond shorthand. Garbage strings
like `"twosec"` are rejected up front with a typed error listing the
accepted values, instead of being passed through to the gRPC layer
where they used to surface as opaque server-side rejections.
Mirrors the upstream operation specs at
`docs.thetadata.us/operations/option_history_quote.html` (and the
other 14 endpoints that carry an `interval` parameter).
* docs(option/history): drop duplicate greeks_eod param block + zero-sentinel
The earlier rewrite left a stale copy of the pre-alignment param
list at the bottom of greeks_eod.md, which broke the VitePress
build. Remove the duplicate and rewrite the option_history_eod
multi-strike note to use the upstream `strike="*"` wildcard
vocabulary instead of the SDK-only `"0"` sentinel that contradicted
the rest of the alignment sweep.1 parent a253648 commit 5fedaf6
47 files changed
Lines changed: 657 additions & 409 deletions
File tree
- crates/thetadatadx/src/mdds
- docs-site/docs/historical
- index-data
- history
- snapshot
- option
- at-time
- history
- list
- snapshot
- stock
- at-time
- history
- snapshot
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
116 | 125 | | |
117 | 126 | | |
118 | 127 | | |
119 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
120 | 131 | | |
121 | 132 | | |
122 | 133 | | |
| |||
269 | 280 | | |
270 | 281 | | |
271 | 282 | | |
| 283 | + | |
| 284 | + | |
272 | 285 | | |
273 | 286 | | |
274 | 287 | | |
| |||
281 | 294 | | |
282 | 295 | | |
283 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
284 | 315 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
91 | 105 | | |
92 | | - | |
| 106 | + | |
93 | 107 | | |
94 | | - | |
| 108 | + | |
| 109 | + | |
95 | 110 | | |
96 | 111 | | |
97 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
98 | 125 | | |
99 | 126 | | |
100 | 127 | | |
| |||
241 | 268 | | |
242 | 269 | | |
243 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
244 | 288 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments