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.Pending amend limit
The number of unacknowledged amend (replace) requests per order is capped. An amend counts as pending from the time the exchange receives it until itsAmendOrderResponse or AmendOrderReject is generated:
Once the cap is reached, any further amend on that order — the 5th for a normal order, the 2nd for an OCO or reduce-only order — is rejected with
AmendOrderReject reason 19 (TOO_MANY_PENDING_REPLACES) until one of the pending amends is acknowledged.
This cap applies per order, not per session or connection: it is independent of the gateway rate limits and is not a gateway-side concurrency limit. OCO and per-order reduce-only orders originate on the other Deribit APIs (see Placing a New Order); the tighter cap applies to those orders regardless of which API amends them.
AmendOrderRequest (110)
Request to change the modifiable fields of an existing order.Null values: Some optional fields use
NULL_LONG / NULL_QUANTITY (0x8000000000000000L) as a sentinel to indicate “not set”. For example, set displayAmount = NULL_QUANTITY to keep the order non-iceberg.
The table below outlines the content of field 7 (flags) of
AmendOrderRequest.
No reduce-only flag: reduce-only cannot be set per order in SBE, on amend or on submit. See Placing a New Order for the alternatives.
AmendOrderResponse (210)
Response to confirm anAmendOrderRequest 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.
If the amendment causes the order to aggress and it is speed bumped, the AmendOrderResponse is sent immediately with orderState = 4 (queued). Once the speed bump period expires, an unsolicited OrderPlaced message is sent. See Speed Bumps for details.
AmendOrderReject (212)
Reject generated in case anAmendOrderRequest is unsuccessful.