Orders have a status field. This specification details a set of situations and the expected status for an order.
For the definition of each Time In Force option, see the Order Types spec
Pegged orders can be parked under certain circumstances:
- When a market moves in to an auction
- When a pegged orders need to be repriced and can't be
- When a reference for a pegged order does not exist
For a full outline of these behaviours, see 0037-OPEG-pegged_orders. When an order has a status of parked:
- Only pegged orders can be parked
- Parked pegged orders are inactive - i.e. are not on the book and will never match.
- Parked pegged orders can be amended as normal
- Parked pegged orders can cancelled as normal (see 0068-MATC)
- If the market is in continuous trading, pegged orders are repriced as normal
- Orders can have a status of REJECTED if there is insufficient margin to place the order
- Order Pricing methods are not listed below as they don't change the status outcome
Stopped
andCancelled
are used to determine whether an order was closed as a result of a user action (Cancelled
) or by the system (Stopped
) as a result of, for example, insufficient margin (see Position Resolution)- A pegged order that is unable to reprice or during an auction will have a status of PARKED. This indicates that the order in not on the order book but can re-enter it once the conditions change
If, during continuous trading, an order would be filled or partially filled with an existing order from the same party aka "wash" trade, the order is rejected. Any existing fills that happen before the wash trade is identified will be kept. FOK rules still apply for wash trading so if a wash trade is identified before the full amount of the order is complete, the order will be stopped and nothing filled. Wash trading is allowed on auction uncrossing.
Filled State | Resulting status | Reason |
---|---|---|
Unfilled | Stopped | Order would match with an order with the same partyID |
Partially | Partially Filled | Order has been partially filled but the next partial fill would be with an order with the same partyID |
Fill or Or Kill (0024-OSTA-001)
For product spot: (0024-OSTA-030)
Time In Force | Filled | Resulting status |
---|---|---|
FOK | No | Stopped |
FOK | Yes | Filled |
Immediate Or Cancel (0024-OSTA-002)
For product spot: (0024-OSTA-031)
Time In Force | Filled | Resulting status |
---|---|---|
IOC | No | Stopped |
IOC | Partial | Partially Filled |
IOC | Yes | Filled |
Good ’Til Cancelled (0024-OSTA-003)
For product spot: (0024-OSTA-032)
Time In Force | Filled | Cancelled by user | Stopped by system | Resulting status |
---|---|---|---|---|
GTC | No | No | No | Active |
GTC | No | No | Yes | Rejected |
GTC | No | Yes | No | Cancelled |
GTC | Partial | No | No | Active |
GTC | Partial | Yes | No | Cancelled |
GTC | Partial | No | Yes | Rejected |
GTC | Yes | No | No | Filled |
Good ’Til Time (0024-OSTA-004)
For product spot: (0024-OSTA-033)
Time In Force | Filled | Expired | Cancelled by user | Stopped by system | Resulting status |
---|---|---|---|---|---|
GTT | No | No | No | No | Active |
GTT | No | Yes | No | No | Expired |
GTT | No | No | Yes | No | Cancelled |
GTT | No | No | No | Yes | Stopped |
GTT | Partial | No | No | No | Active |
GTT | Partial | Yes | No | No | Expired |
GTT | Partial | No | Yes | No | Cancelled |
GTT | Partial | No | No | Yes | Stopped |
GTT | Yes | No | No | No | Filled |
GTT | Yes | Yes | No | No | not possible (see note) |
Note: The last row in the table above is added for clarity. If the order was filled, it is marked as Filled and it is removed from the book, so it can't expire after being filled.
- If, during continuous trading, an order would be filled or partially filled with an existing order from the same party aka "wash" trade, the order is rejected. The reason for rejection should be clear on the order status: "rejected to prevent a wash trade". (0024-OSTA-005). For product spot: (0024-OSTA-034)
- Any existing fills that happen before the wash trade is identified will be kept. The order should be market both "partially filled" and "rejected to prevent wash trade" (0024-OSTA-006). For product spot: (0024-OSTA-035)
- FOK rules still apply for wash trading so if a wash trade is identified before the full amount of the order is complete, the order will be stopped and nothing filled. (0024-OSTA-007). For product spot: (0024-OSTA-036)
- Wash trading is allowed on auction uncrossing. (0024-OSTA-008). For product spot: (0024-OSTA-037)
- Test that market settlement cashflows only depend on parties positions and is independent of what order types there are on the book. (0024-OSTA-009)
- Order reason of
ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE
is given if a position is closed out because they do now have enough margin to cover the position (0024-OSTA-010) - Order reason of
ORDER_ERROR_MARGIN_CHECK_FAILED
is given if a new order is placed and the user does not have enough collateral to cover the initial margin requirements (0024-OSTA-011) - Order reason of
ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS
when a non persistent order would cause the price to move outside of the price bounds (0024-OSTA-012). For product spot: (0024-OSTA-038) - Order reason of
ORDER_ERROR_GFN_ORDER_DURING_AN_AUCTION
when the market is in auction and a GFN order is sent in (0024-OSTA-013). For product spot: (0024-OSTA-039) - Order reason of
ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION
when trying to send an IOC order during auction (0024-OSTA-014).. For product spot: (0024-OSTA-040) - Order reason of
ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION
when trying to send a FOK order during auction (0024-OSTA-015). For product spot: (0024-OSTA-041) - Order reason of
ORDER_ERROR_GFA_ORDER_DURING_CONTINUOUS_TRADING
when trying to send a GFA order during normal trading (0024-OSTA-016). For product spot: (0024-OSTA-042) - Order reason of
ORDER_ERROR_INVALID_EXPIRATION_DATETIME
when sending a GTT with the expiry is before the creation time (0024-OSTA-017). For product spot: (0024-OSTA-043) - Order reason of
ORDER_ERROR_MARKET_CLOSED
when trying to send an order when the market is closed (0024-OSTA-018). For product spot: (0024-OSTA-044) - Order reason of
ORDER_ERROR_INVALID_TYPE
when trying to send an order with a non valid order type (0024-OSTA-019). For product spot: (0024-OSTA-045) - Order reason of
ORDER_ERROR_INVALID_MARKET_ID
when sending an order with an invalid market ID (0024-OSTA-020). For product spot: (0024-OSTA-046) - Order reason of
ORDER_ERROR_MUST_BE_LIMIT_ORDER
when sending a pegged order that is not a LIMIT order (0024-OSTA-021) - Order reason of
ORDER_ERROR_MUST_BE_GTT_OR_GTC
pegged order must be either GTC or GTT (0024-OSTA-022) - Order reason of
ORDER_ERROR_WITHOUT_REFERENCE_PRICE
pegged order must have a reference field (0024-OSTA-023) - Order reason of
ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE
buy pegged order cannot reference the ask price (0024-OSTA-024) - Order reason of
ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO
pegged order offset must be > 0 when referencingMID
price (0024-OSTA-025) - Order reason of
ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE
sell pegged order cannot reference the bid price (0024-OSTA-026) - Order reason of
ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE
user does not have enough of the asset or does not have an account at all (0024-OSTA-027). For product spot: (0024-OSTA-047) - Order reason of
ORDER_ERROR_SELF_TRADING
when the order would match with one from the same user while not in auction (0024-OSTA-029). For product spot: (0024-OSTA-048)