Modify Order

PATCH /orders/{orderId} atomically amends a live order. REST uses the bearer-authenticated one-shot HPKE envelope; plaintext fields are not sent to the edge.

The logical ModifyOrderInput is:

FieldRequiredDescription
order_idYesVenue u64 order id
symbol_idYesNumeric instrument id
new_priceConditionalNew price; omitted when unchanged
new_quantityConditionalNew remaining quantity, not a delta
new_trigger_priceConditionalNew trigger for a parked stop
correlation_idYesRequest correlation id

At least one new_* field must change. Do not send price or quantity.

{
  "order_id": "1875340519620476928",
  "symbol_id": 1,
  "new_price": "96000",
  "new_quantity": "0.12",
  "new_trigger_price": null,
  "correlation_id": "100"
}

new_price, new_quantity, and new_trigger_price are decimal strings on the sealed protobuf wire (same instrument scales as place).

Success is the standard envelope containing an encrypted ACK, not plaintext order state.

Queue Priority

Modify is implemented as an atomic amend, not cancel-replace. Priority rules:

ChangeQueue priority
Quantity decrease onlyPreserved
Quantity increase (any)Lost (treated as a new entry at the new size)
Price change (any)Lost (re-enters the book at the new price level)

Price changes and quantity increases lose priority; quantity-only decreases preserve it. Rejects use the trade ACK catalog in Error Codes.