Skip to main content
The UpsideMAX WebSocket API delivers real-time push streams for market data and account state without polling. Once you open a connection to wss://dev.upsidemax.xyz/ws, the server pushes updates as they occur — book channels push on every book change, and timed channels such as ticker and allMarkets push about once a second. Private account channels such as order updates and fills are available to any subscriber who provides their account address, and authenticating first is strongly recommended for forward compatibility.

What the stream covers, and what it does not

Decide per data type whether you can rely on the stream or must query. “No event” never means “no change” — it can also mean a dropped connection, a missed subscription, or a channel that does not carry that data at all. Not available on any channel — query the read API when you need them:

Balances and positions are timer-driven, not event-driven

userAccount pushes a complete snapshot on a 3-second timer, not a delta when something changes. Two consequences:
  • A fill and the balance change it caused do not arrive together. userFills fires immediately; the account view catches up on its next tick. Expect up to ~3 seconds of skew, and never assume an unchanged account frame means the fill did not happen.
  • Because each frame is a full snapshot, a missed frame self-heals — overwrite local state wholesale and do not attempt to apply deltas.
When you need account state as of now — before sizing an order, or to reconcile after a timeout — query userAccount rather than waiting for the next frame.

Reconnection

1

Re-establish and let state restore

The client reconnects after 5 seconds. Authentication and subscriptions are restored automatically; you do not re-send Auth or re-subscribe.
2

Take the re-delivered snapshots as truth

Snapshot-bearing channels replay on resubscribe: l2Book and openOrders send a full snapshot, candle ~300 bars, trades up to 100, orderUpdates and userFills 10 rows each. Replace local state from them rather than merging.
3

Deduplicate the overlap

Snapshots overlap the increments that follow. Deduplicate on the identity for that stream: bookVersion for books, tid for trades, bar open time t for candles, order ID for orders, execution ID for fills.
4

Reconcile anything the gap may have hidden

A disconnect can hide events that no snapshot replays — a fill older than the 10 rows, or a funding settlement. After a gap of any length, reconcile positions and balances from userAccount and fills from userFills before acting.
Ordering is guaranteed within a channel, not across channels. Do not infer causality between, say, an orderUpdates fill and a userAccount frame from arrival order — correlate on identifiers and timestamps.

Connection lifecycle

1

Open the WebSocket connection

Establish a WebSocket connection to wss://dev.upsidemax.xyz/ws. No HTTP upgrade headers beyond the standard WebSocket handshake are required.
2

(Optional) Authenticate

Send an Auth message to associate the connection with your account. This is required before subscribing to private channels and recommended for all account-level subscriptions. See Authentication for details.
3

Subscribe to channels

Send a subscribe message for each channel you want to receive. You can subscribe to multiple channels on the same connection. See Subscription for the message format.
4

Receive push messages

The server pushes messages to you as events occur. Each message includes a channel field that identifies its source so you can route it to the correct handler.
5

Send Ping every 30 seconds to keep alive

Send a standard WebSocket ping frame every 30 seconds. The server replies with a Pong to keep the connection alive.

Available channels

The table below summarises every channel available on the WebSocket API. Public channels are accessible without any prior authentication step. * Private channels currently accept the account address directly in the subscription parameters without requiring a prior Auth message. Authentication is still recommended for future compatibility.

Reconnection

If the connection drops, the client automatically reconnects after 5 seconds. On reconnect, your authentication and subscription state are automatically restored — you do not need to manually re-send your Auth message or re-subscribe to your channels.
The WebSocket endpoint does not guarantee message ordering across different channels. If you need causal ordering between, for example, openOrders and orderUpdates, correlate messages using their ts timestamps and bookVersion / order ID fields.

Channel quick-reference

l2Book

Full order book snapshots pushed whenever the book changes — bids and asks with price, size, and order count.

bbo

Best bid and best ask only — lower bandwidth than l2Book for top-of-book use cases.

trades

All public trades for a contract as they execute on-chain.

candle

Live OHLCV candle updates at any supported interval, with closed-bar events.

orderUpdates

Incremental order state changes — placed, filled, cancelled, and TP/SL events.

openOrders

Initial snapshot of all active orders followed by real-time incremental updates.

userFills

Every fill involving your account — whether you were the taker or the maker.

ticker

24-hour rolling statistics for a contract — change, high, low, volume, funding rate, mark and oracle price.

allMarkets

Oracle price, mark price, and 24-hour volume for every contract in a single frame.

userAccount

The full account view — collateral, positions, and margin — pushed on a timer instead of polled.

config

Lightweight notifications when contract configuration changes — new listings, freezes, or parameter updates.