Stream Quotes
WS /api/v1/stream is a WebSocket endpoint that pushes live swap quotes. Subscribe to one or
more token pairs and the server sends an updated quote whenever the on-chain price for that pair
materially changes — no polling required.
Use streaming when you need a continuously up-to-date price (e.g. a swap UI showing a live rate).
For one-off quotes,
GET /api/v1/quote is simpler.Connecting
Open a WebSocket to the endpoint. When connecting through the gateway, the same API-key auth and per-plan rate limits as the REST endpoints apply to the upgrade request (see Authentication and Rate Limits). Once upgraded, the connection is long-lived and is not subject to the per-request rate limiter.Client messages
Send a JSON text frame with anop and a pairs array.
Operation to perform:
subscribe or unsubscribe.One or more pair specifications to subscribe or unsubscribe.
(in, out, amount, exactIn) tuple — two subscriptions that
differ only in amount are distinct streams.
Subscribe
subscribed ack. The first quote may arrive
just before the ack.
Unsubscribe
Server messages
Quote push
Sent for the immediate first quote and again only when the quote materially changes (a change inamountOut, priceImpactBps, or hops). Identical re-quotes are suppressed.
Always
"quote".Input token mint.
Output token mint.
The subscribed amount, in smallest units.
Estimated output amount in smallest units (ExactIn) — the live quote.
Price impact in basis points.
Number of hops in the route. 1 = direct, 2+ = multi-hop.
The Fogo slot the quote was computed at.
Acknowledgement
Sent in response to asubscribe / unsubscribe, or to report a problem with a message.
"subscribed", "unsubscribed", or "error".Present on errors — e.g.
"invalid json", "unknown op".Number of pairs accepted by a subscribe/unsubscribe. Invalid or duplicate pairs are skipped and not counted.
Examples
Limits & behavior
| Behavior | Value |
|---|---|
| Max subscriptions per connection | 256 |
| Push policy | Only when the quote materially changes (amountOut / priceImpactBps / hops) |
| Update coalescing | Bursts of pool changes are debounced into a single recompute (~50 ms) |
| First quote | Sent immediately on subscribe |
| Backpressure | A connection whose outbound queue overflows (slow reader) is dropped — reconnect and resubscribe |
