User Channel (WebSocket)
Overview
Section titled “Overview”This channel pushes order lifecycle events and trade confirmations for the authenticated user. You must present valid CLOB API credentials in the first message after connecting.
Server: wss://ws.openfish.fun/ws/user
Authentication
Section titled “Authentication”Direction: Client -> Server
Send the authentication payload as your first message within 10 seconds of establishing the connection:
| Field | Type | Required | Description |
|---|---|---|---|
auth | object | Yes | CLOB API credentials |
auth.apiKey | string | Yes | API key (UUID) |
auth.secret | string | Yes | API secret |
auth.passphrase | string | Yes | API passphrase |
markets | array | No | Condition IDs to filter. Omit for all markets. |
{ "auth": { "apiKey": "9180014b-33c8-9240-a14b-bdca11c0a465", "secret": "your-api-secret", "passphrase": "your-passphrase" }}Success response:
{"type": "auth", "status": "ok"}Error responses:
{"error": "invalid auth message"}{"error": "auth timeout"}{"error": "invalid token"}Legacy Authentication
Section titled “Legacy Authentication”For backward compatibility, pass the API key as a query parameter:
wss://ws.openfish.fun/ws/user?token={api_key}Heartbeat
Section titled “Heartbeat”The server emits a text "PING" frame every 10 seconds. The client must reply with text "PONG".
Events
Section titled “Events”order — Order Update
Section titled “order — Order Update”Triggered whenever an order is placed, partially filled, or cancelled.
| Field | Type | Description |
|---|---|---|
type | string | "order" |
order_id | string | Order ID (UUID) |
event_type | string | "PLACEMENT", "UPDATE", or "CANCELLATION" |
status | string | "LIVE", "MATCHED", "CANCELED" |
market | string | Condition ID |
asset_id | string | Token ID |
side | string | "BUY" or "SELL" |
price | string | Order price |
original_size | string | Original size |
size_matched | string | Amount matched so far |
outcome | string | "YES" or "NO" |
order_type | string | "GTC", "FOK", "GTD" |
owner | string | API key of the order owner |
timestamp | integer | Unix timestamp |
trade — Trade Update
Section titled “trade — Trade Update”Triggered when a trade is matched or when a previously matched trade changes status.
| Field | Type | Description |
|---|---|---|
type | string | "trade" |
trade_id | string | Trade UUID |
taker_order_id | string | Taker’s order ID |
market | string | Condition ID |
asset_id | string | Token ID |
side | string | "BUY" or "SELL" |
price | string | Trade price |
size | string | Trade size |
fee | string | Fee amount |
status | string | "MATCHED", "CONFIRMED", "FAILED" |
trader_side | string | "TAKER" or "MAKER" — your role in the trade |
maker_orders | array | Matched maker order details (order_id, owner, maker_address, matched_amount) |
timestamp | integer | Unix timestamp |