Skip to main content
⚠ Live in production, still flag-gated — read before you write code Every perpetual surface — REST and WebSocket alike — is behind one rollout flag, enabled in production and staging today. Where it is off, the surface does not exist rather than erroring usefully: /perpetuals/venues, /perpetuals/instruments and the snapshot all return 404, and the WebSocket refuses a perps_book subscription. Do not read that 404 as an outage or a bad identifier. Contracts remain beta and carry no SLA, and three pages in this chapter are design previews with nothing callable behind them. See Availability and guarantees.
Point your integration at the production hosts: Perpetual futures are non-expiring leveraged instruments. They share familiar market-data concepts with prediction markets — books, trades, and candles — but require different identity, pricing, funding, margin, risk, and position semantics. This chapter covers what is different. Kairos standardizes Hyperliquid, Polymarket Perps, and Kalshi Margin without hiding venue-specific facts or inventing conversions. Perpetuals are not a separate API. They ride the same REST service (Market Data) and the same WebSocket gateway (Market Data Stream) as prediction markets, with the same auth and error envelopes.
Never apply prediction-market probability math here. Perpetual prices are direct venue prices, not 0–100 probabilities. Dividing one by 100 produces a silently wrong number.
Hyperliquid is two products. Its HIP-4 outcome markets are prediction markets (provider: "hyperliquid", venue coins like #1210); its perpetuals are bare coins (provider: "hyperliquid_perps", BTC / kPEPE). Different id schemes, different price scales, separate decoders. See Venue normalization.

Identifier asymmetry: REST vs WebSocket

This is the single most common integration mistake in this chapter. The canonical id is returned in the REST snapshot body as canonical_instrument_id, and by GET /perpetuals/instruments. Do not swap them. The venue slugs differ too — see Venue normalization.
A wrong id fails differently on each surface. REST answers 400 or 502. The WebSocket accepts the subscription, acknowledges it, and then never delivers a frame — the gateway does not check the id against the catalog. Silence is the only symptom.

Live snapshot

One composite read of a perpetual market: an ordered book, market state, recent trades, one-minute candles, and funding observations, all from the venue’s public HTTP API. It also carries the canonical instrument key and the minimum asset, price-unit, quantity-unit, multiplier, and notional context required to interpret that data safely. Auth: the standard Market Data API-key headers, or anonymous on the free tier. heavy bucket, 6 units per call.

Request

The depth default is per venue on purpose: a flat default would mark every Hyperliquid snapshot depth-limited for no reason and ask Kalshi for less book than it has.

Example

Response

Every financial value is a decimal string. Prices, quantities, volumes, rates, and multipliers never cross the boundary as a JSON number. See Exact values and time.
Every timestamp is a nanosecond JSON number, already past 2^53. fetched_at_ns, event_time_ns, observed_time_ns, interval_start_ns and friends will lose precision if parsed as a JavaScript Number. Parse them as BigInt or as text. See Exact values and time.

Errors

Errors use the shared Market Data API envelope, {"error": {"code": …, "message": …}}.
502 is also how “stale” is reported. The snapshot fails closed rather than serving a partially old body: any component outside its freshness fence returns 502 upstream. The fences are tabulated in Availability and guarantees.

Notes

The snapshot is Cache-Control: no-store. The Market Data API coalesces bursts behind a one-second replica-local cache, and concurrent requests for the same (venue, instrument, depth) share one in-flight fetch. Quantity units differ by venue and must not be collapsed:
notional_formula can say “I don’t know.” It is unavailable_contract_multiplier when Kairos cannot prove the conversion — today that is Polymarket Perps. Do not invent a multiplier. Hyperliquid and Kalshi Margin both report quantity_times_price, and Kalshi additionally carries the venue’s contract_size as contract_multiplier.

Book stream

The WebSocket gateway exposes one perps topic, perps_book. It delivers kairos.v2.BookSnapshot frames for all three venues and replays the latest validated frame on subscribe when one is cached. Automatic catalog enrollment keeps books warm without relying on a subscriber-created presence lease. Perps are v2-only. There is no parallel v1 perpetual book contract to reconcile or deprecate. See Streaming and recovery for the byte-level frame and consumer algorithm.

The other beta surfaces

Full instrument rules and discovery are owned by the Python API, not by the snapshot endpoint.

What is shared with prediction markets

What is new

  • Non-expiring instrument identity and asset roles
  • Exact decimal values with explicit quantity units
  • Mark, index, oracle, mid, and other typed price sources
  • Funding observations, predictions, settlements, and account ledger entries
  • Cross, isolated, and venue-specific margin modes
  • Position episodes, account risk, maintenance tiers, and liquidation events
  • Reconnect epochs, book-view identities, revision state, and recovery fences

Design principles

  1. Preserve facts. Native identifiers, units, clocks, and source metadata remain available after normalization.
  2. Never guess. Kairos does not infer a multiplier, liquidation, side, or conversion that the venue does not prove.
  3. Exact values at boundaries. Prices, quantities, rates, balances, and notionals do not cross service boundaries as binary floating-point values.
  4. Absence is not zero. Missing, unavailable, stale, and zero are different states.
  5. Recovery is part of the contract. A stream consumer can determine when state is valid, detect gaps, and rebuild deterministically.
  6. Shared shapes, separate semantics. Reuse is preferred when the economic meaning is the same; venue extensions remain explicit when it is not.

Current availability

Beta fields and availability can change before general availability. Private account data, order entry, and an SLA remain outside the public market-data beta — see Availability and guarantees for the exact boundary.

Read this chapter