Websocket API
If you connect to the WebSocket endpoint, you can subscribe to some channels and receive updates about objects.
Last updated
If you connect to the WebSocket endpoint, you can subscribe to some channels and receive updates about objects.
Last updated
Updates come in the form of a full object and can substitute existing objects by their object identifier.
The common form of messages received is
In several subscriptions, specifically market, trades, userOrders, orderbook, userFills
(in other words, except candles
), the client receives history objects as events, which are similar to those from calling the corresponding HTTP API with the default limit parameter.
trades
channel
string "trades"
the channel name
market
string
a market contract address
userOrders
channel
string "userOrders"
the channel name
market
string
a market contract address
user
string
a user address
orderbook
channel
string "orderbook"
the channel name
market
string
a market contract address
aggregation
number
an order book level of aggregation
An object:
aggregation
string represents an aggregation of the market
an order book aggregation level
levels
object with fields"asks" and "bids"
userFills
channel
string "userFills"
the channel name
market
string
a market contract address
user
string
a user address
candles
channel
string "candles"
the channel name
market
string
a market contract address
resolution
string
one of the candle object's resolutions
market
channel
string "market"
the channel name
market
string
a market contract address
A object
An object.
Each field is a sorted array of order book objects; asks are sorted in ascending order by price, and bids are sorted in descending order.
An object with keys representing user addresses and values as arrays of objects.
An object with keys representing a resolution and the values being objects.
An array of objects.