Stream Quotes
The Argyros quote stream pushes a fresh quote whenever the price of a token pair changes, so your UI can show a live rate without polling. It’s a WebSocket endpoint that speaks plain JSON.Stream vs. poll. Use streaming for a continuously updating price (a swap form, a price ticker).
For a single quote — for example, right before building a transaction — use
GET /api/v1/quote. The streamed amountOut matches what /quote returns
for the same pair and amount. For the full message schema, see the
Stream Quotes API reference.How it works
- Open a WebSocket connection.
- Send a
subscribemessage listing the pairs you care about. - Receive an immediate first quote for each pair, then a
subscribedack. - Receive a new
quotemessage whenever that pair’s price materially changes. - Send
unsubscribeto stop a stream, or close the socket to end them all.
Subscribe
Each pair is{ in, out, amount, exactIn }:
Input token mint address (Solana base58 public key).
Output token mint address (Solana base58 public key).
Amount in smallest token units, as a string. For SOL (9 decimals):
1000000000 = 1 SOL.true quotes amount as the exact input (ExactIn); false treats it as the exact desired output (ExactOut).Handle messages
Two server message types arrive on the socket:quote— a live quote:{ type, in, out, amount, amountOut, priceImpactBps, hops, slot }.subscribed/unsubscribed/error— acks. Errors include amessage; subscribe/unsubscribe acks include acountof accepted pairs.
quote is only re-sent when amountOut, priceImpactBps, or hops changes — so every message
you receive is a genuine price update.
Examples
Unsubscribe
Send the same pair withop: "unsubscribe" to stop receiving updates for it:
Reconnection & limits
- Reconnect on close. Subscriptions live with the connection. After an unexpected close, reopen
the socket and re-send your
subscribemessages. - Read promptly. A connection whose outbound queue overflows (a slow reader) is dropped rather than buffered. If this happens, reconnect and resubscribe.
- Up to 256 subscriptions per connection. Spread more across multiple connections.
Solana support coming soon. Streaming today operates on Fogo. See
Supported Chains.
