During development, the developer endpoints work without an API key. Access to the quote stream in production is gated: request an API key with quote stream access, or have an existing key upgraded.
1
Set up
Import a WebSocket client, read the endpoint from the environment, and pick the pair to watch.
Imports and config
Imports and config
2
Connect and subscribe
Open the connection to
/quote-stream and send a subscribe op once it is open. The API key header is only needed in production.Connect and subscribe
Connect and subscribe
3
Read updates
Each message is a batch covering one slot. Read the
updates array, and handle the per-pair e field for pairs with no route.Handle messages
Handle messages
Quotes are approximations and can briefly cross (bid above ask) between slots.
Treat them as a live read on the market, not a guaranteed execution price.
Related Resources
Market Data Streams
How the streams work and when to use each.
Quote Stream API
Messages, fields, and the all-markets subscription.
Stream Order Book Depth
Read ten levels of depth per side.
Authenticate Requests
Authenticate requests for production rate limits.