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 four parts:

Part Contents
tob Top of book after the event.
data What changed.
order The order that triggered the event.
tm_info Timestamps of 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
},
"tm_info": {
"hw_ser_time_ns": "1792679400000123456",
"ws_enq_time_ns": "1792679400000171234"
}
}
}
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.

When a side is empty, its quantity is "0" and its price is a sentinel: the largest 32-bit integer for asks (2147483647, 2³¹ − 1) and the smallest for bids (-2147483648, −2³¹). Clients should check the quantity, not the price, to detect an empty side.

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. See Enums.
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. 0 at or inside the best price, or on an empty side.
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 the base asset’s num_native_units; see exchange info.

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.
Field Description
hw_ser_time_ns When the event was sequenced by the exchange, in Unix nanoseconds.
ws_enq_time_ns When this event was queued to the websocket, in Unix nanoseconds.

The two timestamps come from different clocks. hw_ser_time_ns comes from the exchange hardware, synchronized to the host clock, and ws_enq_time_ns comes from the WebSocket server. Their difference includes any offset between them.

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 λ programs, all markets Subscribed to LSU
pending_lambda_cancels λ program cancels in flight Subscribed to LSU
{
"type": "ud_snapshot",
"data": {
"order_entries": [
{
"order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
"client_order_id": "my-order-1",
"order": { "side": 2, "market_id": "1", "qty": "100", "ticks": 10000, "tif": 2, "origin": 1, "lambda_id": "" },
"qty_filled_make": "25",
"qty_filled_take": "0",
"qty_canceled": "0"
}
],
"lambda_entries": [
{
"lambda_id": "0192f3c1-7a2e-7c41-9b1d-5f0e8a3c2d10",
"client_lambda_id": "my-lambda-1",
"status": "in_force",
"program": { "kind": "local", "predicate": { "...": "..." }, "order": { "...": "..." }, "lifetime": { "kind": "once" } },
"qty_triggered": "0",
"created_time_ms": "1792679400000",
"updated_time_ms": "1792679400050"
}
],
"pending_lambda_cancels": [
{ "lambda_id": "0192f3c1-7a2e-7c41-9b1d-5f0e8a3c2d10", "client_lambda_id": "my-lambda-1", "cancel_id": "0192f3c1-7a2e-7c41-9b1d-5f0e8a3c2d12" }
]
}
}

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 Client-assigned id (string, up to 36 bytes). Empty if none was sent.
order The original order, as in an order status update.
qty_filled_make Total filled as maker.
qty_filled_take Total filled as taker.
qty_canceled Total canceled.

Each entry is the λ program as GET /v1/lambda/{lambda_id} returns it.

Field Description
lambda_id Exchange-assigned id.
client_lambda_id Optional client-assigned id (string, up to 36 bytes). null if none was sent.
status λ program status. See Enums.
program The λ program as it was submitted.
qty_triggered Quantity the λ program has placed so far.
created_time_ms When the λ program was submitted, in Unix milliseconds.
updated_time_ms When the λ program last changed, in Unix milliseconds.
Field Description
lambda_id The λ program being canceled.
client_lambda_id Optional client-assigned id (string, up to 36 bytes). null if none was sent.
cancel_id Exchange-assigned id of this cancel, as returned by the cancel request.

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

{
"type": "ud_order_status_update",
"data": {
"osu_id": "01a1bbc7-dd3e-7d4f-b152-6e802f7d91a4",
"order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
"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, "lambda_id": "" },
"order_status": 2,
"reason": 0,
"tm_info": { "hw_ser_time_ns": "1792679400000123456" }
}
}
Field Description
osu_id Exchange-assigned id of this update.
order_id Exchange-assigned order id.
client_order_id Client-assigned id (string, up to 36 bytes). Empty if none was sent.
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.
tm_info Timestamps of this update. hw_ser_time_ns: when the event was sequenced by the exchange, in Unix nanoseconds. A maker fill carries the taking order’s time. 0 for a rejected order, or for an order the system canceled when the exchange restarted.
Field Description
side Side. See Enums.
market_id Market identifier.
qty Quantity submitted. Negative for a cancel order.
ticks Limit price in ticks.
tif Time in force. See Enums.
origin Origin. See Enums.
lambda_id Exchange-assigned id of the λ program that placed the order. Empty unless origin is LAMBDA.

Sent on every λ program status change.

{
"type": "ud_lambda_status_update",
"data": {
"lsu_id": "0192f3c1-7a2e-7c41-9b1d-5f0e8a3c2d11",
"lambda_id": "0192f3c1-7a2e-7c41-9b1d-5f0e8a3c2d10",
"client_lambda_id": "my-lambda-1",
"delta_qty": "1000000",
"status": "in_force",
"reason": "programmed",
"created_time_ms": "1792679400050",
"cancel_id": null
}
}
Field Description
lsu_id Exchange-assigned id of this update.
lambda_id Exchange-assigned id.
client_lambda_id Optional client-assigned id (string, up to 36 bytes). null if none was sent.
delta_qty Change in the λ program’s untriggered quantity: the full quantity when programmed, minus what was left when canceled or reset by a system restart, and 0 otherwise.
status λ program status. See Enums.
reason λ program status reason. See Enums.
created_time_ms When this update happened, in Unix milliseconds.
cancel_id Exchange-assigned id of the cancel this update answers, as returned by the cancel request. null unless reason is canceled or cancel_missed.
Value Name Meaning
1 ASK Sell.
2 BID Buy.
Value Name Meaning
1 LIQ_ADD Liquidity added: a new resting order.
2 LIQ_RMD Liquidity removed: a trade (EX or XA) or cancel (CX).

Used with LIQ_RMD, describes why liquidity was removed.

Value Name Meaning
2 EX A trade.
3 CX A cancel.
4 XA Execute and add. A GTC order that trades and rests its remainder.
Value Name Meaning
1 IOC Immediate or cancel.
2 GTC Good until canceled.
3 ALO Add liquidity only: rests if it would not cross, else canceled.
Value Name Meaning
1 EXOGENOUS Placed through the HTTPS API.
2 LAMBDA Placed by a λ program.
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 or ALO 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 by a live order.
4 EXCHANGE_ERROR Refused: an internal exchange error. The order was not placed.
5 ALO_WOULD_CROSS Canceled: the ALO order would have crossed.
6 EXCHANGE_UNAVAILABLE Refused: the exchange is not accepting orders right now.
7 CAPACITY_REACHED Refused: the exchange has no capacity for another active λ account right now.
8 INVALID_ORDER Refused: the order failed validation.

λ program messages name their status and reason; they carry no numbers.

Name Meaning
pending Submitted, awaiting acceptance.
in_force Active and evaluating on every matching event.
out_of_force No longer active (exhausted, canceled, or reset by a system restart).
rejected Refused.
Name Meaning
programmed Accepted and now in force.
canceled Successfully canceled; its untriggered quantity was released.
modified Quantity modified.
exhausted All quantity triggered; now out of force.
system_restart State reset by a system restart.
insufficient_balance Refused: the account cannot fund the λ program.
duplicate_client_id Refused: the client-assigned id is already in use by a live λ program.
invalid_lambda Refused: the λ program failed validation.
exchange_error Refused: an internal exchange error. The λ program was not placed.
exchange_unavailable Refused: the exchange is not accepting λ programs right now.
capacity_reached Refused: the exchange has no capacity for the λ program right now.
cancel_missed A cancel found nothing to release: the λ program had already triggered in full or ended. If it triggered, its exhausted update can arrive before or after this one.

llms.txt

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