Skip to content

CreateOrderV2Request docstring references nonexistent FixedPointDollars Python type #339

Closed

Description

@TexasCoding

Problem

The CreateOrderV2Request docstring introduces V2's pricing convention as price: FixedPointDollars. There is no Python type named FixedPointDollars exported by the SDK — kalshi/types.py exposes DollarDecimal, FixedPointCount, MultiplierDecimal, NullableList, UnixSecondsTimestamp, and StrictInt. The actual annotation a few lines down is DollarDecimal. (FixedPointDollars is the OpenAPI wire schema name, but it never names a Python alias — and the comment in markets.py has the same drift.)

Readers chase a phantom alias when reading the docstring; mkdocs autodoc surfaces this prose on the published reference site.

Evidence

  • kalshi/models/orders.py:467 — docstring claim
- Price is a single ``price: FixedPointDollars`` field rather than the
  paired ``yes_price`` / ``no_price`` from V1.
  • kalshi/models/orders.py:475 — actual annotation
price: DollarDecimal
  • kalshi/models/markets.py:35 — same drift
# Price fields (FixedPointDollars)
  • kalshi/types.py:50 — DollarDecimal is the real alias; no FixedPointDollars.

Suggested fix

Replace FixedPointDollars with DollarDecimal in the docstring at kalshi/models/orders.py:467. Update the comment at kalshi/models/markets.py:35 to # Price fields (DollarDecimal — wire shape: FixedPointDollars string) so the wire schema name is preserved but the Python type is unambiguous. (Other occurrences in docs/types.md, docs/resources/index.md, docs/migration.md, and the test files refer to the wire schema name and are correct as-is.)

Source

Round-3 independent audit (reviewer: models_contracts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions