Order Amendment, Cancellation, and Order Rules#
Order Amendment Behavior#
Users can locate and amend an existing order by Order ID (oid) or Client Order ID (clientOrderId).
oidandclientOrderIdare used only to identify the target order; provide one of them.- Neither
oidnorclientOrderIdcan be changed through an amendment. - If an amendment includes
orderType, the complete corresponding substructure must be provided. Partial updates to internal fields are not supported. - Omitting
orderTypemeans that the order type and trigger parameters are unchanged.
Amendment Scope and Restrictions#
Standard Limit Orders#
- Only
priceandsizecan be amended. - Cannot be converted to Trigger or TPSL orders.
tifandexpiresAftercannot be amended.
Standalone Trigger Orders#
| Order Type | Amendable Fields | Permitted Type Switches |
|---|---|---|
| Trigger Market | Trigger Price, Order Amount, Trigger Price Type | May switch to Trigger Limit; a valid Order Price is required. |
| Trigger Limit | Trigger Price, Order Price, Order Amount, Trigger Price Type | May switch to Trigger Market; the post-trigger limit price is no longer used. |
Trigger Price Type may be switched between Index Price and Mark Price.
Order-Attached TPSL#
Before Child-Order Activation#
| Child Order Type | Amendable Fields | Permitted Type Switches |
|---|---|---|
| TP or SL Trigger Market | Trigger Price | TP may switch among TP Limit, TP Trigger Market, and TP Trigger Limit. SL may switch between SL Trigger Market and SL Trigger Limit. |
| TP or SL Trigger Limit | Trigger Price, Order Price | Same as above. |
| TP Limit | Order Price | TP may switch to TP Trigger Market or TP Trigger Limit. |
- Trigger Price Type may be switched between Index Price and Mark Price for trigger orders.
- Before activation, identify the TPSL child order with its TPSL child
oid.
After Child-Order Activation#
| Child Order Type | Amendable Fields | Permitted Type Switches |
|---|---|---|
| TP or SL Trigger Market | Trigger Price, Order Amount | TP Trigger Market and TP Trigger Limit may switch between each other. SL Trigger Market and SL Trigger Limit may switch between each other. |
| TP or SL Trigger Limit | Trigger Price, Order Price, Order Amount | Same as above. |
| TP Limit | Order Price, Order Amount | Type switching is not supported. |
- After conversion to a live order, identify the order using the live order's
oid. - Trigger Price Type may be switched between Index Price and Mark Price for trigger orders.
Position-Attached TPSL#
Entire Position#
Entire Position TPSL applies to the full remaining quantity of a specified position. When triggered, it closes the actual remaining position at that time; therefore, Order Amount cannot be specified or amended.
- Only Trigger Market is supported.
- Trigger Price can be amended.
- Trigger Price Type may be switched between Index Price and Mark Price.
- Order Amount cannot be amended.
- Switching to Trigger Limit or TP Limit is not supported.
Partial Position#
| Order Type | Amendable Fields | Permitted Type Switches |
|---|---|---|
| Trigger Market | Trigger Price, Order Amount | May switch to Trigger Limit. |
| Trigger Limit | Trigger Price, Order Price, Order Amount | May switch to Trigger Market. |
| TP Limit | Order Price, Order Amount | Type switching is not supported. |
- Position TP Limit is immediately converted to a live Reduce-Only GTC Limit order.
- Amend a Position TP Limit using the live order
oidinchildren[0]. - Whether Trigger Price Type can switch between Index Price and Mark Price for Partial Position Trigger orders is not defined and must be confirmed by trading and on-chain engineering.
Non-Amendable Fields#
The following fields cannot be changed through an amendment:
assetIdsidemarketType, includingmarginModeandpositionSidereduceOnlysizeTypetifexpiresAfterclientOrderIdgrouping
To change any of these business attributes, cancel the order and submit a new order.
Other Amendment Restrictions#
- Trigger orders cannot be amended in Prediction Market.
- IOC and FOK orders do not remain on the order book and therefore cannot be amended.
Validation and Matching Priority#
| Amended Parameter | Scenario | Revalidation Required | Re-enters Matching Priority | Rule |
|---|---|---|---|---|
| Price | Changed to a different order price | Yes. Order limits, price or position value, frozen margin, and leverage-based position-value checks may apply. | Yes | Regardless of whether the price increases or decreases, the order moves to the end of the new price-level queue. |
| Size | Increased | Yes. Additional frozen margin may be required. | Yes | The entire amended order is treated as a new order and moves to the end of the current price-level queue. |
| Size | Decreased | Yes. Applicable order-limit checks still apply. | No | The original queue priority is retained. |
Filled-Size Inheritance and Amendment Failure#
- A successfully amended order inherits the original order's cumulative filled size.
- Semantically, a successful amendment cancels the original order and creates the amended order.
- Example:
orderSize=10,accFillSz=4. After increasing the size toorderSize=15, the result isorderSize=15,accFillSz=4. - If the new
sizeis less than or equal toaccFillSz, the effective order size is set toaccFillSz, leaving zero remaining quantity. The order status becomespart_filled_canceled. - If validation fails, the original order remains unchanged and is not cancelled first.
Reduce-Only Order Amendment and Cancellation Logic#
Reduce-Only is an order attribute. When reduceOnly=true, an order may only reduce an existing position; it cannot increase a position or open a position in the opposite direction.
- Standard Limit and standalone Trigger orders support
reduceOnly=true. - The execution order created when a Trigger order fires must continue to comply with Reduce-Only restrictions.
- Position-Attached TPSL can only reduce its corresponding position.
- Order-Attached TPSL applies only to Market, Limit, or Trigger parent orders with
reduceOnly=false. - A parent order with
reduceOnly=truemust not include Order-Attached TPSL. The request must be rejected as a whole and must not be automatically converted to Position-Attached TPSL. - Multiple Reduce-Only orders may coexist for the same position.
Placement and Amendment Validation#
- A corresponding position must exist.
- The order side must be opposite to the position side.
- New-position margin validation is not performed, but the order must still pass general account-status, instrument-status, price, size, precision, and order-count checks.
- The
reduceOnlyattribute cannot be changed through an amendment. Cancel and resubmit the order to change it. - Price amendments and size increases or decreases continue to follow the standard matching-priority rules.
Excess-Size Trimming Rules#
- The system calculates the aggregate remaining size of Reduce-Only orders by account,
assetId + marginMode + side. - In Hedge mode, long and short positions are calculated separately, and
sidemust correspond to thepositionSidebeing reduced. - Orders remain unchanged if their aggregate remaining size does not exceed the corresponding position size.
- After placement or amendment, if aggregate remaining size exceeds the position size, the system trims orders according to FIFO by
orderCreateTime, from oldest to newest:- Reduce the oldest existing Reduce-Only orders first.
- Cancel an order if its remaining size is less than or equal to the amount that must be trimmed.
- Otherwise, reduce only the required amount from that order.
- Continue until aggregate remaining size no longer exceeds the position size.
- The same excess check and FIFO trimming are performed when fills, liquidation, ADL, settlement, or other events reduce the position.
- Trimming affects only the quantity exceeding the position size and must never result in a reverse position.
Transaction Execution Order and Nonce Invalidation#
-
Transactions enter a block in the order received by the Sequencer. Within the same block, execution priority is:
- Noop
- Post-Only placement or amendment to Post-Only
- Cancellation
- All other operations
-
Transactions with the same priority retain their original Sequencer receipt order.
-
A Noop cannot be replayed across blocks and cannot invalidate an action that has completed or whose nonce has already been consumed.
- Order Amendment BehaviorAmendment Scope and RestrictionsStandard Limit OrdersStandalone Trigger OrdersOrder-Attached TPSLBefore Child-Order ActivationAfter Child-Order ActivationPosition-Attached TPSLEntire PositionPartial PositionNon-Amendable FieldsOther Amendment RestrictionsValidation and Matching PriorityFilled-Size Inheritance and Amendment FailureReduce-Only Order Amendment and Cancellation LogicPlacement and Amendment ValidationExcess-Size Trimming RulesTransaction Execution Order and Nonce Invalidation
