Skip to content

Message Details

{
"type": "snapshot",
"data": {
"market_id": "1",
"ask_agg_data": [
{ "ticks": 100010, "qty": "6000" },
{ "ticks": 100012, "qty": "3000" },
{ "ticks": 100015, "qty": "4500" }
],
"bid_agg_data": [
{ "ticks": 100000, "qty": "8000" },
{ "ticks": 99998, "qty": "2500" },
{ "ticks": 99995, "qty": "5000" }
],
"latest_seq_num": "2"
}
}
Field Description
ask_agg_data Ask levels, lowest price first.
bid_agg_data Bid levels, highest price first.
latest_seq_num seq_num of the last event in the snapshot.

Quantities are integers scaled from base asset native units. See Data Formats.

md_event_detail has three parts:

Part Contents
tob Top of book after the event.
data What changed.
order The order that triggered the event.

Extending the book snapshot shown above, the following market data event detail shows an IOC buy of 1,000 qty at 100,010 ticks that trades against the best ask; as a result, the best ask qty drops from 6,000 (as shown in the book snapshot above) to 5,000 (as shown in the event detail TOB).

{
"type": "md_event_detail",
"data": {
"tob": {
"ask_qty": "5000",
"bid_qty": "8000",
"ask_ticks": 100010,
"bid_ticks": 100000
},
"data": {
"event_type": 2,
"event_qual": 2,
"event_side": 1,
"event_delta_qty": "-1000",
"event_abs_ticks": 100010,
"event_tick_depth": 0,
"event_level_depth": 0,
"event_level_begin_qty": "6000",
"event_level_delta_qty": "-1000",
"event_total_px": "-100010000",
"seq_num": "3"
},
"order": {
"side": 2,
"market_id": "1",
"qty": "1000",
"ticks": 100010,
"tif": 1,
"origin": 1
}
}
}
Field Description
ask_ticks Best ask price.
bid_ticks Best bid price.
ask_qty Quantity at the best ask.
bid_qty Quantity at the best bid.

For trades that execute at multiple price levels, event_delta_qty and event_total_px cover all levels, and event_level_* fields refer to the deepest level touched.

Field Description
event_type Event type. See Enums.
event_qual Event qualifier, on LIQ_RMD only. See Enums.
event_side Side of the book.
seq_num Per-market sequence number.
event_delta_qty Total quantity change. Negative for LIQ_RMD.
event_total_px Sum of quantity × ticks over the levels touched [1].
event_abs_ticks Price of the deepest level touched.
event_tick_depth Ticks from the previous best price.
event_level_depth Levels from the previous best price, zero-indexed.
event_level_begin_qty Deepest level’s quantity before the event.
event_level_delta_qty Deepest level’s change. Negative for LIQ_RMD.

Note 1. event_total_px is negative for removals. For XA, it is value rested minus value traded; see Book Building. To convert to quote native units, multiply by tick_size and divide by base native units per token.

Field Description
market_id Market identifier.
side Side. See Enums.
ticks Limit price in ticks.
qty Order quantity.
tif Time in force. See Enums.
origin Origin. See Enums.

Sent on the initial subscribe, and on any later subscribe that adds order status update markets or enables λ status updates (the snapshot covers only what that subscribe added).

List Contains Included when
order_entries Resting and pending orders Subscribed to OSU
lambda_entries Active lambdas, all markets Subscribed to LSU
pending_lambda_cancels Lambda cancels in flight Subscribed to LSU
{
"type": "ud_snapshot",
"data": {
"order_entries": [
{
"order_id": "ord_abc",
"client_order_id": "my-order-1",
"order": { "side": 2, "market_id": "1", "qty": "100", "ticks": 10000, "tif": 2, "origin": 1 },
"qty_filled_make": "25",
"qty_filled_take": "0",
"qty_canceled": "0"
}
],
"lambda_entries": [
{
"lambda_id": "lam_xyz",
"client_lambda_id": "my-lambda-1",
"order": { "side": 2, "market_id": "1", "qty": "100", "ticks": 10000, "tif": 2, "origin": 2 },
"status": 2,
"is_remote": false,
"is_leverage": false,
"predicate_index_data": "{...}",
"predicate_match_data": "{...}",
"lr_qty_type": 1,
"partial_qty": "0",
"lr_ticks_type": 1
}
],
"pending_lambda_cancels": [
{ "lambda_id": "lam_xyz", "client_cancel_id": "my-cancel-1" }
]
}
}

In ud_snapshot, the order_entries quantities (qty_filled_make, qty_filled_take, qty_canceled) are totals since the order was placed.

Field Description
order_id Exchange-assigned id.
client_order_id Optional user-supplied id (string, up to 36 bytes).
order The original order.
qty_filled_make Total filled as maker.
qty_filled_take Total filled as taker.
qty_canceled Total canceled.
Field Description
lambda_id Exchange-assigned id.
client_lambda_id Optional user-supplied id (string, up to 36 bytes).
order The underlying order.
status Lambda status. See Enums.
is_remote Whether it’s a remote lambda.
is_leverage Whether it trades on leverage.
predicate_index_data The predicate’s index_data, as a JSON string.
predicate_match_data The predicate’s match_data, as a JSON string.
lr_qty_type See Response.
partial_qty As submitted. Only used by PARTIAL, which isn’t available yet.
lr_ticks_type See Response.
Field Description
lambda_id The lambda being canceled.
client_cancel_id Optional user-supplied id for the cancel (string, up to 36 bytes).

Sent for each acceptance, fill, and cancel in subscribed osu markets, and for each refused order.

{
"type": "ud_order_status_update",
"data": {
"osu_id": "osu_abc",
"order_id": "ord_abc",
"client_order_id": "my-order-1",
"qty_filled_make": "10",
"qty_filled_take": "0",
"qty_canceled": "0",
"fill_value": "100000",
"fee_rebate": "50",
"order": { "side": 2, "market_id": "1", "qty": "100", "ticks": 10000, "tif": 2, "origin": 1 },
"order_status": 2,
"reason": 0
}
}
Field Description
osu_id Exchange-assigned id of this update. Empty for a refused order.
order_id Exchange-assigned order id. Empty for a refused order.
client_order_id Optional user-supplied id (string, up to 36 bytes).
qty_filled_make Filled as maker in this update.
qty_filled_take Filled as taker in this update.
qty_canceled Canceled in this update.
fill_value Notional filled, in quote native units.
fee_rebate Fee (negative) or rebate (positive), in quote native units.
order The original order.
order_status Order status. See Enums.
reason Order status reason. See Enums.

Sent on every lambda status change.

{
"type": "ud_lambda_status_update",
"data": {
"lsu_id": "lsu_xyz",
"lambda_id": "lam_xyz",
"client_lambda_id": "my-lambda-1",
"delta_qty": "0",
"status": 2,
"reason": 1
}
}
Field Description
lsu_id Exchange-assigned id of this update.
lambda_id Exchange-assigned id. Empty for a refused submission.
client_lambda_id Optional user-supplied id (string, up to 36 bytes).
delta_qty Change in the lambda’s untriggered quantity: the full quantity when programmed, minus what was left when canceled, and 0 otherwise.
status Lambda status. See Enums.
reason Lambda status reason. See Enums.
Value Name Meaning
1 ASK Sell.
2 BID Buy.
Value Name Meaning
1 LIQ_ADD Liquidity added.
2 LIQ_RMD Liquidity removed.
3 IM_MISS An IOC order that found nothing to fill.

Used with LIQ_RMD, describes why liquidity was removed. XA indicates that a GTC order crossed the spread when it was placed and so it both executed immediately and added liquidity.

Value Name Meaning
2 EX A trade executed.
3 CX An order was canceled.
4 XA A GTC order crossed, partially filled, and rested.
Value Name Meaning
1 IOC Immediate or cancel.
2 GTC Good until canceled.
Value Name Meaning
1 EXOGENOUS Placed through the HTTPS API.
2 LAMBDA Placed by a lambda.
3 ADMIN Placed by the system, such as cancels ahead of maintenance.
Value Name Meaning
1 PENDING Accepted, awaiting the matching engine.
2 RESTING On the book, possibly partly filled. GTC only.
3 FILLED Fully filled.
4 CANCELED Canceled, with nothing filled.
5 PARTIAL Canceled, but partly filled.
6 REJECTED Refused, e.g. insufficient balance.
Value Name Meaning
0 No reason.
1 ADMIN_CANCELED Canceled by the system.
2 INSUFFICIENT_BALANCE Refused: the account cannot fund the order.
3 DUPLICATE_CLIENT_ID Refused: the client order id is already in use.
4 EXCHANGE_ERROR Refused: the order could not be accepted.
Value Name Meaning
1 PENDING Submitted, awaiting acceptance.
2 IN_FORCE Active and evaluating on every matching event.
3 OUT_OF_FORCE No longer active (exhausted or canceled).
4 REJECTED Refused.
Value Name Meaning
1 PROGRAMMED Accepted and now in force.
2 CANCELED Canceled, explicitly or automatically.
3 MODIFIED Quantity modified.
4 EXHAUSTED All quantity triggered; now out of force.
5 SYSTEM_RESTART State reset by a system restart.
6 INSUFFICIENT_BALANCE Refused: the account cannot fund the lambda.
7 DUPLICATE_CLIENT_ID Refused: the client lambda id is already in use by a live lambda.
8 INVALID_LAMBDA Refused: the lambda’s inputs are not valid.
9 EXCHANGE_ERROR Refused: the lambda could not be accepted.

Regulated services provided by 1Money USA, Inc., a licensed money transmitter, NMLS ID 2628653 · Licenses