Amending an existing order
Cross-Session Amending: Orders can be amended from a different SBE session than the one that submitted them. For example, an order submitted on session A can be amended on session B.Response Routing: AmendOrderResponse is sent to both the session that sent the AmendOrderRequest and the session that originally submitted the order. All subsequent events (fills, further amends, cancels) route to the original submit session.Event Scoping: An SBE connection only receives events about orders submitted through that same connection.
AmendOrderRequest (110)
Request to change the modifiable fields of an existing order.
| Field | Name | Type | Length | Description |
|---|
| 1 | clientOrderId | int64 | 8 | Numeric client order ID |
| 2 | correlationId | int64 | 8 | Client-assigned ID |
| 3 | instrumentId | int64 | 8 | Numeric instrument ID |
| 4 | limitPrice | FixedPoint9 | 8 | New price |
| 5 | amount | Decimal72 | 9 | New amount |
| 6 | displayAmount | Decimal72 | 9 | New display amount with ? decimal places. If displayAmount=amount, the order is not considered an iceberg order. |
| 7 | flags | uint8 | 1 | See the table below. |
The table below outlines the content of field 7 (flags) of AmendOrderRequest.
| Bit number (from last to first) | Name | Description |
|---|
| 1 | Post-only (amend) | Enables post-only that amends the order to the best bid/ask if the edit would make it immediately executable. The amended price is then validated against price limits. Mutually exclusive with Post-only (reject) |
| 2 | Post-only (reject) | Enables post-only that rejects the edit if it would make the order immediately executable. The original order remains in the book unchanged. Mutually exclusive with Post-only (amend) |
| 3 | Reduce-only | This order will be amended at entry and at later times to ensure it can only fully or partially close an open position |
| 4 | MMP | The order will be subject to the default Market Maker Protection group |
| 5 | resetMmp | Unfreeze orders MMP group |
| 6 | Reserved for future use | |
| 7 | Reserved for future use | |
| 8 | Reserved for future use | |
AmendOrderResponse (210)
Response to confirm an AmendOrderRequest was successful, sent from the exchange to the client. Any immediate fills generated by the AmendOrderRequest will be included in the AmendOrderResponse and will NOT be sent additionally in an OrderUpdate.
| Field | Name | Type | Length | Description |
|---|
| 1 | transactTime | int64 | 8 | Nanoseconds since epoch. Time of entry into the order book |
| 2 | execId | int64 | 8 | Exchange-assigned event ID |
| 3 | clientOrderId | int64 | 8 | Numeric client order ID |
| 4 | correlationId | int64 | 8 | Client-assigned ID |
| 5 | orderId | int64 | 8 | Numeric exchange assigned order ID |
| 6 | instrumentId | int64 | 8 | Numeric instrument ID |
| 7 | limitPrice | FixedPoint9 | 8 | Price. Can differ from submitted price when post-only (amend) is enabled |
| 8 | amount | Decimal72 | 9 | Amount. Can differ from submitted amount when reduce-only is enabled |
| 9 | filledAmount | Decimal72 | 9 | Filled amount |
| 10 | receiveTime | int64 | 8 | Nanoseconds since epoch. Time of receipt of order on the gateway. |
| 11 | orderState | int8 | 1 | 1=Active
2=filled
3=cancelled
4=queued (speed bumped) |
| 12 | cancelReason | int8 | 1 | See Order Response Cancel Reasons |
| 13 | reserved | int16 | 2 | Padding for byte alignment |
| 14 | blockLengthOfFills | uint16 | 2 | 24 (bytes) |
| 15 | numberOfFills | uint16 | 2 | Indicates the length of the following repeating group containing all immediate fills when the order was submitted |
| ->16 | matchId | int64 | 8 | Transaction ID representing match, shared by all fills within match |
| ->17 | fillPrice | FixedPoint9 | 8 | Price of fill |
| ->18 | fillAmount | Decimal72 | 9 | Amount of fill |
| 19 | blockLengthOfLegs | uint16 | 2 | 33 (bytes) |
| 20 | numberOfLegs | uint16 | 2 | Indicates the length of the following repeating group containing all combo leg quantities and prices. Non-zero for trades on combo instruments only. |
| ->21 | matchId | int64 | 8 | Transaction ID representing match. |
| ->22 | instrumentId | int64 | 8 | Numeric instrument ID. |
| ->23 | legQty | Decimal72 | 9 | Quantity of this leg in the combo instrument |
| ->24 | legPrice | FixedPoint9 | 8 | Price of this leg in the combo instrument |
| ->25 | legSide | int8 | 1 | 1=BUY
-1=SELL |
AmendOrderReject (212)
Reject generated in case an AmendOrderRequest is unsuccessful.
| Field | Name | Type | Length | Description |
|---|
| 1 | transactTime | int64 | 8 | Nanoseconds since epoch. Time of entry into the order book |
| 2 | clientOrderId | int64 | 8 | Numeric client order ID |
| 3 | correlationId | int64 | 8 | Client-assigned ID |
| 4 | orderId | int64 | 8 | Numeric exchange assigned order ID |
| 5 | instrumentId | int64 | 8 | Numeric instrument ID |
| 6 | reason | int8 | 1 | Rejection reason code. See Rejection Reason Codes for possible values. |
| 7 | detailsLength | uint8 | 1 | Length of details field |
| 8 | details | char | 0-255 | ASCII-encoded string |