Skip to main content
Subscribe to order_responses on the authenticated Trade WebSocket. Messages are pushed in real time. Authenticate before subscribing; see the authentication guide for client-language examples.

Subscribe

Example responses

This excerpt omits other standard order-response fields:
FILLED can describe a partial fill. Reconcile quantities, fills and cancellations rather than assuming one fill event completes the original order. IOC remainders receive the normal final CANCELLED event. FOK does not partially commit fills.

Private-order fields

The optional boolean dark identifies a private instruction. true is returned; the default false is omitted, so clients must decode absence as false. The same field appears on get_order_response and entries in all_orders_response.orders. The former separate private-instruction fields are not returned. Authenticated accounts receive their order responses and fills regardless of public trade publication. See Private-order API.

Automatic reduce-only conversion

During soft liquidation and order margin release, QFEX can convert resting orders to reduce-only without a client request. Subscribers to order_responses receive one MODIFIED update for each newly converted order. No additional conversion update is sent for orders already reduce-only. The following example shows the relevant fields; other standard order-response fields are omitted:
The conversion preserves price/time priority. Unlike a client-requested modify, it does not replace the order ID. It also preserves the order’s dark instruction.

Handling the lifecycle

  1. Subscribe before relying on live order state. Handle unsolicited updates for your account; do not discard a MODIFIED message just because it does not match a pending request.
  2. Update your local order’s reduce_only flag and retain the conversion event for diagnostics. Do not assume the flag remains the value sent in add_order, or that margin recovery resets it to false.
  3. Continue processing fills and cancellations. A converted order may fill only up to the position available to reduce at execution time. If it would increase or reverse the position, the unfillable quantity is cancelled with status: "CANCELLED". This can happen when the order’s price would otherwise match, including after another order or liquidation has reduced or closed the position. Use the earlier conversion update to diagnose the cancellation; CANCELLED alone does not identify its cause.
  4. If modifying a converted order, send reduce_only: true. Sending the old false value is rejected with CANNOT_MODIFY_NO_SUCH_ORDER; a client modify cannot turn reduce-only off.
  5. After reconnecting, authenticate and resubscribe, then reconcile open orders using Get user orders or Get order. Read the current reduce_only flag from each returned order. Live updates are not a replay of missed events, and these queries exclude filled and fully cancelled orders.
For example, a converted sell order for 8 units against a long position of 5 can fill at most 5 units and then receive a cancellation for the remainder. If the position is already flat when matching is attempted, the order can receive CANCELLED without a fill. The order’s original acknowledgement does not guarantee it remains eligible to execute its original quantity.