Skip to content

PR3: backfill v3.18.0 fields on communications / order_groups #161

Description

@TexasCoding

Context

Backfills remaining spec v3.18.0 fields on the RFQ/Quote (communications) and OrderGroup surfaces. Closes the response-side drift on the kalshi.models.communications.* and kalshi.models.order_groups.* models.

Depends on #158. Independent of #159, #160, #PR4 — can land in parallel.

Scope

Files

  • kalshi/models/communications.py — add 1 to RFQ, 3 to Quote
  • kalshi/models/order_groups.py — add 1 to OrderGroup, 1 to GetOrderGroupResponse, 2 to CreateOrderGroupResponse
  • Tests: extend the existing communications + order_groups test suites

Field-level changes

communications.RFQ (+1):

Field Spec type SDK type Notes
creator_subaccount integer int | None = None subaccount index of the RFQ creator

communications.Quote (+3):

Field Spec type SDK type Notes
creator_subaccount integer int | None = None quote creator's subaccount
post_only boolean bool | None = None mirrors CreateQuoteRequest.post_only (already on the request side from v2.1.0)
rfq_creator_subaccount integer int | None = None RFQ creator's subaccount, surfaced on the quote

order_groups.OrderGroup (+1):

Field Spec type SDK type Notes
exchange_index integer int | None = None mirrors Market/Order/Event

order_groups.GetOrderGroupResponse (+1):

Field Spec type SDK type Notes
exchange_index integer int | None = None

order_groups.CreateOrderGroupResponse (+2):

Field Spec type SDK type Notes
exchange_index integer int | None = None
subaccount integer int | None = None server echoes the subaccount the group was created against

Conventions

Same as #159, #160.

Acceptance criteria

  • These five parameterized cases pass without warnings:
    • tests/test_contracts.py::TestSpecDrift::test_additive_drift[RFQ]
    • tests/test_contracts.py::TestSpecDrift::test_additive_drift[Quote]
    • tests/test_contracts.py::TestSpecDrift::test_additive_drift[OrderGroup]
    • tests/test_contracts.py::TestSpecDrift::test_additive_drift[GetOrderGroupResponse]
    • tests/test_contracts.py::TestSpecDrift::test_additive_drift[CreateOrderGroupResponse]
  • uv run pytest tests/ -q --ignore=tests/integration passes.
  • uv run mypy kalshi/ strict-clean.
  • uv run ruff check . clean.
  • At least one (de)serialization test per backfilled model.

Notes

  • Quote.post_only is a server echo of the value passed on CreateQuoteRequest — verify in the spec that it returns on Quote (not just on CreateQuoteResponse). Should mirror.
  • CreateOrderGroupResponse.subaccount is distinct from CreateOrderGroupResponse.exchange_index. Both are surfaced together because the server echoes the routing context.

Effort

~30 lines model code + ~15 lines tests.

Part of the response-side spec drift hardening stack.


Tracking: #157.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestspec-driftUpstream OpenAPI/AsyncAPI spec changed since last sync

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions