Quote stream
A quote kept open: the router quotes again whenever an account of the route it served is
written (the pool or one of its vaults), at most once per pacing interval (150 ms, or the
larger minIntervalMs asked), and once a second without any write so the route can move.
Every quote is the one GET /quote answers at that moment, by the same code, and its body
travels unchanged as data. A quote that changes nothing visible (amounts, route, fees) is
sent again only every 5 seconds. Guide: Quote stream.
WebSocket (Upgrade: websocket): JSON text frames. Send
{"op":"subscribe","id","…the GET /quote fields…","minIntervalMs"?} (a subscribe on a live
id replaces it), {"op":"unsubscribe","id"}, {"op":"ping"}. Receive
{"op":"subscribed","id"}, {"op":"quote","id","seq","slot","data"} with data the
GET /quote body, {"op":"no_quote","id","seq","slot","status","data"} with the status and
error body GET /quote would answer (a 400 ends the subscription; any other keeps it and
tries again), {"op":"unsubscribed","id"}, {"op":"pong"},
{"op":"error","id"?,"message"} for a frame not taken (bad JSON, more than 16 subscriptions
on the connection, the router at its capacity).
SSE (no upgrade): one subscription from the query of GET /quote plus minIntervalMs.
Each event is named after its op and carries the same JSON as the WebSocket frame.
Opening the connection uses one request from the key’s rate limit. Billing is per
started minute the connection stays open (router / stream_minute), not per handshake
or quote.
Query Parameters
Allow two routes in one transaction (two swap instructions, see swapInstructions). Served only when it beats the best single route by at least 1 bps and fits the transaction; never for ExactOut, cycles or with a platform fee. Send it only if you sign every entry of swapInstructions
Response
WebSocket upgrade; frames as described above