Skip to content

feat(incentive_programs): incentive schedules + series/event filters (#580) — 22.13.0 - #581

Merged
TexasCoding merged 1 commit into
mainfrom
fix/580-incentive-schedules
Nov 12, 2026
Merged

TexasCoding merged 1 commit into
mainfrom
fix/580-incentive-schedules

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Closes #580

Reconciles the 2026-11-12 spec drift (Spec Drift Detection run 43237744594) and releases as 22.13.0 (additive minor).

Changes

  • New incentive_programs.list_schedules() (sync + async) — GET /incentive_schedules, returns list[IncentiveSchedule]. New models IncentiveSchedule, GetIncentiveSchedulesResponse (exported). Public GET, normal GET retry.
  • incentive_programs.list / list_all (sync + async): new keyword-only optional series_ticker, event_ticker query params, sent only when set.
  • IncentiveProgram: new optional series_ticker, event_ticker fields.
  • Same sync, other drift covered:
    • Perps GetMarginBalanceResponse.settled_funds → DollarDecimal | None (spec dropped it from required; omitted for subaccount-restricted keys).
    • Perps WS PerpsLastUpdateReason gains CloseCancel, HaltCancel, SettlementBoundsCancel (spec enum; the first two were already missing).
    • Perps funding-history subaccount param inlined (same name/type) and description-only text changes: no code change.
  • Contracts: METHOD_ENDPOINT_MAP entry for /incentive_schedules; _contract_map.py entries for both new models; server_omits_despite_required exclusions for IncentiveSchedule.event_ticker / event_title (empty for whole-series schedules) and GetIncentiveSchedulesResponse.schedules (defaults to []).
  • Docs: docs/resources/incentive-programs.md, op counts (137 mapped of 138) in README / docs/index.md / CLAUDE.md, CHANGELOG 22.13.0. Version bump in pyproject.toml + kalshi/__init__.py.

Blast radius (hand-written; GitNexus unavailable)

  • IncentiveProgramsResource / AsyncIncentiveProgramsResource: new kwargs are keyword-only with None defaults — existing calls send identical requests. New method is additive.
  • IncentiveProgram: two optional fields; existing payloads parse unchanged.
  • GetMarginBalanceResponse.settled_funds: now Optional. Runtime: payloads that previously raised validation errors (restricted keys) now parse. Typing: strict-mypy callers doing arithmetic on it may need a None check. Only consumer in SDK is the perps margin account resource (returns the model as-is).
  • PerpsLastUpdateReason: Literal widened; only used by the perps WS orderbook delta model. Previously these values failed validation.
  • No changes to transport, retry, auth, or kalshi/_generated/ (gitignored, regenerated).

Gates (local)

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

@TexasCoding
TexasCoding merged commit d888bad into main Nov 12, 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-12)

1 participant