Skip to main content
Mainnet websocket URL: wss://ws.pacifica.fi/ws
Testnet websocket URL: wss://test-ws.pacifica.fi/ws
The API service provides a universal endpoint for websocket streams. The subscribed data will be streamed in the corresponding channel after the connection is established.

Subscription Message

Unsubscription Message

Heartbeat and Timeout

A websocket connection will be closed if no message is sent for the past 60 seconds, or the connection has been alive for 24 hours. To keep the connection alive without messages in 60 seconds, we can send a heartbeat message
and an alive connection will respond with

Compression

To reduce bandwidth, open the connection with ?compress=deflate:
The server then sends subscription data and snapshots as binary frames of raw DEFLATE data (no zlib header). Each frame holds one complete message. Other messages, such as pong, errors, and trading responses, stay as text frames. The compression state carries across messages, so use one decompressor for the whole connection. This is not the standard permessage-deflate extension.

Slow Clients

For book and bbo, a client that reads slowly receives only the latest snapshot, not every update in between. If the server cannot write to a connection for 60 seconds, it closes the connection with close code 1011.