Kalshi Event Resolution and Settlement API Workflow

Integrate event markets through Kalshi's state machine with simulators, not live capital.

· 9 min read
Cover illustration for “Kalshi Event Resolution and Settlement API Workflow”
Kalshi API Integration · October 19, 2026 · 9 min read · 1,923 words

Integration testing against stateful APIs requires a simulator that preserves state across calls, lets tests drive transitions, and reproduces failures without reaching production. The Kalshi event resolution and settlement API workflow shows why order matters, from an open market through determination to a settled position. For integrations to work reliably, they must follow that state machine through REST and WebSocket signals and test the same sequence without live capital or rate limits.

What the Kalshi settlement API is actually doing under the hood

Kalshi’s market schema makes resolution a formal state machine. Every binary market contract resolves to exactly one of two outcomes, but the integration must also distinguish an outcome from completed settlement. The market object shows that difference through status and its settlement fields. Those fields are result, which is yes/no, settlement_value_dollars, a fixed-point string, settlement_ts, a timestamp, and expiration_value, the data value that triggered resolution.

The event object provides the authority behind the outcome through settlement_sources, an array of named external data sources with URLs available before trading opens. Multivariate event markets add mve_selected_legs, which identifies each leg’s event ticker, market ticker, side, and yes_settlement_value_dollars. Their settlement therefore requires aggregation across legs. These relationships make state consistency essential, because a valid response read at the wrong stage can still produce an incorrect ledger. A pre-seeded stateful simulator, such as Rystic’s Kalshi simulator, lets developers exercise those relationships locally before exposing an integration to production capital.

The seven lifecycle states and what each one means for your integration

Diagram: The Eight Kalshi Market Lifecycle States, in Order. Visualizes: Visualize the ordered sequence of Kalshi market lifecycle states as a linear flow with branching correction paths.

The schema names eight status values, and initialized and inactive have the same non-trading behavior described here. In either state, the market exists but is not open, order book fields may be absent or zero, and trading is not allowed. Once the market is active, its quotes and activity fields become meaningful. These include yes_bid_dollars, yes_ask_dollars, no_bid_dollars, no_ask_dollars, volume_fp, and open_interest_fp. A move to closed ends trading and locks positions while the market awaits determination.

At determined, Kalshi’s resolution team has set the outcome against the designated settlement source. The response now contains result and settlement_value_dollars, and settlement_timer_seconds begins counting down. This outcome decision remains subject to review. Code that treats it as terminal skips the review path and risks recording a value that later changes.

That review path includes disputed, when the outcome is under review, and amended, when it has been corrected. An integration must update its recorded outcome when re-determination occurs. These states matter disproportionately in testing because they are difficult to encounter on demand. Only finalized means settlement is complete and irrevocable, with the position moved from the active portfolio to historical records.

The REST endpoints that cover the full lifecycle, in call order

The REST workflow moves through discovery, portfolio state, and completed records. Begin with GET /trade-api/v2/events, which returns event metadata including settlement_sources, strike_date, the mutually_exclusive flag, and embedded markets. For a metadata-only read, exclude_markets=true belongs on GET /events/{event_ticker}. Market retrieval can then use cursor pagination through GET /markets?event_ticker=...&limit=...&cursor=.... Discovery establishes which source governs resolution before portfolio reconciliation begins.

During trading and determination, GET /trade-api/v2/portfolio/positions provides the position view. Its settlement_status parameter accepts unsettled, settled, or all, and defaults to unsettled. Crucially, settled here is an interim category for resolved positions that have not yet moved to historical records. It is not interchangeable with a complete settlement record. Reading only the default view can therefore hide a position whose status has changed.

Read GET /trade-api/v2/portfolio/balance for cash balance in cents. Kalshi’s rate-limits page places this endpoint in its own bucket, separate from the general Read budget. That separation protects the general budget from balance requests, but does not make repeated balance reads unrestricted. Since balance changes only on fills, settlements, and transfers, the integration should use those events to trigger balance reads.

At completion, GET /trade-api/v2/portfolio/settlements supplies complete settlement records and is the primary reconciliation endpoint for settled markets still in the live data set. After archival, GET /historical/positions supplies the historical view instead.

WebSocket channels that deliver lifecycle and settlement events in real time

For prompt settlement handling, WebSocket supplies the trigger and REST supplies the authoritative record. The market_lifecycle_v2 channel emits lifecycle transitions as they occur. Its determined event carries settlement_value, a fixed-point dollar string that gives the settlement price. That signal can start downstream reads of positions and settlement records rather than leave reconciliation waiting for a polling interval. The different field names matter, because REST exposes settlement_value_dollars while this event carries settlement_value.

MVE markets use the separate multivariate_market_lifecycle channel. Kalshi’s changelog names its messages as created, activated, deactivated, close_date_updated, determined, and settled. Reconciliation correlates the determination signal with each leg’s yes_settlement_value_dollars from REST. The channel tells the integration when to act, while the market object provides the per-leg detail needed to interpret the outcome.

Kalshi’s changelog also recommends using the user fills channel to trigger balance reads. A fill event on a determined market can trigger reads of the updated balance and settlement record. However, events can arrive out of order or be missed during reconnects, so push messages cannot replace REST reconciliation. A determination message also cannot override a subsequent dispute or amendment.

Why testing the settlement workflow against a live environment is structurally unreliable

A live or demo environment leaves the decisive transitions outside the developer’s control. Determination, dispute, amendment, and finalization depend on external resolution or internal review. A test may therefore wait for a demo market to reach determined without knowing when it will happen. The disputed and amended paths are practically unreachable on demand. A passing happy-path run says little about whether correction handling works.

Kalshi’s demo environment remains useful for authentication and basic connectivity. However, its different base URLs and potentially simulated liquidity do not give a test control over resolution. Demo also has per-key rate limits, so reconciliation runs that keep reading balance use its dedicated bucket. Mixing demo and production base URLs introduces credential-exposure and accidental-order risks.

A connectivity check can show that a request succeeds, but it cannot prove that an integration handles a corrected outcome or a missed notification. Nor can a scheduled CI run depend reliably on an externally timed settlement. To test those conditions, developers need to control both the state and when failures occur.

What a stateful simulator must model to be a valid stand-in for the Kalshi settlement workflow

A valid simulator must preserve the consequences of earlier calls. Creating a position must make it visible under settlement_status=unsettled, and determination must populate result and settlement_value_dollars. Finalization must move the position into settlement records and clear it from the active position view. A stateless response fixture can imitate those outputs, with their apparent consistency supplied by fixture configuration.

To replace externally timed resolution, lifecycle controls must drive markets through active, closed, determined, and finalized on demand. They must also expose the disputed and amended paths so tests can challenge premature ledger updates. With realistic pre-seeded markets and positions, developers can run useful tests without first building every fixture. For MVE workflows, the model must retain per-leg settlement values and the corresponding lifecycle signals. Otherwise, binary-market coverage leaves the aggregation path untested.

Failure controls must reproduce 429 responses from balance, transient 503 responses from positions, and latency that challenges reconciliation timing. These controls turn unpredictable interruptions into repeatable assertions. Fidelity verification must also check the simulator against the real API, because even when state logic works, old field names can make tests look sound when they are not. Kalshi’s October 2026 schema corrections illustrate why response shapes need ongoing attention. State persistence, transition control, fault injection, realistic data, and fidelity together define a useful stand-in.

How Rystic's Kalshi simulator covers the full settlement lifecycle in local and CI environments

Rystic’s Kalshi simulator keeps state across calls so each call sees the results of all earlier calls. A position can be added, listed, advanced through determination, and reconciled against a balance reflecting settlement credit. Its lifecycle controls expose disputed and amended outcomes on demand. Pre-seeded markets in different lifecycle states and positions with different settlement statuses save developers the work of building those fixtures. MVE support models per-leg values and the multivariate lifecycle event sequence.

For controlled failure testing, Rystic’s Pro and Enterprise tiers include fault injection covering 429, 503, and latency. That lets a reconciliation loop hit a balance-bucket failure without using up the real bucket. The same mechanism can interrupt position reads and test whether retries preserve the workflow’s result.

Rystic describes a separate fidelity process in which the same requests go to the live API and simulator before every release. Its website shows agreement scores from those comparisons. That process matters because local determinism alone cannot establish compatibility with Kalshi’s evolving schema and behavior. Settlement tests can then run locally or in containers without Kalshi credentials, while Enterprise also lets them run fully offline and in air-gapped deployments.

A concrete test sequence for the settlement workflow using the simulator

First, call GET /trade-api/v2/events and identify the known event. Assert that settlement_sources is populated and the embedded market is active. Second, call GET /trade-api/v2/portfolio/positions with settlement_status=unsettled. Assert that the position has the expected market ticker and side. Third, read GET /trade-api/v2/portfolio/balance and keep the pre-settlement value as the baseline for checking the credit.

Fourth, use the simulator’s lifecycle control to advance the market to determined and supply settlement_value_dollars. Read the event again. Assert that result and the settlement value are populated. Also assert that market_lifecycle_v2 emits a determined event containing settlement_value. Fifth, query positions with settlement_status=settled and confirm that the position appears there but no longer under unsettled.

Sixth, advance the market to finalized and read GET /trade-api/v2/portfolio/settlements. Assert that the record contains the correct amount, then read balance and assert the expected settlement credit against the baseline. Seventh, repeat the determination and completion checks through determined, disputed, amended, and back to determined with a corrected value. Assert that the integration replaces its earlier outcome rather than treating the first determination as final. This is the critical correction test that demo cannot make reliably available.

Finally, rerun the sequence with 429 injection on balance and 503 injection on positions. Assert that the retry logic runs and that reconciliation finishes with the correct results. The test now covers both ordered state changes and interrupted access to that state. Its result depends on the integration’s handling of the sequence.

Running the settlement test sequence in CI without live credentials

Start the simulator as a sidecar service, using a Docker container or local process, and point the integration’s base URL at it. Run the settlement sequence against a clean simulator state for each CI run. This isolates assertions from positions left by earlier runs and removes shared-market timing from pass or fail. No Kalshi API key, RSA-PSS signature setup, or clock-synced machine is required for the simulator. Testing authentication against demo is separate from testing settlement for regressions.

Within that isolated run, schedule balance 429 injection on specific calls. The same settlement assertions can then exercise normal and interrupted execution on every commit. Rate-limit behavior becomes an explicit test condition instead of an incidental restriction on the pipeline. This turns the workflow into a regression test whose inputs and transitions are controlled.

That isolation also supports evaluations where agents call the settlement API as a tool. Rystic’s Enterprise plans support many simultaneous containers for RL environments and LLM-agent evaluation. Thousands of parallel episodes can each have an isolated, stateful exchange to settle against. At either scale, a useful evaluation needs the effects of each action to last through determination, correction, and final settlement.

Sources

  1. Get Events - API Documentation
  2. API Changelog - API Documentation

More in Kalshi API Integration