Skip to main content
The Decibel WebSocket API provides real-time streaming data for markets, order books, trades, account state, and notifications. Spot and perp use the same topic patterns where the payload shape is shared. Each market-address topic is scoped to one concrete Decibel market. For example, a BTC spot market and a BTC perp market are different markets with different addresses, so they require separate subscriptions. Mixed account-level row payloads carry asset_type with values perp or spot.

Payload Semantics

  • depth and market_candlestick payloads do not include asset_type; the subscribed market address identifies whether the payload is for a perp or spot market.
  • account_open_orders and order_updates use OrderDto. Spot order rows use time_in_force and leave perp-only fields such as client_order_id, reduce-only, TP/SL, parent, and trigger condition empty, false, or null.
  • trades and user_trades use TradeDto with asset_type. Spot rows use action values Buy or Sell, leave client_order_id empty, set realized_pnl_amount and realized_funding_amount to 0, and include fee_asset when fee_amount is denominated in the base or quote asset.
  • bulk_orders and bulk_order_fills share the perp DTO shape, carry asset_type, and normalize spot prices/sizes with the spot market’s quote/base decimals.

Server URL

Available Channels

Market Data

Account

Bulk Orders

TWAP

Topic Compatibility Notes

The server still accepts legacy topic names for backward compatibility:
  • user_open_orders:{accountAddr} (legacy) -> canonical account_open_orders:{accountAddr}
  • user_positions:{accountAddr} (legacy) -> canonical account_positions:{accountAddr}
Spot markets do not publish market_price or all_market_prices rows because they do not have oracle price, mark price, funding, or open interest. Use all_spot_mids for a full-market spot display-price snapshot, or depth:{marketAddr} and its best_bid / best_ask fields for one market’s live book mid.

Message Format

See Connection Management for subscribe/unsubscribe payloads, auth headers, and error responses.

Next Steps

Connection Management

Connect, authenticate, subscribe, reconnect

TypeScript SDK

Managed WebSocket connections via SDK