Pacifica exposes a single universal WebSocket endpoint that handles both data subscriptions and authenticated trading operations. Once a connection is established, you interact with it entirely through JSON messages — subscribing to channels, sending heartbeats, and (when required) submitting signed trading requests. There are no separate endpoints per data type; one connection gives you access to everything.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pacifica-fi/docs-migrate/llms.txt
Use this file to discover all available pages before exploring further.
Connection URLs
| Network | URL |
|---|---|
| Mainnet | wss://ws.pacifica.fi/ws |
| Testnet | wss://test-ws.pacifica.fi/ws |
Subscribing and Unsubscribing
All data streams are opt-in. Send a subscribe message to begin receiving events on a channel, and an unsubscribe message to stop. Subscribeparams object varies by channel. Each subscription channel is documented in detail on the Subscriptions page.
Heartbeat and Connection Lifetime
A connection is automatically closed if no message has been sent in the past 60 seconds, or when the connection has been alive for 24 hours. To keep a connection open during quiet periods, send a ping message:Two Types of Operations
The WebSocket API supports two categories of operation:- Subscriptions — Stream market data (prices, order books, trades, candles) and account data (positions, orders, trades, transfers). Market data channels require no authentication. Account data channels require passing your wallet address in the subscription params.
- Trading operations — Place, edit, and cancel orders over the WebSocket connection. All trading operations must carry a valid Ed25519 signature on every message.
Trading operations sent over WebSocket use the same Ed25519 signing scheme as REST POST requests. Every trading message must include a
signature, timestamp, and account field. See Authentication for full details on how to construct a valid signature.- Subscriptions — All market and account data channels
- Trading Operations — Place, edit, and cancel orders
Connection Example (Python)
The following example establishes a WebSocket connection, sends a subscribe message for theprices channel, and prints all incoming events. The websockets library is used here, but the message format works with any WebSocket client.