Documentation Index
Fetch the complete documentation index at: https://docs.bayse.markets/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The/ws/v1/user endpoint streams real-time updates for your own orders. Unlike the public market data endpoint, this requires authentication on every message.
| Subscription | Channel | Server event types | Description |
|---|---|---|---|
| Orders | orders | order_updated | Fill updates for your orders on specific markets. |
Authentication
Every message you send to/ws/v1/user must include an auth field with either your API key or access token. The connection upgrade itself does not require credentials; authentication is verified per message.
| Field | Type | Description |
|---|---|---|
auth.accessToken | string | Your JWT access token. Required if apiKey is not provided. |
auth.apiKey | string | Your API public key. Required if accessToken is not provided. |
auth.deviceId | string | Optional device identifier. Sent alongside accessToken. |
Prefer
apiKey for relay trading clients. If both accessToken and apiKey are provided, the access token takes precedence. The server caches your last verified credential per connection, so repeated messages with the same value skip the auth service call.auth is missing or invalid, the server returns an error:
Orders
Subscribe to your own order events for specific markets. You receiveorder_updated events when your order is partially or fully filled.
Subscribe
marketIds supports up to 10 markets per subscription message. To track more markets, send multiple subscribe messages. For relay API clients, use the same public API key you use for authenticated HTTP requests.orders:<userId>:<marketId> (one room per market)
Events received
order_updated — Your order was partially or fully filled.
Order fields
| Field | Type | Present on | Description |
|---|---|---|---|
id | string | All | Order UUID. |
userId | string | All | Your user UUID. |
marketId | string | All | Market UUID. |
outcomeId | string | All | Outcome UUID. |
outcomeLabel | string | All | Outcome label (e.g. “Yes”, “No”). |
side | string | All | BUY or SELL. |
price | number | All | Limit price (0.01 to 0.99). |
quantity | number | All | Original order quantity. |
filledQuantity | number | All | Quantity filled so far. |
remainingQuantity | number | All | Quantity remaining. |
avgFillPrice | number | order_updated | Volume-weighted average fill price. |
status | string | All | OPEN, PARTIAL_FILLED, FILLED, or CANCELLED. |
timeInForce | string | When present | GTC, IOC, or FOK. Omitted if empty. |
createdAt | number | All | Unix timestamp (seconds). |
updatedAt | number | All | Unix timestamp (seconds). |
Timestamps inside
data.order and data.timestamp are Unix seconds. The outer timestamp field is Unix milliseconds.Unsubscribe
Event series and market rotation
For events that belong to a series (e.g. hourly BTC markets), each interval produces a new event with new market IDs. When the current event closes and the next one opens, you must unsubscribe from the old market IDs and subscribe to the new market IDs. The server does not automatically migrate your subscription to the next market in the series. A recommended approach:- Use the Get series events endpoint to find the currently open event.
- Subscribe to its market IDs.
- When you receive the last fill or detect that the event has closed, unsubscribe from the old market IDs.
- Fetch the newly opened event in the series and subscribe to its market IDs.