Order Entry

Order Entry IDs

  • orderId: A customer-defined, per connectionId, unique order identifier. This ID stays the same across subsequent modifications of the specific order.

  • modifyId: A customer-defined, per orderId, unique modify identifier. This ID must be different across subsequent modifications of the specific order.

  • ackId: A matching engine-defined, per engine instance, unique identifier for messages successfully applied to the order book. This ID includes Ack, Fill, and Closed messages but excludes Reject messages.

  • The (ackId, orderId) pair uniquely identifies an order accepted by the matching engine and applied to the order book.

  • The (ackId, orderId, modifyId) triplet uniquely identifies a modify to the respective order.

Order Entry Request

Open

Order types: All orders are limit orders. We do not support market orders, stops, stop limits, etc. We support Day and IOC orders for Time in Force.

Byte OffsetByte LengthTypeNameDescription
01charmessageTypeAlways O
18uint64orderIdOrder ID from customer
98uint64productIdProduct ID
171charsideSide: B = bid, A = ask
188int64pricePrice in ticks
264uint32quantityQuantity
301chartimeInForceTime in force: D = Day, I = IOC
31

Modify

Cancels: A modify with a quantity less than or equal to the order's fill quantity cancels the order. A modify that changes the price and sets the quantity to less than or equal to the order's fill quantity cancels the order and the price change is ignored. A quantity = 0 will short circuit the price limit rules. A modify order with quantity > 0 must conform to the price limit rules regardless of order cancellation.

Byte OffsetByte LengthTypeNameDescription
01charmessageTypeAlways M
18uint64orderIdOrder ID from customer
98uint64modifyIdModify ID from customer
178int64pricePrice in ticks
254uint32quantityQuantity
29

Note: NULL is indistinguishable from 0 in the case of modifyId. It is highly recommended to not use 0 as a modifyId to avoid this ambiguity.

Order Entry Reply

Ack

Byte OffsetByte LengthTypeNameDescription
01charmessageTypeAlways A
18uint64ackIdMatching engine acked sequence
98uint64orderIdOrder ID from customer
178uint64modifyIdModify ID from customer, NULL for open acks
25

Reject

Byte OffsetByte LengthTypeNameDescription
01charmessageTypeAlways R
18uint64orderIdOrder ID from customer
98uint64modifyIdModify ID from customer, NULL for open rejects
171uint8rejectReasonSee Reject Reason
18

Reject Reason

Request processing, and respective reject precedence, is as follows:

  1. Connection state (ex: enabled/disabled)
  2. Order state (ex: order closed)
  3. Quantity (a modify with a closing quantity is processed regardless of an invalid price modification)
  4. Price
ValueReason
0x01Account not found
0x02Product not found
0x03Order not found
0x04Order already exists
0x05Order already closed
0x06Order not changed by modify
0x07Quantity greater than max order size
0x08Quantity less than min order size
0x09Price outside price bands
0x0APrice outside price limits
0x0BPrice not tick aligned (reserved)
0x0CMarket halted. Only close requests accepted
0x0DMarket closed. No requests accepted
0x0EGive-up account not found
0x0FGive-up unauthorized
0x10Messaging rate exceeded
0x11Position limit exceeded
0x12Connection disabled
0x13Feature not supported

Closed

A closed message will be sent when the order state cannot be inferred from the normal request-reply flow. This happens when an IOC is finished matching, self-match is prevented, or a customer cancels an order outside the order entry gateway connection.

A closed message will not be sent when an order is fully filled or a modify is acked, closing the order. For example, if an IOC misses or is partially filled, a closed message will be sent. If the IOC is fully filled, a closed message will not be sent.

Byte OffsetByte LengthTypeNameDescription
01charmessageTypeAlways C
18uint64ackIdMatching engine acked sequence
98uint64orderIdOrder ID from customer
171charcloseReasonSee Close Reason
18

Close Reason

ValueReason
IIOC finished
GNon-connection cancel
SSelf-match prevention canceled

Fill

Byte OffsetByte LengthTypeNameDescription
01charmessageTypeAlways F
18uint64ackIdMatching engine acked sequence
98uint64orderIdOrder ID from customer
178int64pricePrice in ticks
254uint32quantityQuantity
291charliquidityLiquidity: A = Add, R = Remove, S = Spread leg match
30

When dealing with calendar spreads, 3 Fill messages are sent for each match. One will have either A or R liquidity corresponding to the spread contract itself. Then there will be one Fill message for each leg with S liquidity and 0 quantity which have the implied price. The order of these fills is guaranteed, where the spread fill is always immediately followed by the leg 1 fill and the leg 2 fill in that order.

Message Rate Throttling

Order entry requests are limited using a sliding window throttle. Unless otherwise stated or negotiated, order entry gateways have a 500 message per 3 seconds messaging rate. Cancels are always allowed past the messaging rate throttle. Rejects are sent in response to messages exceeding the message rate limit with a reason code 0x10 (Message rate exceeded).

Start Trading

Trade US Perpetual Futures, Physical Futures, and Options on the Bitcoin Complex®, XRP, ETH, SOL, and more.