Skip to content

feat(markets): concert cancellation markets + perps estimate quantity_fp (#582) — 22.14.0 - #583

Merged
TexasCoding merged 2 commits into
mainfrom
fix/582-concert-cancellation
Nov 13, 2026
Merged

TexasCoding merged 2 commits into
mainfrom
fix/582-concert-cancellation

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Closes #582

Reconciles the 2026-11-13 Spec Drift Detection failure (run 43436779911). Release: 22.14.0 (minor, additive only).

What changed

  • Concert cancellation markets (core, tag markets), sync + async on markets:
    • create_concert_cancellation_market(...) → POST /concert_cancellation_markets (auth, never retried; request= model or keyword fields; body CreateConcertCancellationMarketRequest, extra="forbid")
    • concert_cancellation_availability(*, date_from=None, date_to=None) → GET /concert_cancellation_markets/availability (public)
    • list_concerts(*, metro_id, date_from=None, date_to=None, page=None) → GET /concert_cancellation_markets/concerts (auth)
    • search_concerts(*, q) → GET /concert_cancellation_markets/concerts/search (auth)
    • New models: ConcertCoverLiteral, CreateConcertCancellationMarketRequest/Response, ConcertMetro, GetConcertCancellationAvailabilityResponse, ConcertMarket, Concert, GetConcertsResponse, SearchConcertsResponse (lists are NullableList → [] on null).
  • Perps Klear EstimatePortfolioMaintenanceMarginPosition: quantity now optional, new optional quantity_fp (FixedPointCount, sent as a string). At least one is required; zero is rejected.
  • Spec sync: core openapi (also descriptions; deprecated Market.expiration_time dropped upstream, SDK field kept to avoid a breaking change), asyncapi (description-only), perps openapi (description-only), perps_scm.
  • Registered in METHOD_ENDPOINT_MAP, BODY_MODEL_MAP, _contract_map.py. Docs: docs/resources/markets.md, docs/perps.md, op counts 141 mapped of 142 (README, docs/index.md, CLAUDE.md), CHANGELOG 22.14.0. Version bump 22.14.0.

Blast radius (hand-written; GitNexus unavailable)

  • kalshi/resources/markets.py: four new methods + one new body-builder helper on MarketsResource/AsyncMarketsResource. No existing method touched. Risk: LOW.
  • kalshi/models/markets.py: new classes appended only. LOW.
  • kalshi/perps/klear/models/margin.py EstimatePortfolioMaintenanceMarginPosition: used only by perps.klear.margin.estimate_maintenance_margin (sync/async). Existing callers passing quantity behave unchanged; body unchanged when quantity_fp unset (exclude_none). Type of .quantity becomes int | None (only matters for code reading the attribute off a request model). LOW–MEDIUM.
  • Exports in kalshi/__init__.py / kalshi/models/__init__.py: additions only.
  • Tests/contract registries: additions only.

Gates (local, final code)

  • uv run ruff check . — passed
  • uv run mypy kalshi/ — passed (162 files)
  • uv run pytest tests/ --ignore=tests/integration -q — 5352 passed, 3 skipped
  • uv run pytest tests/test_contracts.py -W error::UserWarning — 983 passed

@TexasCoding
TexasCoding merged commit 992aa55 into main Nov 13, 2026
6 checks passed
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.

Nightly spec-drift: strict contract tests failing (since 2026-11-13)

1 participant