Connection Steps
1. Open WebSocket
Connect to the Exit Intelligence Stream endpoint with your API key in thex-api-key header:
2. Receive hello_ok
Immediately after the connection opens, the server sends a hello_ok message:
limits object reflects your tier’s capacity. See Rate Limits and Tiers for details.
3. Send configure
After receiving hello_ok, send a configure message with your wallets and strategy:
4. Receive Acknowledgement
The server responds with initialbalance_update messages for tokens already held in the configured wallets. If a position is detected, you will also receive position_opened.
The limits Object
| Field | Type | Description |
|---|---|---|
hi_capacity | number | Maximum high priority messages buffered. |
pnl_flush_ms | number | Interval at which PnL updates are flushed (ms). |
max_positions_per_session | number | Max tracked positions per session. |
max_wallets_per_session | number | Max wallets per session. |
max_positions_per_wallet | number | Max positions tracked per wallet. |
max_sessions_per_api_key | number | Max concurrent sessions per API key. |
Reconnection
The SDKs handle reconnection automatically. When the WebSocket disconnects:- The client waits with exponential backoff starting at 100 ms.
- Backoff doubles on each attempt up to a maximum of 2,000 ms.
- On successful reconnect, the client re sends the
configuremessage. - The server will re emit
balance_updateandposition_openedevents for existing holdings.
Ping and Pong
Client Ping
Send aping to measure round trip latency:
pong:
Server Ping
The server may also send WebSocket protocol level pings. The SDKs respond with pong frames automatically.StreamClient vs StreamSession
StreamClient
The low level client manages the raw WebSocket connection:
- Handles connect, reconnect, and message framing.
- Returns raw
ServerMessageobjects fromrecv(). - Provides a
StreamSenderfor sending client messages. - Supports lane splitting via
connectLanes()which separates high priority messages (exit signals, position events) from low priority messages (pnl_update).
StreamSession
The high level session wraps StreamClient with:
- Position tracking: Automatically maintains a map of open positions by ID and token account.
- Typed events: Returns
StreamEventobjects with aPositionHandleattached. - Deadline timers: Automatically requests exit signals after
deadline_timeout_sec. - Strategy updates:
updateStrategy()andupdateStrategyOptional()methods.
StreamSession.
Lanes
Lane splitting separates the message stream into two receivers:- High priority lane:
hello_ok,error,balance_update,position_opened,position_closed,exit_signal_with_tx - Low priority lane:
pnl_update
connectLanes():

