Skip to main content

Order Entry

The Websocket Order Entry endpoint allows an authenticated user to interact with the orders in the following ways:

Note that the token used when establishing the connection must contain order-entry permissions and will only be allowed to interact with orders specifying the account the token belongs to. Additionally, Order Entry Websocket sessions are limited to 1 per user for M2M users.

Endpoints​

  • /order-entry (Authentication required)

Sequence Examples​

New Order​

Sequence of operations to send in a new order. On every update to this order, the client will receive a new execution report (i.e. Cancel, Partial Fill, Full Fill, etc.)

Order cancel / Order cancel replace​

Sequence of operations to send in an OrderCancelReplace request or an OrderCancelRequest

Order Mass Cancel​

Sequence of operations to send in an OrderMassCancelRequest

Order Mass Status​

Sequence of operations to send in an OrderMassStatusRequest

API Reference​

NewOrderSingle​

Example​

  {
"MsgType": "NewOrderSingle",
"ClOrdID": "ET5FZD2OLD",
"ExecInst": ["PARTICIPATE_DONT_INITIATE"],
"ExtendedExecInst": "RETAIL_LIQUIDITY_PROVIDER",
"Symbol": "BTC/USD",
"Side": "BUY",
"OrderQty": "1.2",
"OrdType": "LIMIT",
"Price": "98000.01",
"TimeInForce": "GOOD_TILL_DATE",
"ExpireTime": "20250102-00:00:00.000",
"Account": "my-account"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: NewOrderSingle
$.ClOrdID​
  • Type: string
  • Required: Yes
  • Value: Arbitrary unique ID among open orders. Limited to 40 chars
$.ExecInst​
  • Type: array of Strings
  • Required: No
  • Values:
    • "PARTICIPATE_DONT_INITIATE": Post-Only, order will be canceled if it crosses the market
$.ExtendedExecInst​
  • Type: string
  • Required: No
  • Default Value: Institutional
  • Values:
    • "RETAIL_LIQUIDITY_PROVIDER": This order can only be aggressed on by a retail order
    • "DESIGNATED_RETAIL": This order can aggress on RLP orders
$.Symbol​
  • Type: string
  • Required: Yes
  • Value: The symbol of the currency pair
$.Side​
  • Type: string
  • Required: Yes
  • Values:
    • "BUY"
    • "SELL"
$.OrderQty​
  • Type: string
  • Required: Yes
  • Value: The quantity of the order
$.OrdType​
  • Type: string
  • Required: Yes
  • Value: "LIMIT"
$.Price​
  • Type: string
  • Required: Yes
  • Value: The price of the order
$.TimeInForce​
  • Type: string
  • Required: No
  • Default Value: GOOD_TILL_CANCEL
  • Values:
    • "GOOD_TILL_CANCEL": Order will remain in effect until user cancels
    • "GOOD_TILL_DATE": Order will remain in effect until ExpireTime
    • "IMMEDIATE_OR_CANCEL": Immediately cancels back any quantity that can't be filled on placement
    • "FILL_OR_KILL": Immediately cancels order if entire order cannot be fully filled
$.ExpireTime​
  • Type: string
  • Required: Conditionally required if TimeInForce is "GOOD_TILL_DATE"
  • Value: Timestamp of when the order will expire in UTC. Max precision in millis (Example: 20260203-22:11:01.231)
$.Account​
  • Type: string
  • Required: Yes
  • Value: The account under which the order will be placed

OrderCancelReplaceRequest​

Example​

    {
"MsgType": "OrderCancelReplaceRequest",
"OrigClOrdID": "ET5FZD2OLD",
"ClOrdID": "ET5FZD2OLD-mod",
"ExecInst": ["PARTICIPATE_DONT_INITIATE"],
"Symbol": "BTC/USD",
"Side": "BUY",
"OrderQty": 0.1,
"OrdType": "LIMIT",
"Price": 105000,
"TimeInForce":"GOOD_TILL_DATE",
"ExpireTime": "20260501-00:00:00.000",
"Account": "my-account"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: OrderCancelReplaceRequest
$.OrigClOrdID​
  • Type: string
  • Required: Yes
  • Value: The ClOrdID of the original order
$.ClOrdID​
  • Type: string
  • Required: Yes
  • Value: Arbitrary unique ID among open orders. Limited to 40 chars
$.ExecInst​
  • Type: array of Strings
  • Required: No
  • Values:
    • "PARTICIPATE_DONT_INITIATE": Post-Only, order will be canceled if it crosses the market
$.Symbol​
  • Type: string
  • Required: Yes
  • Value: The symbol of the currency pair. Must be the same as the original order
$.Side​
  • Type: string
  • Required: Yes
  • Values: Must be the same as the original order
    • "BUY"
    • "SELL"
$.OrderQty​
  • Type: string
  • Required: Yes
  • Value: The new quantity of the order
$.OrdType​
  • Type: string
  • Required: Yes
  • Value: "LIMIT"
$.Price​
  • Type: string
  • Required: Yes
  • Value: The new price of the order
$.TimeInForce​
  • Type: string
  • Required: No
  • Default Value: GOOD_TILL_CANCEL
  • Values: Must be the same as the original order
$.ExpireTime​
  • Type: string
  • Required: Conditionally required if TimeInForce is "GOOD_TILL_DATE"
  • Value: Timestamp of when the new order will expire in UTC. Max precision in millis (Example: 20260203-22:11:01.231)
$.Account​
  • Type: string
  • Required: Yes
  • Value: The account in which the original order was placed

OrderCancelRequest​

Example​

    {
"MsgType": "OrderCancelRequest",
"OrigClOrdID": "ET5FZD2OLD",
"ClOrdID": "ET5FZD2OLD-cancel",
"Symbol": "BTC/USD",
"Side": "BUY",
"Account": "my-account"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: OrderCancelRequest
$.OrigClOrdID​
  • Type: string
  • Required: Yes
  • Value: The ClOrdID of the original order
$.ClOrdID​
  • Type: string
  • Required: Yes
  • Value: Arbitrary unique ID among open orders. Limited to 40 chars
$.Symbol​
  • Type: string
  • Required: Yes
  • Value: The symbol of the currency pair. Must be the same as the original order
$.Side​
  • Type: string
  • Required: Yes
  • Values: Must be the same as the original order
    • "BUY"
    • "SELL"
$.Account​
  • Type: string
  • Required: Yes
  • Value: The account in which the original order was placed

OrderMassCancelRequest​

Example​

    {
"MsgType": "OrderMassCancelRequest",
"ClOrdID": "ET5FZD2OLD",
"MassCancelRequestType": "CANCEL_ORDERS_FOR_A_SECURITY",
"Symbol": "BTC/USD",
"Account": "my-account"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: OrderMassCancelRequest
$.ClOrdID​
  • Type: string
  • Required: Yes
  • Value: Arbitrary unique ID among open orders. Limited to 40 chars
$.MassCancelRequestType​
  • Type: string
  • Required: Yes
  • Values:
    • "CANCEL_ALL_ORDERS": Cancels all orders for the specified account
    • "CANCEL_ORDERS_FOR_A_SECURITY": Cancels all orders for the specified Symbol for the specified account
$.Symbol​
  • Type: string
  • Required: Conditionally required if MassCancelRequestType is "CANCEL_ORDERS_FOR_A_SECURITY"
  • Value: The symbol in which the orders will be cancelled for
$.Account​
  • Type: string
  • Required: Yes
  • Value: The account in which the orders will be cancelled for

OrderMassStatusRequest​

Example​

    {
"MsgType": "OrderMassStatusRequest",
"MassStatusReqID": "mass-status",
"MassStatusReqType": "STATUS_FOR_ALL_ORDERS",
"Account": "my-account"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: OrderMassCancelRequest
$.MassStatusReqID​
  • Type: string
  • Required: Yes
  • Value: Unique ID associated to mass status request. Max length of 16 chars
$.MassStatusReqType​
  • Type: string
  • Required: Yes
  • Value: "STATUS_FOR_ALL_ORDERS": Returns all open orders
$.Account​
  • Type: string
  • Required: Yes
  • Value: The account for which the open orders will be sent for

ExecutionReport​

Example​

{
"MsgType": "ExecutionReport",
"Account": "TRADERA",
"AvgPx": "0",
"ClOrdID": "FDS6GBFTNVN0FKKQ",
"CumQty": "0",
"ExecID": "3322644122061242369",
"OrderID": "3322644122061242368",
"OrderQty": "1",
"OrdStatus": "NEW",
"OrdType": "LIMIT",
"Price": "95000.99",
"Side": "BUY",
"Symbol": "BTC/USD",
"TimeInForce": "GOOD_TILL_DATE",
"ExpireTime": "20250206-18:01:30.442"
"TransactTime": "20250206-18:01:30.442376000",
"ExecType": "NEW",
"LeavesQty": "1",
"ExtendedExecInst": "DESIGNATED_RETAIL",
"NoMiscFees":[
{
"MiscFeeAmt":"33.15",
"MiscFeeCurr":"USD",
"MiscFeeType":"OTHER",
"MiscFeeBasis":"ABSOLUTE"
}
],
"NoCapacityEntries":[
{
"AvailableCapacity":"100.085",
"CapacityCurrency":"BTC",
"CapacitySide":"BUY"
},
{
"AvailableCapacity":"18999.098",
"CapacityCurrency":"USD",
"CapacitySide":"SELL"
}
]
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: ExecutionReport
$.OrderID​
  • Type: string
  • Required: Yes
  • Value: Unique order identifier generated by the match engine. Can be used to track the full life of the order. Will be NONE on order rejected
$.ClOrdID​
  • Type: string
  • Required: Yes
  • Value: Unique order identifier entered by the user
$.OrigClOrdID​
  • Type: string
  • Required: No
  • Value: Unique order identifier entered by the user of the original order
$.ExecID​
  • Type: string
  • Required: Yes
  • Value: Unique execution identifier generated by the match engine
$.ExecType​
  • Type: string
  • Required: Yes
  • Values: The type of Execution Report
    • "NEW"
    • "CANCELED"
    • "REPLACE"
    • "REJECTED"
    • "EXPIRED"
    • "TRADE"
    • "ORDER_STATUS"
$.OrdStatus​
  • Type: string
  • Required: Yes
  • Values: The status of the order
  • "NEW"
  • "PARTIALLY_FILLED"
  • "FILLED"
  • "CANCELED"
  • "REPLACED"
  • "REJECTED"
  • "EXPIRED"
$.OrdRejReason​
  • Type: string
  • Required: No
  • Values: Identifies the reason for an order being rejected
    • "UNKNOWN_SYMBOL"
    • "UNKNOWN_ORDER"
    • "DUPLICATE_ORDER"
    • "UNSUPPORTED_ORDER_CHARACTERISTIC"
    • "INCORRECT_QUANTITY"
    • "PRICE_EXCEEDS_CURRENT_PRICE_BAND"
    • "OTHER"
    • "ORDER_BOOK_IN_SUSPENDED_STATE"
    • "ORDER_BOOK_IN_HALT_STATE"
    • "ORDER_BOOK_IN_EXPIRED_STATE"
    • "ORDER_BOOK_IN_LISTED_STATE"
    • "ORDER_BOOK_IN_POST_ONLY_STATE"
    • "ORDER_BREACHES_BASE_POSITION_LIMIT"
    • "ORDER_BREACHES_QUOTE_POSITION_LIMIT"
    • "ACCESS_TO_DESIGNATED_RETAIL_DENIED"
$.Account​
  • Type: string
  • Required: Yes
  • Value: The account associated with the order
$.Symbol​
  • Type: string
  • Required: Yes
  • Value: The instrument of the order
$.Side​
  • Type: string
  • Required: Yes
  • Values:
    • "BUY"
    • "SELL"
$.OrderQty​
  • Type: string
  • Required: Yes
  • Value: The quantity of the order
$.OrderType​
  • Type: string
  • Required: Yes
  • Value: "LIMIT"
$.Price​
  • Type: string
  • Required: Yes
  • Value: The price of the order
$.Currency​
  • Type: string
  • Required: Yes
  • Value: The currency used for price or quantity fields
$.TimeInForce​
  • Type: string
  • Required: No
  • Values: The TIF of the order
    • "GOOD_TILL_CANCEL"
    • "GOOD_TILL_DATE"
    • "IMMEDIATE_OR_CANCEL"
    • "FILL_OR_KILL"
$.ExpireTime​
  • Type: string
  • Required: No
  • Value: UTC timestamp of expiry for GTD order
$.ExecInst​
  • Type: string
  • Required: No
  • Value: Indicates if the order is Post-Only "PARTICIPATE_DONT_INITIATE"
$.ExtendedExecInst​
  • Type: string
  • Required: No
  • Value: Indicates if the order is RLP or Designated retail
    • "DESIGNATED_RETAIL"
    • "RETAIL_LIQUIDITY_PROVIDER"
$.LastQty​
  • Type: string
  • Required: No
  • Value: Quantity bought/sold on this(last) fill
$.LastPx​
  • Type: string
  • Required: No
  • Value: Price of this(last) fill
$.LeavesQty​
  • Type: string
  • Required: Yes
  • Value: Order Quantity available for further execution
$.CumQty"​
  • Type: string
  • Required: Yes
  • Value: Quantity executed in the current order chain
$.AvgPx​
  • Type: string
  • Required: Yes
  • Value: Always 0
$.TradeDate​
  • Type: string
  • Required: No
  • Value: Indicates date of trade referenced in this message
$.TransactTime"​
  • Type: string
  • Required: Yes
  • Value: Client provided timestamp for the message
$.SettlCurrency​
  • Type: string
  • Required: No
  • Value: Currency code of settlement denomination
$.Text​
  • Type: string
  • Required: No
  • Value: Describes rejection reason
$.LastLiquidityInd​
  • Type: string
  • Required: No
  • Value: Indicates liquidity code for this execution
    • "ADDED_LIQUIDITY": This order added liquidity to the Exchange book
    • "REMOVED_LIQUIDITY": This order removed liquidity to the Exchange book
    • "RETAIL_LIQUIDITY_ADDED": This order added RLP liquidity to the Exchange book
    • "RETAIL_LIQUIDITY_REMOVED": This order removed RLP liquidity to the Exchange book
    • "DESIGNATED_RETAIL_ADDED": This order added Designated Retail liquidity to the Exchange book
    • "DESIGNATED_RETAIL_REMOVED": This order removed Designated Retail liquidity to the Exchange book
$.TrdMatchID​
  • Type: string
  • Required: No
  • Value: Trade identifier assigned by the match engine
$.MassStatusReqID​
  • Type: string
  • Required: No
  • Value: The MassStatusReqID of the mass order status request, if this execution report has ExecType of ORDER_STATUS
$.NoMiscFees​
  • Type: array
  • Required: No
  • Value: The fee data associated with the order. If no fees, this field will not be present.
$.NoMiscFees[*].MiscFeeAmt​
  • Type: string
  • Required: No
  • Value: The miscellaneous fee value
$.NoMiscFees[*].MiscFeeCurr​
  • Type: string
  • Required: No
  • Value: The miscellaneous fee currency
$.NoMiscFees[*].MiscFeeType​
  • Type: string
  • Required: No
  • Value: The miscellaneous fee type
    • "OTHER": represents estimated fee on new order, replace, and order status
    • "EXCHANGE_FEES": represents execution fees on fills
$.NoMiscFees[*].MiscFeeBasis​
  • Type: string
  • Required: No
  • Value: Defines the unit for miscellaneous fee. Always "ABSOLUTE"
$.NoCapacityEntries​
  • Type: array
  • Required: No
  • Value: The data related to available trading capacity as a result of the order.
$.NoCapacityEntries[*].AvailableCapacity​
  • Type: string
  • Required: No
  • Value: The available trading capacity. In the case of SPOT, the remaining long/short trade limit capacity for the given asset. In the case of PERP, the available collateral for the given asset.
$.NoCapacityEntries[*].CapacityCurrency​
  • Type: string
  • Required: No
  • Value: The asset of which the available trading capacity relates to
$.NoCapacityEntries[*].CapacitySide​
  • Type: string
  • Required: No
  • Value: The side of the limit (long/short) being described. Present on SPOT order only.
    • "BUY": Long limit
    • "SELL": Short limit

OrderCancelReject​

Example​

  {
"MsgType":"OrderCancelReject",
"Account":"BC1",
"ClOrdID":"E1N1IRB4VGEAEWOD",
"OrderID":"NONE",
"OrdStatus":"REJECTED",
"OrigClOrdID":"QMZK23YOECFAOUDO",
"Text":"UNKNOWN_ORDER",
"TransactTime":"20250206-18:30:49.045068000",
"CxlRejReason":"UNKNOWN_ORDER",
"CxlRejResponseTo":"ORDER_CANCEL_REPLACE_REQUEST"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: OrderCancelReject
$.OrderID​
  • Type: string
  • Required: Yes
  • Value: Unique order identifier generated by the match engine. Can be used to track the full life of the order. Will be NONE on order rejected
$.ClOrdID​
  • Type: string
  • Required: Yes
  • Value: Unique order identifier entered by the user
$.OrigClOrdID​
  • Type: string
  • Required: Yes
  • Value: Unique order identifier entered by the user of the original order
$.OrdStatus​
  • Type: string
  • Required: Yes
  • Value: The status of the order, in this case REJECTED
$.Account​
  • Type: string
  • Required: Yes
  • Value: The account of the given order
$.TransactTime​
  • Type: string
  • Required: Yes
  • Value: The time of the transaction from match engine
$.CxlRejResponseTo​
  • Type: string
  • Required: Yes
  • Values: The request that has been rejected
    • "ORDER_CANCEL_REQUEST
    • "ORDER_CANCEL_REPLACE_REQUEST
$.CxlRejReason​
  • Type: string
  • Required: Yes
  • Value: The reason why the order was rejected
    • "UNKNOWN_ORDER"
    • "PRICE_EXCEEDS_CURRENT_PRICE_BAND"
    • "DUPLICATE_CLORDID_RECEIVED"
    • "OTHER"
    • "ORDER_BOOK_IN_SUSPENDED_STATE"
    • "ORDER_BOOK_IN_HALT_STATE"
    • "ORDER_BOOK_IN_EXPIRED_STATE"
    • "ORDER_BOOK_IN_LISTED_STATE"
    • "ORDER_BOOK_IN_POST_ONLY_STATE"
    • "ORDER_BREACHES_BASE_POSITION_LIMIT"
    • "ORDER_BREACHES_QUOTE_POSITION_LIMIT"
$.Text​
  • Type: string
  • Required: Yes
  • Value: Describes reason for rejection

OrderMassStatusRequestEnd​

A message indicating the end of the OrderMassStatusRequest which can be linked by MassStatusReqID

Example​

    {
"MsgType": "OrderMassStatusRequestEnd",
"MassStatusReqID": "mass-status"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: OrderMassStatusRequestEnd
$.MassStatusReqID​
  • Type: string
  • Required: Yes
  • Value: The MassStatusReqID used in the request