Skip to content

6.0: ContractDetails event-contract fields; drop #[non_exhaustive] - #1251

Merged
wboayue merged 3 commits into
mainfrom
contract-details-fields
Nov 16, 2026
Merged

wboayue merged 3 commits into
mainfrom
contract-details-fields

Conversation

@wboayue

@wboayue wboayue commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Why

#1232 marked ContractDetails and TickRequestParameters #[non_exhaustive] so a 6.x release could add fields TWS sends but the decoder drops: minAlgoSize, last price/size precision, and the ForecastEx event-contract strings. B3 items 2–3 checked those fields against a live gateway before adding them:

Contract (paper, server 226) event-contract strings minAlgoSize price / size precision
AAPL STK absent "0" "0.000001" / "0.000001"
ES FUT, EUR.USD CASH, BTC CRYPTO absent "0" absent
FF on FORECASTX (62 rows) topic, label, full question "0" absent
  • The event-contract strings carry real data, so they're added now.
  • minAlgoSize was "0" on every row, including AAPL, which takes algo orders, so it's skipped.
  • The precision fields came only from AAPL, as a step finer than its minTick (0.01) and minSize (0.0001), and nothing documents what they govern. Also skipped. TickReqParams matched this.

With no field left to add, the attribute has no justification under the restrict-after-callers rule. Like ScannerData in #1234, it comes off before 6.0 ships.

What

Verified

  • The live probe above: raw ContractData capture walked field by field, 2026-11-15 23:52 ET.
  • Local gates: fmt, clippy ×3, rustdoc ×3, examples ×3, just test, integration crate clippy, just rules-check.

Decode eventContract1 / eventContractDescription1 / 2 as
event_contract_topic / description / question (live ForecastEx data).
A live probe found minAlgoSize "0" everywhere and the precision fields
only on AAPL with unclear meaning, so neither is added. With nothing left
to come, #[non_exhaustive] comes off ContractDetails and
TickRequestParameters before 6.0 ships; migration §35 rewritten.
…directive

- #[serde(default)] on the three event-contract fields, with a test that
  JSON without them deserializes; §35 says so
- TickReqParams precision fact moved to market-data.md; rustdoc cites
  entries by anchor and reads as user guidance
- restrict-after-callers: probe-first directive in the node body
- prose matches the field name (description, not label)
@wboayue
wboayue merged commit ec29364 into main Nov 16, 2026
7 checks passed
@wboayue
wboayue deleted the contract-details-fields branch November 16, 2026 06:17
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.

1 participant