Skip to content

feat(perps): margin corporate actions endpoint (#550); release 22.2.0 - #551

Merged
TexasCoding merged 1 commit into
mainfrom
fix/550-corporate-actions
Oct 20, 2026
Merged

TexasCoding merged 1 commit into
mainfrom
fix/550-corporate-actions

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Closes #550

Summary

Kalshi added the public perps endpoint GET /margin/corporate_actions, which made test_every_spec_endpoint_is_mapped[perps] fail in the nightly spec-drift run.

  • Re-synced all vendored specs (scripts/sync_spec.py) and regenerated kalshi/_generated (scripts/generate.py, no hand edits).
  • New perps.margin.corporate_actions(*, ticker=None, market_id=None) sync + async. Public (no auth), per the spec.
  • New Pydantic models: GetMarginCorporateActionsResponse, MarginCorporateAction, and cash / split / final_settlement / ticker_change terms. FixedPointDollars amounts are DollarDecimal. Terms and execution_time are optional because cancelled notices leave them out.
  • Registered in kalshi/_contract_map.py and tests/_contract_support.py.
  • PerpsChannel.CORPORATE_ACTIONS added so the WS channel enum matches the re-synced perps AsyncAPI.
  • Tests: happy path, 400/500 errors, cancelled notice with no terms, empty list, query filters, sync + async.
  • Version 22.2.0 (additive, minor). CHANGELOG and docs/perps.md updated.

Blast radius (hand-written; GitNexus unavailable)

  • kalshi/perps/models/margin_account.py, kalshi/perps/resources/margin_account.py: new code only; existing methods unchanged.
  • kalshi/perps/__init__.py, kalshi/perps/models/__init__.py: new exports only.
  • kalshi/perps/ws/models/control.py, kalshi/perps/ws/client.py: one new enum member; existing subscriptions unchanged.
  • Contract maps, tests, docs, specs, version files.
  • No breaking changes for existing callers.

Gates

  • ruff check .: pass
  • mypy kalshi/: pass
  • pytest tests/ --ignore=tests/integration -q: 4757 passed, 3 skipped
  • pytest tests/test_contracts.py -W error::UserWarning: 864 passed

@TexasCoding
TexasCoding merged commit f95c492 into main Oct 20, 2026
6 checks passed
@TexasCoding
TexasCoding deleted the fix/550-corporate-actions branch November 1, 2026 12:33
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-10-20)

1 participant