{
"type": "subscribe",
"channel": "market",
"markets": [
"market-id-1",
"market-id-2"
],
"filter": "orderbook"
}{
"type": "unsubscribe",
"channel": "market",
"markets": [
"market-id-1",
"market-id-2"
]
}{
"type": "subscribed",
"channel": "user",
"status": "ok",
"markets": null,
"events": null
}{
"type": "unsubscribed",
"channel": "user",
"status": "ok",
"markets": null,
"events": null
}{
"msg_type": "update-orderbook",
"event_id": "event-123",
"market_id": "market-456",
"orderbook": {
"yes_orderbook": {
"outcome": "YES",
"bids": [
{
"price_ticks": 40,
"quantity": 100,
"order_count": 2
}
],
"asks": [
{
"price_ticks": 41,
"quantity": 150,
"order_count": 3
}
],
"spread": 1,
"last_transaction": 40
},
"no_orderbook": {
"outcome": "NO",
"bids": [],
"asks": [],
"spread": null,
"last_transaction": null
},
"market_price_yes": 40,
"market_price_no": 60,
"chance": 40,
"volume": 10000,
"liquidity": 5000,
"spread_yes": 1,
"spread_no": 2
}
}{
"msg_type": "new-trade",
"event_id": "event-123",
"market_id": "market-456",
"last_trade": {
"canceled": false,
"taker_id": "user-789",
"total_amount": 1000,
"qty_contracts": 10,
"avg_price": 40,
"side": "BUY",
"contract_type": "YES",
"makers": [
{
"maker_id": "user-101",
"qty_contracts": 5,
"price": 40,
"total_amount": 500,
"side": "SELL",
"contract_type": "YES"
}
]
}
}{
"msg_type": "update",
"event_id": "event-123",
"market_id": "market-456",
"orderbook": {
"yes_orderbook": {
"outcome": "YES",
"bids": [
{
"price_ticks": 40,
"quantity": 100,
"order_count": 2
}
],
"asks": [
{
"price_ticks": 41,
"quantity": 150,
"order_count": 3
}
],
"spread": 1,
"last_transaction": 40
},
"no_orderbook": {
"outcome": "NO",
"bids": [],
"asks": [],
"spread": null,
"last_transaction": null
},
"market_price_yes": 40,
"market_price_no": 60,
"chance": 40,
"volume": 10000,
"liquidity": 5000,
"spread_yes": 1,
"spread_no": 2
},
"last_trade": {
"canceled": false,
"taker_id": "user-789",
"total_amount": 1000,
"qty_contracts": 10,
"avg_price": 40,
"side": "BUY",
"contract_type": "YES",
"makers": [
{
"maker_id": "user-101",
"qty_contracts": 5,
"price": 40,
"total_amount": 500,
"side": "SELL",
"contract_type": "YES"
}
]
}
}Test and interact with the Market channel WebSocket API.
{
"type": "subscribe",
"channel": "market",
"markets": [
"market-id-1",
"market-id-2"
],
"filter": "orderbook"
}{
"type": "unsubscribe",
"channel": "market",
"markets": [
"market-id-1",
"market-id-2"
]
}{
"type": "subscribed",
"channel": "user",
"status": "ok",
"markets": null,
"events": null
}{
"type": "unsubscribed",
"channel": "user",
"status": "ok",
"markets": null,
"events": null
}{
"msg_type": "update-orderbook",
"event_id": "event-123",
"market_id": "market-456",
"orderbook": {
"yes_orderbook": {
"outcome": "YES",
"bids": [
{
"price_ticks": 40,
"quantity": 100,
"order_count": 2
}
],
"asks": [
{
"price_ticks": 41,
"quantity": 150,
"order_count": 3
}
],
"spread": 1,
"last_transaction": 40
},
"no_orderbook": {
"outcome": "NO",
"bids": [],
"asks": [],
"spread": null,
"last_transaction": null
},
"market_price_yes": 40,
"market_price_no": 60,
"chance": 40,
"volume": 10000,
"liquidity": 5000,
"spread_yes": 1,
"spread_no": 2
}
}{
"msg_type": "new-trade",
"event_id": "event-123",
"market_id": "market-456",
"last_trade": {
"canceled": false,
"taker_id": "user-789",
"total_amount": 1000,
"qty_contracts": 10,
"avg_price": 40,
"side": "BUY",
"contract_type": "YES",
"makers": [
{
"maker_id": "user-101",
"qty_contracts": 5,
"price": 40,
"total_amount": 500,
"side": "SELL",
"contract_type": "YES"
}
]
}
}{
"msg_type": "update",
"event_id": "event-123",
"market_id": "market-456",
"orderbook": {
"yes_orderbook": {
"outcome": "YES",
"bids": [
{
"price_ticks": 40,
"quantity": 100,
"order_count": 2
}
],
"asks": [
{
"price_ticks": 41,
"quantity": 150,
"order_count": 3
}
],
"spread": 1,
"last_transaction": 40
},
"no_orderbook": {
"outcome": "NO",
"bids": [],
"asks": [],
"spread": null,
"last_transaction": null
},
"market_price_yes": 40,
"market_price_no": 60,
"chance": 40,
"volume": 10000,
"liquidity": 5000,
"spread_yes": 1,
"spread_no": 2
},
"last_trade": {
"canceled": false,
"taker_id": "user-789",
"total_amount": 1000,
"qty_contracts": 10,
"avg_price": 40,
"side": "BUY",
"contract_type": "YES",
"makers": [
{
"maker_id": "user-101",
"qty_contracts": 5,
"price": 40,
"total_amount": 500,
"side": "SELL",
"contract_type": "YES"
}
]
}
}Subscribe to receive updates about specific markets
Unsubscribe from specific markets
Confirmation message sent after successful subscription
Confirmation message sent after successful unsubscription
Update about orderbook changes for a market
Update about a new trade executed in a market
Complete update including both orderbook and trade information