Skip to main content
The Shuriken WebSocket API delivers real-time updates for token swaps, balances, pool data, alpha signals, and more. It uses a Pusher-compatible protocol over WebSocket, authenticated with the same API key you use for REST.
WebSocket streams require a Bearer token. Create an Agent Key from the Terminal to get started.
The WebSocket protocol involves session bootstrapping, Pusher-compatible handshakes, and channel authorization. We strongly recommend using an official SDK instead of implementing this yourself:

TypeScript SDK

Full WebSocket support with typed events and automatic reconnection.

Rust SDK

Async streams via futures::Stream with typed payloads and auto-reconnect.

Raw protocol details

The rest of this page describes the underlying WebSocket protocol. You only need this if you’re building a custom client without an SDK.

How it works

There is no static WebSocket URL. The connection details are discovered dynamically through a session bootstrap call to the same REST API:
1

Bootstrap a session

POST to /api/v2/ws/session with the streams you want to subscribe to. The response contains the WebSocket host, port, app key, and resolved subscription channels.
The response includes a connection object with wsHost, wsPort, appKey, and forceTls fields.
2

Open WebSocket connection

Construct the WebSocket URL from the session response and connect:
Wait for the pusher:connection_established message to get your socket_id.
3

Subscribe to channels

For public streams, send a pusher:subscribe message with the channel name from the session response.For presence streams (authenticated), first authorize via POST /api/v2/ws/auth with your socket_id and channel name, then subscribe with the returned auth token.

Stream discovery

Get the full catalog of available streams and their filters at any time:
See the Stream Catalog for the complete list.

Stream types

Connection states

Event format

All stream events arrive as JSON with the following structure:
The data field contains the stream-specific payload described in the Stream Catalog.