https://rfq.kairos.trade.
Authentication
Two credential forms are accepted. API credentials use all three headers together:RS256, issuer kairos.trade, audience
kairos-api, with sub, jti, sid, and ver: 1 claims and required iat
and exp. A token whose lifetime exceeds 24 hours is refused.
Every credential, API key or JWT, is checked for revocation on connect and, on
a WebSocket, again every 30 seconds. Authentication fails closed with
503 auth_dependency_unavailable when the credential or its revocation status
cannot be verified.
API-credential principals carry the scopes stored on the credential, and an
ipWhitelist on the credential is enforced against the client IP. A credential
bound to an external signing wallet cannot use the RFQ API and gets
403 forbidden.
Gotcha: an IP-allowlist miss is a
403, not a 401. A non-allowlisted
source gets 403 forbidden, which is easy to misread as a scope problem.
Check the source address before you re-issue credentials.Scopes
The scope
* satisfies every check.
A Kairos API token also carries the RFQ scopes its preset implies. A read-only
token (read, trade:read) gets rfq:read. A trading token (trade:execute)
gets rfq:read, rfq:create, rfq:quote, and rfq:accept.
Gotcha: a JWT with no
scopes claim cannot quote. It is granted
rfq:read, rfq:create, and rfq:accept — not rfq:quote. Market
makers need a credential that carries rfq:quote explicitly.Endpoint index
/v1/venues/capabilities needs authentication but no particular scope.
Rules that apply to every request
The requester flow
- Check venue capabilities.
GET /v1/venues/capabilitiestells you what each venue currently supports. Do this before selectingvenues— see Create an RFQ for what happens when a venue cannot accept requester fanout. - Create the RFQ.
POST /v1/rfqswith a freshIdempotency-Keyreturns201and anrfq_id. - Watch for quotes. Connect to
GET /v1/streamand consumequote.created/quote.revised/quote.withdrawn, or pollGET /v1/rfqs/{rfq_id}/quotes. - Accept one.
POST /v1/quotes/{quote_id}/acceptreturns202and an acceptance inpending_routing. This reserves quantity; it does not fill. - Follow the acceptance to a terminal state via
GET /v1/executions/{acceptance_id}or theacceptance.*events.executedalso emitsexecution.normalized.v1. - Cancel what you no longer want.
POST /v1/rfqs/{rfq_id}/cancelmoves the RFQ tocancelledand its live quotes towithdrawn.
The market-maker flow
- Confirm your credential carries
rfq:quote. A scopeless JWT does not. - Discover open venue RFQs with
GET /v1/exchange-rfqs, or consume the maker broadcast stream, which callers holdingrfq:quotereceive onGET /v1/stream. - Quote it.
POST /v1/quotesreturns201. - Revise or withdraw.
PUT /v1/quotes/{quote_id}requires the new revision to be exactlycurrent + 1;DELETE /v1/quotes/{quote_id}withdraws. - Watch
quote.dispositionand theacceptance.*events for the outcome. - Confirm Kalshi fills. On a venue that routes maker quotes, a quote is
placed on the venue before
POST /v1/quotesreturns. A Kalshi requester’s acceptance does not execute your quote: you receivequote.venue_acceptedwith the tradedside,price,quantity, and aconfirm_bydeadline (30 seconds, 3 seconds for combos). CallPOST /v1/quotes/{quote_id}/confirmwith{"revision": <accepted revision>}before it passes. Kairos never confirms for you. A confirmed quote isfilled. This step applies only while Kalshi reportsresponder_rfq: true; it doesn’t onrfq.kairos.tradeyet (see Provide liquidity).
Create an RFQ
201.
Scope: rfq:create. Requires an Idempotency-Key header.
Example
Validation
A request that breaks any of these is rejected400 invalid_request.
Decimal quantities and prices are strings. A leg’s
ratio is signed: positive
buys outcome, negative sells it.
Baskets and combos
Several plain legs form a basket: the package pays the sum ofratio ×
each leg’s payoff, and each leg needs a market_id. A leg that carries a
combo object is a combo (parlay): one venue instrument that pays only if
every component outcome occurs.
combo.venue defaults to the leg’s source_venue. combo.instrument_id is
the Kalshi multivariate market ticker or the Polymarket combo condition ID;
Polymarket derives it from the components when you omit it. A combo is never
routed to any venue other than its own. Check combos,
min_combo_components, and max_combo_components in
/v1/venues/capabilities.
Venue targets
Each venue you select appears in the RFQ’stargets with a state:
pending (awaiting dispatch), submitted (accepted by the venue adapter),
quoted, rejected (the venue declined or could not quote), or excluded
(never sent, with a reason). Each change emits rfq.target_updated.
Gotchas
Idempotency binds the body. Keys are(principal, operation, key). Replaying a key with the same body returns the resource the first call created and never performs a second mutation. The same key with a different body returns422 idempotency_key_reused. Treat a key as bound to one command.
Requester fanout is not live yet. No venue onrfq.kairos.tradereportsrequester_rfq: truetoday, so each entry invenuescomes back as atargetsentry withstate: "excluded"and areason, plus amapping_warningsentry. The201is not evidence that anything reached a venue. Read/v1/venues/capabilitiesbefore relying on fanout.
List your RFQs
rfq:read.
Discover venue RFQs
rfq:quote.
Example
Response
Results are expiry ordered and include an opaquenext_cursor plus
observed_at, which reports the local projection’s last mutation time. Each
entry in recently_closed carries its terminal state, closed_at, and a
close_reason such as rfq_deleted or deadline_passed. A Polymarket combo
auction lasts about 400 ms, so a poll rarely sees one open.
A venue RFQ sized only in currency carries notional instead of
package_quantity and remaining_quantity. One that Kairos cannot quote
carries unsupported_reason, and a quote on it returns invalid_request.
Errors
Lifecycle states
RFQ
Quote
Acceptance
Errors
Errors are JSON objects whose only field iserror, except where noted.
Stream recovery
rfq:read. Upgrades to a WebSocket (101).
The simplest client sends no frames:
- Connect to
/v1/stream. - Persist the
sequenceof the last event you processed. - On reconnect, pass
after=<sequence>to replay missed durable events.
sequence, event_id,
resource_id, type, occurred_at, and data. Events are pushed as soon as
they commit. Expiry events (rfq.expired, quote.expired) are pushed at the
deadline, typically within a few milliseconds.
Events arrive in commit order, so a lower sequence can follow a higher one.
sequence is unique per event: deduplicate by it. Resuming with after
cannot see a lower sequence that commits after you disconnect. Use a v2
cursor when you need gap-free resume.
Gotcha: always process events idempotently. A reconnect can redeliver an event that was received immediately before the disconnect.
Filters and gap-free resume (v2)
Connect with?v=2 and send a subscribe frame within 10 seconds, or send any
subscribe, unsubscribe, or ping frame on an existing connection to switch
it to v2.
filterstakesevent_types(exact types or families such asquote.*),rfq_ids,markets, andvenues. Values match with OR within a list and AND across lists, up to 1,000 values per list.include_broadcastdefaults totruewhen you holdrfq:quote.- The server answers
subscribedwith theresumecursor delivery starts from, replays every event after it, then continues live. Sendsubscribeagain (at most once per 250 ms) to replace the filters without redelivery. - A
heartbeatevery 15 seconds carries acursorthat covers everything before it on this connection.pingreturns an exactcursorinpong, andunsubscribestops delivery and returns one inunsubscribed. - Reconnect with
?resume=<cursor>(orresumeinsubscribe). You receive every event committed after it exactly once, including late commits, provided the gap closes within 2 hours. A malformed cursor is HTTP400. - Each connection has a bounded queue. If you fall behind, you receive
laggedwith your exactcursor, and the connection closes with4008.
v=2 or resume
connection gets HTTP 503 with Retry-After. Retry it.
Event types
quote.venue_* events go only to the maker of a venue-routed quote. They carry
quote_id, rfq_id, state, venue, and venue_event; on
quote.venue_accepted, venue_event holds the traded side, price,
quantity, and confirm_by.
Callers holding rfq:quote additionally receive the maker broadcast stream of
venue-originated RFQ events.
Close codes
Scope and authentication failures, and the per-principal connection cap
(
429), happen before the upgrade and surface as an ordinary HTTP error
rather than a close frame.
Venue RFQ firehose
rfq:quote. Upgrades to a WebSocket (101).
The firehose pushes every status change of every RFQ on every connected venue,
one WebSocket message per event, about 1 ms after the venue sends it. It
carries only venues whose exchange_rfq_feed is true in
/v1/venues/capabilities, and it returns 404 where it is turned off. Use it
when you need to see every auction as it happens. Use
GET /v1/exchange-rfqs when you only need the
currently open set.
Subscribe
Pass options as query parameters on the upgrade URL, or send asubscribe
frame after you connect. A later subscribe frame replaces your filters and
encoding in place.
subscribed with your stream_id, resume_status
(live, replayed, or gap), detail, and snapshot. Invalid query
parameters fail the upgrade with HTTP 400.
Filters run on the server before encoding. Events you filter out cost you no
bandwidth and no parsing.
Encodings
Key your rows by the event’s top-level
rfq_id. It is present on every event
in both encodings.
Compression
Addcompress=true to the URL, and make sure your WebSocket client offers
permessage-deflate. The server declines compression for connections that don’t
ask for it. Compression cuts bandwidth by about 6×. It costs CPU on both ends,
so enable it when bandwidth is your limit.
Event types
On Polymarket,
venue_rfq.executed can follow venue_rfq.expired for the
same RFQ. The deadline closes the quote window, not the auction, so a trade
can print after it. Don’t treat expired as final for Polymarket.quoted, accepted, and
updated only describe your own quotes, and only your connections receive
them.
Heartbeats, lag, and close codes
The server sends a heartbeat every 15 seconds. It carries your current position. If you fall behind, you receive onelag_warning. If you keep falling behind,
you receive lagged and the server closes the connection with 4008. The
close reason carries your resume position:
lagged stream_id=<id> since_seq=<venue>:<seq>,….
Other close codes are 1008 (a missing or invalid subscribe, or a failed
authentication recheck), 1011 (a snapshot could not be read), and 1013
(too many connections).
A feed_reset frame means the server resynchronized a venue and may have
missed events. Resubscribe with snapshot: true.
Resume after a disconnect
- Keep
stream_idand the lastseqyou processed for each venue. Heartbeats and the4008reason also carry them. - Reconnect with
stream_id=<id>&since_seq=kalshi:<seq>,polymarket:<seq>. - Check
resume_statusin thesubscribedframe:replayed— you receive every event after your position, with no gap.gap— the server can’t replay from your position. This happens when your reconnect reaches a different server, or the position is too old. The server streams a snapshot instead.
snapshot=true, or a gap) sends the filtered open set as
venue_rfq.snapshot items between live events, then snapshot_end with a
count. Apply snapshot items as upserts and terminal events as deletes. You
may see duplicates, but never gaps.
Unmet demand
Polymarket reports, about every 30 seconds, which combos requesters asked for that no maker filled. The firehose sends it asvenue_rfq.unmet_demand, and
GET /v1/venue-rfqs/unmet-demand returns the latest summary per venue.
Each entry has:
Filter the REST endpoint with
venue, reason, and min_count. On the
firehose, a subscription that uses RFQ filters only receives
venue_rfq.unmet_demand if it names it in event_types.
Connection limits
Each server accepts a limited number of firehose connections, and a lower number per principal. Over either limit, you receive anerror frame
too_many_connections and close 1013. Open one connection per process and fan out internally,
rather than one per consumer.
Machine-readable contract
The complete machine-readable contract lives in the RFQ service’sspec/openapi.yaml and spec/asyncapi.yaml files.
