Skip to main content
Flash streams over a single WebSocket endpoint. Open one connection, then subscribe to the channels you need; they multiplex over the same socket. Endpoint: wss://flash.definitive.fi/v1/ws

Channels

Authenticating

There is no connect-time handshake. Authenticate in-band by including your Flash API key as apiKey in every subscribe message. Get a key from Become an Integrator. A connection is pinned to one portfolio on first successful auth, and to one API key once a channel is active. A subscribe with a different key on the same socket is rejected with UNAUTHORIZED and the connection is closed.

Subscribing

Send a subscribe message for each channel as soon as the connection opens. Channel-specific fields are documented on each channel’s page.
Every accepted subscribe and unsubscribe is confirmed with an ack listing the connection’s active channels:
Stop a channel with an unsubscribe message on that channel. The server re-acks your remaining channels.

Connection limits

The per-key connection limit is at least 50, pooled across everything using that key. If you need it raised, reach out. Exceeding it is rejected with CONNECTION_LIMIT and the connection is closed; a backed-off reconnect recovers as slots free. Channel-specific limits, like the quote subscription cap, are documented on the channel’s page.

Heartbeats

Subscribe to heartbeats on every connection to receive a keep-alive frame once per second:
Each frame carries an incrementing counter and a timestamp:
Heartbeat frames need no action. They give a quiet connection two things: liveness detection (a gap in them means the connection is unhealthy, so reconnect rather than waiting) and steady traffic through any intermediary that closes idle connections on its own timeout.

Reconnecting

  • On disconnect, reconnect with capped backoff and jitter, then re-subscribe to your channels. Nothing survives a disconnect: orders subscriptions return a fresh snapshot, and quote sessions cannot be resumed.
  • On UNAUTHORIZED, stop reconnecting and check your API key; reconnecting with the same key will not authenticate.
  • Other closes, including CONNECTION_LIMIT, are safe to retry with backoff.
  • If a stream stays unavailable, fall back to polling its REST counterpart.

Errors

Errors arrive as a frame you can act on:
These codes can occur on any channel: Channel-specific codes are documented on each channel’s page.

Orders channel

Stream open orders in real time, for one funder or all of them.

Quotes channel

Stream live quotes for a market-order request.