NAV
shell ruby python javascript

Overview

Welcome to BO. BO offers a diverse array of connection protocols and messaging protocols.

Connection Protocols

  1. REST (HTTP)
  2. Websockets
  3. TCP/IP

Messaging Protocols

  1. REST
  2. JSON
  3. Google Protobuf's
  4. BO's Proprietary Binary Protocol

Msg-Delivery Protocol Differences

Once the data has been extracted from the socket buffer, the messages themselves have no differences. JSON over TCP/IP is the same as JSON over websockets. The only protocol with a real difference is REST but fortunately, there is only one delivery mechanism for it. Therefore since every user has their own way of reading data from the socket buffer, we will not delve into that area. Instead, this document is intended to explain how to parse the data which was received irregardless of the delivery mechanism be it TCP/IP or Websockets.

Message Headers

Most messages in the BO messaging protocols have a header preceeding the message. Message headers increase throughput by preventing the processing of data until a full message is received. The message headers also clearly define the message type received which adds efficiency in the processing of incoming data. The different message headers will be explained in the appropriate Messaging Protocol Sections. In BOs messaging protocols, there are two ways to identify the message received, one from the afore mentioned header and the other is from the message itself. The message types in the header are listed below:

Char message types

  1. BOClientLogon = 'H'
  2. BORiskUpdateRequest = 'w'
  3. BORiskUserSymbol = 'N'
  4. BOInstrumentRequest = 'Y'
  5. BOInstrument = 'Q'
  6. BOOpenOrderRequest = 'e'
  7. BOCollateralUpdateReq = 'f'
  8. BOCollateralData = 'h'
  9. BOTransaction = 'T'

Symbol Enums

Symbol Enums are replacements for the character based instrument name to a short integer. Symbols Enums are included in almost all BO messages pertaining to orders, risk management and reporting. Symbol Enums are used to replace hashing functions necessary to find either orders, instrument data or risk information normally associated with instruments in most other trading systems. It is essential they be included in the messages which require them. Failure to include them will result in a reject of the message and wrong symbol Enums will result in undefined behavior. Amer the login is complete, the user can send a BOInstrumentRequest message to the OES (Order Entry Server) and will receive back a BOInstrument message which contains all information for each instrument including the symbol name and the symbol Enum for that symbol name. The BOInstrumentRequest and BOInstrument messages will be covered in detail in a subsequent section. `

Current Instruments supported and their corresponding Symbol Enums

Instrument Name Symbol Enum
BTCUSD 1
USDUSDT 2
FLYUSDT 3
BTCUSDT 4

System Enums

MESSAGE_TYPE

Field Value(short)
ORDER_NEW 1
CANCEL_REPLACE
MARGIN_CANCEL_REPLACE
MARGIN_EXECUTE
ORDER_STATUS
ORDER_CANCEL
MARGIN_CANCEL
EXECUTION
EXECUTION_PARTIAL
MARGIN_EXECUTION 10
MARGIN_PARTIAL_EXECUTION
REJECT
ORDER_REJECT
ORDER_ACK
CANCELLED 15
REPLACED
QUOTE_FILL
QUOTE_FILL_PARTIAL
MARGIN_REPLACED
CANCEL_REPLACE_REJECT 20
INSTRUMENT
INSTRUMENT_REQUEST
RISK_REJECT
TOB_MSG
THREE_LAYER_MD_MSG 25
FIVE_LAYER_MD_MSG
TEN_LAYER_MD_MSG
TWENTY_LAYER_MD_MSG
THIRTY_LAYER_MD_MSG
EXEC_REPORT 30
COLLATERAL_DATA
COLLATERAL_UPDATE_REQ
RISK_USER_SYMBOL
RISK_UPDATE_REQUEST
OPEN_ORDER_REQUEST 35
CLIENT_LOGON
MD_SNAPSHOT
MD_SUBSCRIBE

UPDATE_TYPE

Field Value(short)
NORMAL_UPDATE 1
USER_REQUEST
UNSOLICITED
EXCHANGE_REQUEST
SNAPSHOT 1
SNAPSHOT_START
SNAPSHOT_CONTINUATION
SNAPSHOT_FINISH
UPDATE
POSS_DUP

ORD_TYPE

Field Value (short)
LMT 1
MKT
STOP_MKT
STOP_LMT
PEG
HIDDEN
PEG_HIDDEN
OCO
ICE
OCO_ICE
BRACKET
SNIPER_MKT
SNIPER_LIMIT
TSM (TRAILING_STOP_MKT)
TSL (TRAILING_STOP_LMT)
TPSL_MARKET (Has 3 prices associated with it, entry, profit and stop)
TPSL_LIMIT (Has 3 prices associated with it, entry, profit and stop)

ATTRIBUTE_TYPES

Field Value(short)
RESERVED_TYPE
HIDDEN_TYPE 1
DISPLAY_TYPE
SIZEINCREMENT_TYPE
POST_TYPE
PRICEINCREMENT_TYPE
OFFSET_TYPE
STOP_MKT_TYPE
STOP_LMT_TYPE
PEG_TYPE
TSL_TYPE
TSM_TYPE

TIF

Field Value(short)
FOK 1
GTC
IOC
POO (Make only)
RED (Reduce only)
DAY

BOSide

Field Value(short)
BUY 1
SELL
SELLSHORT

FEE_TYPE

Field Value(short)
MAKE 1
TAKE

SUBSCRIBE_TYPE

Field Value(short)
TOB 1
THREELAYERS
FIVELAYERS
TENLAYERS
TWENTYLAYERS
THIRTYLAYERS
FOB_DATA
FLB_DATA

TRANSACTION_OFFSET

Field Value(short)
MESSAGE_TYPE_OFFSET 4
ATTRIBUTE 6
ACCOUNT 8
ORDER_ID 12
SYMBOL_ENUM 20
ORDER_TYPE 22
SYMBOL_TYPE 24
BO_PRICE 26
BO_SIDE 34
BO_ORDER_QTY 36
BO_TIME_IN_FORCE 44
STOP_LIMIT_PRICE 46
SYMBOL 54
ORIG_ORDER_ID 66
BO_CANCEL_SHARES 74
EXEC_ID 82
EXEC_SHARES 90
REMAINING_QUANTITY 98
LIMIT_CROSS 106
EXPIRATION_DATE 114
TRADER_ID 126
REJECT_REASON 132
SENDING_TIME 134
TRADING_SESSION_ID 142
KEY 146
DISPLAY_SIZE 150
REFRESH_SIZE 158
LAYERS 166
SIZE_INCREMENT 168
PRICE_INCREMENT 176
PRICE_OFFSET 184
BO_ORIGPRICE 192
EXEC_PRICE 200
MSG_SEQ_NUM 208
TAKE_PROFIT_PRICE 216
TRIGGER_TYPE 224
ATTRIBUTES_TYPE 226

LOGON_STATUS

Field Value(short)
FAILED 1
SUCCESSFUL

SYMBOL_VALUE_ENUM

Field Value(short)
BTCUSD 1
USDUSDT
FLYUSDT
BTCUSDT

BO_REJECT_CODE

Field Value(short)
ORDER_NOT_FOUND 1
USER_NOT_FOUND
ACCOUNT_NOT_FOUND
INVALID_KEY
ACCOUNT_DISABLED
TRADING_SESSION_INVALID
RISK_ACCOUNT_NOT_FOUND
RISK_SYMBOL_NOT_FOUND
MES_NOT_AVAILABLE_TRADING_DISABLED
OES_NOT_AVAILABLE_TRADING_DISABLED 10
MDS_NOT_AVAILABLE_TRADING_DISABLED
MSG_TYPE_INVALID
ORD_TYPE_INVALID
PRICE_INVALID
SIZE_INVALID
STOP_PRICE_INVALID
STOP_SIZE_INVALID
ORDER_SIDE_INVALID
ACCOUNT_INVALID
ORDERID_INVALID 20
SENDING_TIME_INVALID
ORIG_PRICE_INVALID
ORIG_SIZE_INVALID
ICE_SIZEINCREMENT_TIMES_LAYERS_NOT_EQUAL_ORDQTY
ORIG_ORDER_ID_INVALID
SYMBOL_ENUM_INVALID
SIZE_INCREMENT_INVALID
PRICE_OFFSET_INVALID
PRICE_INCREMENT_INVALID
EXCEEDED_MAX_LAYERS 30
DISPLAY_SIZE_INVALID
REFRESH_SIZE_INVALID
INVALID_SECURITY_KEY
USER_ALREADY_LOGGED_IN
INVALID_FIELD_VALUE
PERCENTAGE_MOVE_EXCEEDED_COOLING_OFF_PERIOD_IN_FORCE
INSTRUMENT_WOULD_CAUSE_MARGIN_TO_BE_EXCEEDED
INSTRUMENT_MARGIN_EXCEEDED
MARGIN_BUY_ORDER_CANCELLATION_IN_PROGRESS
MARGIN_SELL_ORDER_CANCELLATION_IN_PROGRESS
MARGIN_LONG_POSITION_LIQUIDATION_IN_PROGRESS
MARGIN_SHORT_POSITION_LIQUIDATION_IN_PROGRESS
OUTSTANDING_OPEN_REQUESTS_EXCEEDED
NO_RISK_DATA
DUPLICATE_ORDER_ID
EXCEEDS_OPEN_ORDER_REQUESTS
NOT_ENOUGH_EQUITY_TO_COMPLETE
MATCHING_ENGINE_REJECTED
NONE
ACCEPTED
KEY_INVALID
MSG_SEQ_NUM_INVALID
USER_ALREADY_LGGGED_IN
ORIG_ORDER_NOT_FOUND
INVALID_LOGON_TYPE
CANT_EXECUTE_AGAINST_EXCHANGE_ORDER
NO_MARKET_MAKER_VOLUME

BO_CONNECTION_PROTOCOL

Field Value(short)
API_BINARY_TRANSACTION 1
API_BINARY_TRADITIONAL
API_WS_TRANSACTION
API_WS_TRADITIONAL
WEB

STOP_TRIGGER

Field Value(short)
LAST_PRICE
INDEX
MARK

LOGON_TYPE

Field Value(short)
LOGIN 1
LOGOUT

REQUEST_TYPE

Field Value(short)
ALL 1
SE

ACCOUNT_TYPE

Field Value(char)
BO_USER B
NORMAL_USER N
MM_USER M
EXCHANGE_USER E

COLLATERAL_ENUM

Field Value(short)
BTC 1
USDT
FLY
USD

BO_MSG_SIZE

Field Value(short)
S_HEARTBEAT_TESTREQUEST 6
S_OPEN_ORDER_REQUEST 24
S_INSTRUMENT_REQUEST 62
S_INSTRUMENT 74
S_RISK_USER_SYMBOL 161
S_CLIENT_LOGON 143
S_TRANSACTION 238
S_TRANSACTBUF 330

FieldList

Field Type
AccountEquity double
Attributes char[]
BTCEquity double
BOCancelShares double
BOOrderQty double
BOOrigPrice double
BOPrice double
BOSide short
BOSymbol char[]
DisplaySize double
ETHEquity double
ExecID long
ExecPrice double
ExecShares double
ExecutedLongCash double
ExecutedLongPosition double
ExecutedShortCash double
ExecutedShortPosition double
ExpirationDate char[]
FLYEquity double
InstrumentEquity double
Key int
LastSeqNum int
Layers short
Leverage double
LimitCross double
LoginStatus short
LogonType short
LongCash double
LongPosition double
MaxSize double
MessageType short
MinSize double
MsgSeqID long
OpenOrderRequestLimit int
OrderID long
OrderType short
OrigOrderID long
PriceIncrement double
PriceOffset double
PrimaryMarketDataIP char[]
RefreshSize double
RejectReason short
RemainingQuantity double
RequestType short
ResponseType short
RiskMaster char
SecondaryOrderEntryIP char[]
SendTime uint64_t
SendingTime uint64_t
SeqNum int
ShortCash double
ShortPosition double
SizeIncrement double
StopLimitPrice double
SymbolDisabled char
SymbolEnum short
SymbolName char[]
SymbolType char
TIF short
TakeProfitPrice double
TraderID char[]
TradingSessionID int
TriggerType short
TwoFA char[]
USDEquity double
USDTEquity double
UpdateType short
UserName char[]

Order Types

BO offers the most complete set of order types in the crypto market including TRUE ICE orders. ICE orders allow the user to place up to 10 orders at a specified price offset per layer and a specified size at that price layer which move as the market moves. BO also offers Hidden orders, peg orders, hidden peg orders and display and refresh attributes for most order types. The complete list of order types is as follows:

Current Order Types:

  1. LMT = 1,
  2. MKT = 2,
  3. STOP_MKT = 3,
  4. STOP_LMT = 4,
  5. PEG = 5,
  6. HIDDEN = 6,
  7. PEG_HIDDEN = 7,
  8. OCO = 8,
  9. ICE = 9,
  10. SNIPER_MKT = 12,
  11. SNIPER_LIMIT = 13,
  12. TSM = 14, // TRAILING_STOP_MKT
  13. TSL = 15 // TRAILING_STOP_LMT

Message Types

  1. ORDER_NEW = 1,
  2. CANCEL_REPLACE = 2,
  3. MARGIN_CANCEL_REPLACE = 3,
  4. MARGIN_EXECUTE = 4,
  5. ORDER_STATUS = 5,
  6. ORDER_CANCEL = 6,
  7. MARGIN_CANCEL = 7,
  8. EXECUTION = 8,
  9. EXECUTION_PARTIAL = 9,
  10. MARGIN_EXECUTION = 10,
  11. MARGIN_PARTIAL_EXECUTION = 11,
  12. REJECT = 12,
  13. ORDER_REJECT = 13,
  14. ORDER_ACK = 14,
  15. CANCELLED = 15,
  16. REPLACED = 16,
  17. QUOTE_FILL = 17,
  18. QUOTE_FILL_PARTIAL = 18,
  19. MARGIN_REPLACED = 19,
  20. CANCEL_REPLACE_REJECT = ,
  21. INSTRUMENT = 21,
  22. INSTRUMENT_REQUEST = 22,
  23. RISK_REJECT = 23,
  24. TOB_MSG = 24,
  25. THREE_LAYER_MD_MSG = 25,
  26. FIVE_LAYER_MD_MSG = 26,
  27. TEN_LAYER_MD_MSG = 27,
  28. TWENTY_LAYER_MD_MSG = 28,
  29. THIRTY_LAYER_MD_MSG = 29,
  30. EXEC_REPORT = 30,
  31. COLLATERAL_DATA = 31,
  32. COLLATERAL_UPDATE_REQ = 32,
  33. RISK_USER_SYMBOL = 33,
  34. RISK_UPDATE_REQUEST = 34,
  35. OPEN_ORDER_REQUEST = 35,
  36. CLIENT_LOGON = 36,
  37. MD_SNAPSHOT = 37,
  38. MD_SUBSCRIBE = 38,

REST

REST Overview

All REST user messages are POST type requests. Server responses are in JSON responses. Please review the following sections for the required order entry message fields.

Current Order Types:

  1. LMT = 1,
  2. MKT = 2,
  3. STOP_MKT = 3,
  4. STOP_LMT = 4,
  5. PEG = 5,
  6. HIDDEN = 6,
  7. PEG_HIDDEN = 7,
  8. OCO = 8,
  9. ICE = 9,
  10. SNIPER_MKT = 12,
  11. SNIPER_LIMIT 13,
  12. TSM = 14, // TRAILING_STOP_MKT
  13. TSL = 15 // TRAILING_STOP_LMT

Message Types

  1. ORDER_NEW = 1,
  2. CANCEL_REPLACE = 2,
  3. MARGIN_CANCEL_REPLACE = 3,
  4. MARGIN_EXECUTE = 4,
  5. ORDER_STATUS = 5,
  6. ORDER_CANCEL = 6,
  7. MARGIN_CANCEL = 7,
  8. EXECUTION = 8,
  9. EXECUTION_PARTIAL = 9,
  10. MARGIN_EXECUTION = 10,
  11. MARGIN_PARTIAL_EXECUTION = 11,
  12. REJECT = 12,
  13. ORDER_REJECT = 13,
  14. ORDER_ACK = 14,
  15. CANCELLED = 15,
  16. REPLACED = 16,
  17. QUOTE_FILL = 17,
  18. QUOTE_FILL_PARTIAL = 18,
  19. MARGIN_REPLACED = 19,
  20. CANCEL_REPLACE_REJECT = ,
  21. INSTRUMENT = 21,
  22. INSTRUMENT_REQUEST = 22,
  23. RISK_REJECT = 23,
  24. TOB_MSG = 24,
  25. THREE_LAYER_MD_MSG = 25,
  26. FIVE_LAYER_MD_MSG = 26,
  27. TEN_LAYER_MD_MSG = 27,
  28. TWENTY_LAYER_MD_MSG = 28,
  29. THIRTY_LAYER_MD_MSG = 29,
  30. EXEC_REPORT = 30,
  31. COLLATERAL_DATA = 31,
  32. COLLATERAL_UPDATE_REQ = 32,
  33. RISK_USER_SYMBOL = 33,
  34. RISK_UPDATE_REQUEST = 34,
  35. OPEN_ORDER_REQUEST = 35,
  36. CLIENT_LOGON = 36,
  37. MD_SNAPSHOT = 37,
  38. MD_SUBSCRIBE = 38,

Required Fields by Message Type and Order Type

The numerals in the Field Name row indicate the order type listed above. To find out if a particular field is required find the field name in the left hand column and then find the numerical value corresponding to the order type listed in the preceeding section. Example: To determine if the StopLimit price must be included in an OCO order, find the numerical value of the OCO order type in the section above (8) and then find StopLimitPrice in the left hand column and then go to the right to the header value of 8. In this case, yes, StopLimitPrice is required when sending the message ORDER_NEW with the ORDER_TYPE = OCO (8).

Message Type: ORDER_NEW

Field Name 1 2 3 4 5 6 7 8 9 12 13 14 15
Msg1 x x x x x x x x x x x x x
Msg2
MsgLen x x x x x x x x x x x x x
MessageType x x x x x x x x x x x x x
Padding
Account x x x x x x x x x x x x x
OrderID x x x x x x x x x x x x x
SymbolEnum x x x x x x x x x x x x x
OrderType x x x x x x x x x x x x x
SymbolType x x x x x x x x x x x x x
BOPrice x x x x x x x x x x x x x
BOSide x x x x x x x x x x x x x
BOOrderQty x x x x x x x x x x x x x
TIF x x x x x x x x
StopLimitPrice x x x x x
BOSymbol x x x x x x x x x x x x x
OrigOrderID
BOCancelShares
ExecID
ExecShares
RemainingQuantity
ExecFee
ExpirationDate
TraderID
RejectReason
SendingTime x x x x x x x x x x x x x
TradingSessionID x x x x x x x x x x x x x
Key x x x x x x x x x x x x x
DisplaySize 1 1 1 1 1
RefreshSize 1 1 1 1 1
Layers x
SizeIncrement x
PriceIncrement x
PriceOffset x
BOOrigPrice
ExecPrice
MsgSeqNum x x x x x x x x x x x x x
TakeProfitPrice
TriggerType
Attributes 1 1 1 1 1

Note 1: Attributes currently are used to indicate Hidden or Display Refresh is to be used. Currently only HIDDEN_TYPE and DISPLY_TYPE are in use.

ATTRIBUTE_TYPES:

  1. RESERVED_TYPE,
  2. HIDDEN_TYPE = 1,
  3. DISPLY_TYPE = 2,
  4. SIZEINCREMENT_TYPE = 3,
  5. POST_TYPE = 4,
  6. PRICEINCREMENT_TYPE = 5,
  7. OFFSET_TYPE = 6,
  8. STOP_MKT_TYPE = 7,
  9. STOP_LMT_TYPE = 8,
  10. PEG_TYPE = 9,
  11. TSL_TYPE = 10,
  12. TSM_TYPE = 11,

Message Type: CANCEL_REPLACE

Field Name 1 2 3 4 5 6 7 8 9 12 13 14 15
Msg1 x x x x x x x x x x x x x
Msg2
MsgLen x x x x x x x x x x x x x
MessageType x x x x x x x x x x x x x
Padding
Account x x x x x x x x x x x x x
OrderID x x x x x x x x x x x x x
SymbolEnum x x x x x x x x x x x x x
OrderType x x x x x x x x x x x x x
SymbolType x x x x x x x x x x x x x
BOPrice x x x x x x x x x x x x x
BOSide x x x x x x x x x x x x x
BOOrderQty x x x x x x x x x x x x x
TIF x x x x x x x x x x x x x
StopLimitPrice x x x x x
BOSymbol x x x x x x x x x x x x x
OrigOrderID
BOCancelShares
ExecID
ExecShares
RemainingQuantity
ExecFee
ExpirationDate
TraderID
RejectReason
SendingTime x x x x x x x x x x x x x
TradingSessionID x x x x x x x x x x x x x
Key x x x x x x x x x x x x x
DisplaySize 1 1 1 1 1
RefreshSize 1 1 1 1 1
Layers
SizeIncrement
PriceIncrement
PriceOffset
BOOrigPrice
ExecPrice
MsgSeqNum x x x x x x x x x x x x x
TakeProfitPrice
TriggerType
Attributes 1 1 1 1 1

Note 1: Attributes currently are used to indicate Hidden or Display Refresh is to be used. Currently only HIDDEN_TYPE and DISPLY_TYPE are in use.

ATTRIBUTE_TYPES:

  1. RESERVED_TYPE,
  2. HIDDEN_TYPE = 1,
  3. DISPLY_TYPE = 2,
  4. SIZEINCREMENT_TYPE = 3,
  5. POST_TYPE = 4,
  6. PRICEINCREMENT_TYPE = 5,
  7. OFFSET_TYPE = 6,
  8. STOP_MKT_TYPE = 7,
  9. STOP_LMT_TYPE = 8,
  10. PEG_TYPE = 9,
  11. TSL_TYPE = 10,
  12. TSM_TYPE = 11,

Message Type: ORDER_CANCEL

Field Name 1 2 3 4 5 6 7 8 9 12 13 14 15
Msg1 x x x x x x x x x x x x x
Msg2
MsgLen x x x x x x x x x x x x x
MessageType x x x x x x x x x x x x x
Padding
Account x x x x x x x x x x x x x
OrderID x x x x x x x x x x x x x
SymbolEnum x x x x x x x x x x x x x
OrderType x x x x x x x x x x x x x
SymbolType x x x x x x x x x x x x x
BOPrice x x x x x x x x x x x x x
BOSide x x x x x x x x x x x x x
BOOrderQty x x x x x x x x x x x x x
TIF x x x x x x x x x x x x x
StopLimitPrice x x x x x
BOSymbol x x x x x x x x x x x x x
OrigOrderID x x x x x x x x x x x x x
BOCancelShares
ExecID
ExecShares
RemainingQuantity
ExecFee
ExpirationDate
TraderID x x x x x x x x x x x x x
RejectReason
SendingTime x x x x x x x x x x x x x
TradingSessionID x x x x x x x x x x x x x
Key x x x x x x x x x x x x x
DisplaySize
RefreshSize
Layers
SizeIncrement
PriceIncrement
PriceOffset
BOOrigPrice x x x x x x x x x x x x x
ExecPrice
MsgSeqNum x x x x x x x x x x x x x
TakeProfitPrice
TriggerType
Attributes

Note 1: Attributes currently are used to indicate Hidden or Display Refresh is to be used. Currently only HIDDEN_TYPE and DISPLY_TYPE are in use.

ATTRIBUTE_TYPES:

  1. RESERVED_TYPE,
  2. HIDDEN_TYPE = 1,
  3. DISPLY_TYPE = 2,
  4. SIZEINCREMENT_TYPE = 3,
  5. POST_TYPE = 4,
  6. PRICEINCREMENT_TYPE = 5,
  7. OFFSET_TYPE = 6,
  8. STOP_MKT_TYPE = 7,
  9. STOP_LMT_TYPE = 8,
  10. PEG_TYPE = 9,
  11. TSL_TYPE = 10,
  12. TSM_TYPE = 11,

REST BOClientLogon

BOClientLogon -- Client Sending

POST http://bo.market.com msg1=H&LogonType=1&Account=100700&UserName=BOU7&SendingTime=1681931839281&MsgSeqID=500&Key=123456

AES response

{
  "msg1": "H",
  "LogonType": 1,
  "Account": 100700,
  "UserName": "BOU7",
  "TradingSessionID": 506,
  "PrimaryOESIP": "192.181.35.6:32060",
  "SecondaryOESIP": "192.182.35.6:32060",
  "PrimaryMDIP": "192.181.35.5:32060",
  "SecondaryMDIP": "192.181.35.5:32060",
  "SendingTime": 1624785162815971526,
  "MsgSeqID": 110434,
  "Key": 123456,
  "LoginStatus": 1,
  "RejectReason": 50,
  "RiskMaster": "N"
}

OES response

{
  "msg1": "H",
  "LogonType": 1,
  "Account": 100700,
  "UserName": "BOU7",
  "TradingSessionID": 506,
  "SendingTime": 1624785162815971526,
  "MsgSeqID": 110434,
  "Key": 123456,
  "LoginStatus": 1,
  "RejectReason": 50,
  "RiskMaster": "N"
}
  1. The BOClientLogon message must be sent to the AES in order to initiate the logon process (please contact BO Representative for IP address and port).
  2. Please refer to the BOClientLogon with logon status and if logon was successful the IP Address and Port of the OES (Order Entry Server).
  3. The AES will respond with a BOClientLogon with logon status and if logon was successful the IP Address and Port of the OES (Order Entry Server).
  4. If the logon to the AES was successful the user may log into the OES or MDS using the IP address and port provided in the AES response
  5. Only one login session is permited for a unique account ID and UserName.
  6. BOClientLogon Example Message - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X H H Header
LogonType short 2 X 1 Note1
Account Int 4 X 253336 Note2
2FA char[] 6 X 1F6A Note4
UserName char[] 6 X BOU1 Note2
TradingSessionID Int 4 * Note2
PrimaryOESIP char[] 24 * Note3
SecondaryOESIP char[] 24 * Note3
PrimaryMDIP char[] 24 Note Used
SecondaryIP char[] 24 Not Used
SendingTime Long 8 Note 5
MsgSeqNum Int 4 1500201
Key Int 4 432451
LoginStatus short 1
RejectReason short 2
RiskMaster char 1

Notes:

  1. LogonType is a short enum, values: Login 1, Logout 2
    • If the value is not one of the values above, a logout message will be sent and the connection closed.
  2. Value assigned by BO. If this is a logout, the TradingSessionID must be supplied.
  3. IP address and port of the OES will be sent in the server response BOClientLogon message.
  4. Sending times are in nanoseconds from the epoch, January 1, 1970.

REST Collateral Data

Collateral data message will show the total value of BTC available.

POST HTTP: msg1=f&UpdateType=1&Account=100700&SymbolEnum=4&TradingSessionID=506&SendingTime=1681931839281&MsgSeqID=500&Key=123456

OES response

{
  "msg1": "h",
  "MessageType": 31,
  "UserName": "BOU7",
  "Account": 100700,
  "SymbolEnum": 11021,
  "BTCEquity": 100.0,
  "USDTEquity": 10000000.0,
  "FLYEquity": 50000000.0,
  "USDEquity": 10000000.0,
  "ETHEquity": 2000.0,
  "TradingSessionID": 506,
  "LastSeqNum": 20101010,
  "SendingTime": 1624821404365664367
}
Field Name Data Type Data Length Required Field Required Value Example Value Notes
MsgType char 1 X f f Header
MsgType char 1
Length short 2 X
MessageType short 2 X
UpdateType short 2 X
Account int 4 X
TradingSessionID int 4 X
SymbolEnum short 2 X
Key int 4 X
MsgSeqNum int 4 X
SendingTime uint64_t 8 X
Total Length 34
HTTP Request

POST http://bo.market.com msg1=w&MessageType=w&Account=100700&UserName=BOU7&SendingTime=1681931839281&MsgSeqID=500&Key=123456

REST Risk Symbol Update

The BORiskUpdateRequest is very similar to the CollateralData request except it is isolated to the values of equity being used in a particular instrument. Example, the user might be trading BTCUSD and BTCUSDT. While the Collateral data message will show the total value of BTC available, the RiskUserSymbol message will show the value of BTC being used for an individual instrument. In this example if 5 BTC were being used in BTCUSD and 2 BTC were being used in BTCUSDT the collateral data message would show a total of 7 BTC currently in use. But if the user requested an update for a particular symbol such as BTCUSD, the value of equity shown to being used would be 5. This message also shows values related to a particular instrument such as executed positions, etc.

The above command returns JSON structured like this:

{
  "MessageType": "N",
  "Account": 100700,
  "SymbolEnum": 1,
  "Leverage": 25.0,
  "LongPosition": 0.0,
  "ShortPostion": 0.0,
  "LongCash": 0.0,
  "ShortCash": 0.0,
  "TradingDisabled": 0,
  "ExecLongCash": 0.0,
  "ExecLongPositon": 0.0,
  "ExecShortCash": 0.0,
  "ExecShortPosition": 0.0,
  "BTCEquity": 100.0,
  "USDTEquity": 10000000.0,
  "ETHEquity": 0.0,
  "USDEquity": 10000000.0,
  "FLYEquity": 0.0,
  "TradingSessionID": 506,
  "LastSeqNum": 200,
  "UpdateType": 2
}
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X w w Header
Msg2 char 1 Header
MsgLen short 2 X 34 34 Header
MessageType short 2 * w w Note 6
ResponseType short 2 X 2 Note 1
Account Int 4 X 100700 Note 2
TradingSessionID Int 4 X 506 Note 3
SymbolEnum short 2 1 Note 2
Key Int 2 Note 4
MsgSeqNum Int 4 X 1005231
SendingTime Uint64_t 4 X Note 6
TotalLength
HTTP Request

POST http://bo.market.com msg1=Y&MessageType=22&Account=100700&SymbolName=BTCUSDT&SymbolEnum=4&UserName=BOU7&TradingSessionID=506&SendingTime=1681931839281&MsgSeqID=500&Key=123456

REST Instrument Data

The above command returns JSON structured like this:

{
  "msg1": "Q",
  "MessageType": "21",
  "SymbolName": "USDUSDT",
  "SymbolEnum": 4,
  "SymbolType": 1,
  "PriceIncrement": 0.5,
  "MaxSize": 5000.0,
  "MinSize": 0.00001,
  "SendingTime": 1624863069122199720,
  "LastSeqNum": 505
}
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X Y Y Header
Msg2 char 1 Header
MsgLen short 2 X 62 62 Header
MessageType short 2 Not used
RejectReason Int 4 * Y Y Note 7
Account Int 4 X 100700 Note 1
RequestType short 2 X 2 Note 2
Key Int 4 X Note 2
SymbolName char[] 24 Note 3
SymbolType short 2 Note 4
SymbolEnum short 2 Note 5
TradingSessionID Int 4 506
SendingTime Long 8 X Note 6
MsgSeqNum Int 4 X 1500201
TotalLength

Note 1: TradingSessionID, UserName and Account number supplied by BO to the user. Note 2: RequestType is an enum with the following values:

Enum Name Enum Value(short int)
ALL 1 Request all instruments
SYMBOL_ENUM 2 Individual instruments

Note 3: Character string name representation an individual instrument if known, if not known the name will be provided in the BOInstrument response Note 4: SymbolType is a short integer enum with the following possible values:

Enum Name: Symbol Type Enum Value Enum Data Type: short
SPOT 1
FUTURES 2
DERIVATIVE

Note 5: Symbol Enum is a short integer with the following possible values:

Enum Name: Symbol Enum Enum Value
BTCUSD 1
USDUSDT 2
FLYUSDT 3
BTCUSDT 4

Note 6: Sending times are in nanoseconds from the epoch, January 1, 1970 Note 7: If the request was rejected, the reject reason will be in the field RejectReason, see section below for possible values

HTTP Request

POST http://bo.market.com msg1=T&MessageType=1&UpdateType=0&Account=100700&TraderID=BOU7&OrderType&OrderID=14333181&Price=35040.5&BOOrderQty=2&BOSide=1&SendingTime=1681931839281&MsgSeqID=500&SymbolEnum=4&Symbol=BTCUSDT&TradingSessionID=506&TIF=1

REST Order Entry

The above command returns JSON structured like this:

{
  "msg1": "T",
  "MessageType": 14,
  "UpdateType": 2,
  "Account": 100700,
  "OrderId": 14333181,
  "SymbolEnum": 4,
  "OrderType": 1,
  "BOPrice": 35040.5,
  "Side": 1,
  "BOOrderQty": 2.0,
  "TIF": 1,
  "DisplaySize": 0.0,
  "RefreshSize": 0.0,
  "BOSymbol": "BTCUSDT",
  "TraderID": "BOU7",
  "SendingTime": 1624781419248402,
  "TradingSessionID": 506,
  "Key": 123456,
  "MsgSeqID": 500
}

JSON

JSON Overview

All JSON messages sent by the client are preceeded by a HEADER message which has the length of the JSON message which follows it. Example,

{
  "Len": 179
}
{
  "msg1": "H",
  "LogonType": 1,
  "Account": 100700,
  "UserName": "BOU7",
  "TradingSessionID": 506,
  "SendingTime": 18343447,
  "MsgSeqID": 110434,
  "Key": 123456,
  "RiskMaster": "N"
}

The allows the server to determine the length of the message which follows the header allowing for more efficient parsing. The Server responses do not include the header.

JSON messages are identical in TCP/IP and in Websockets. The sending of the messages is the same and the receiving of messages is the same therefore the descriptions of the following messages will work the same for TCP/IP and for Websockets.

JSON Order Entry messages will vary according to the message type and the order type. Use the tables below to determine the required fields based on message type and order type to build the correct JSON Order Entry string.

Current Order Types:

  1. LMT = 1,
  2. MKT = 2,
  3. STOP_MKT = 3,
  4. STOP_LMT = 4,
  5. PEG = 5,
  6. HIDDEN = 6,
  7. PEG_HIDDEN = 7,
  8. OCO = 8,
  9. ICE = 9,
  10. SNIPER_MKT = 12,
  11. SNIPER_LIMIT 13,
  12. TSM = 14, // TRAILING_STOP_MKT
  13. TSL = 15 // TRAILING_STOP_LMT

Message Types

  1. ORDER_NEW = 1,
  2. CANCEL_REPLACE = 2,
  3. MARGIN_CANCEL_REPLACE = 3,
  4. MARGIN_EXECUTE = 4,
  5. ORDER_STATUS = 5,
  6. ORDER_CANCEL = 6,
  7. MARGIN_CANCEL = 7,
  8. EXECUTION = 8,
  9. EXECUTION_PARTIAL = 9,
  10. MARGIN_EXECUTION = 10,
  11. MARGIN_PARTIAL_EXECUTION = 11,
  12. REJECT = 12,
  13. ORDER_REJECT = 13,
  14. ORDER_ACK = 14,
  15. CANCELLED = 15,
  16. REPLACED = 16,
  17. QUOTE_FILL = 17,
  18. QUOTE_FILL_PARTIAL = 18,
  19. MARGIN_REPLACED = 19,
  20. CANCEL_REPLACE_REJECT = ,
  21. INSTRUMENT = 21,
  22. INSTRUMENT_REQUEST = 22,
  23. RISK_REJECT = 23,
  24. TOB_MSG = 24,
  25. THREE_LAYER_MD_MSG = 25,
  26. FIVE_LAYER_MD_MSG = 26,
  27. TEN_LAYER_MD_MSG = 27,
  28. TWENTY_LAYER_MD_MSG = 28,
  29. THIRTY_LAYER_MD_MSG = 29,
  30. EXEC_REPORT = 30,
  31. COLLATERAL_DATA = 31,
  32. COLLATERAL_UPDATE_REQ = 32,
  33. RISK_USER_SYMBOL = 33,
  34. RISK_UPDATE_REQUEST = 34,
  35. OPEN_ORDER_REQUEST = 35,
  36. CLIENT_LOGON = 36,
  37. MD_SNAPSHOT = 37,
  38. MD_SUBSCRIBE = 38,

JSON BOClientLogon

BOClientLogon -- Client Sending

{
  "msg1": "H",
  "LogonType": 1,
  "Account": 100700,
  "UserName": "BOU7",
  "TradingSessionID": 506,
  "SendingTime": 1624785162815971526,
  "MsgSeqID": 110434,
  "Key": 123456,
  "LoginStatus": 1,
  "RejectReason": 50,
  "RiskMaster": "N"
}

AES response

{
  "msg1": "H",
  "LogonType": 1,
  "Account": 100700,
  "UserName": "BOU7",
  "TradingSessionID": 506,
  "SendingTime": 1624785162815971526,
  "MsgSeqID": 110434,
  "Key": 123456,
  "LoginStatus": 1,
  "RejectReason": 50,
  "RiskMaster": "N"
}

OES response

{
  "msg1": "H",
  "LogonType": 1,
  "Account": 100700,
  "UserName": "BOU7",
  "TradingSessionID": 506,
  "SendingTime": 1624785162815971526,
  "MsgSeqID": 110434,
  "Key": 123456,
  "LoginStatus": 1,
  "RejectReason": 50,
  "RiskMaster": "N"
}
  1. The BOClientLogon message must be sent to the AES in order to initiate the logon process (please contact BO Representative for IP address and port).
  2. Please refer to the BOClientLogon with logon status and if logon was successful the IP Address and Port of the OES (Order Entry Server).
  3. The AES will respond with a BOClientLogon with logon status and if logon was successful the IP Address and Port of the OES (Order Entry Server).
  4. Only one login session is permited for a unique account ID and UserName.
  5. BO requests that if they user is going to close the connection a BOClientLogon message should be sent with the LogonType set to 2 prior to closing the connection in order to allow the OES to close the connection gracefully.
  6. BOClientLogon Example Message - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X H H Header
LogonType short 2 X 1 Note1
Account Int 4 X 253336 Note2
2FA char[] 6 X 1F6A Note4
UserName char[] 6 X BOU1 Note2
TradingSessionID Int 4 * Note2
PrimaryOESIP char[] 24 * Note3
SecondaryOESIP char[] 24 * Note3
PrimaryMDIP char[] 24 Note Used
SecondaryIP char[] 24 Not Used
SendingTime Long 8 Note 5
MsgSeqNum Int 4 1500201
Key Int 4 432451
LoginStatus short 1
RejectReason short 2
RiskMaster char 1

Notes:

  1. LogonType is a short enum, values: Login 1, Logout 2
    • If the value is not one of the values above, a logout message will be sent and the connection closed.
  2. Value assigned by BO. If this is a logout, the TradingSessionID must be supplied.
  3. IP address and port of the OES will be sent in the server response BOClientLogon message.
  4. Sending times are in nanoseconds from the epoch, January 1, 1970.

JSON Collateral Data

{
  "Len": 144
}
{
  "msg1": "f",
  "UpdateType": 2,
  "Account": 100700,
  "TradingSessionID": 506,
  "SymbolEnum": 4,
  "Key": 123456,
  "MsgSeqID": 500,
  "SendingTime": 1624821404362542113
}

AES response

{
  "msg1": "h",
  "MessageType": 31,
  "UserName": "BOU7",
  "Account": 100700,
  "SymbolEnum": 11021,
  "BTCEquity": 100.0,
  "USDTEquity": 10000000.0,
  "FLYEquity": 50000000.0,
  "USDEquity": 10000000.0,
  "ETHEquity": 2000.0,
  "TradingSessionID": 506,
  "LastSeqNum": 20101010,
  "SendingTime": 1624821404365664367
}

OES response

{
  "msg1": "h",
  "MessageType": 31,
  "UserName": "BOU7",
  "Account": 100700,
  "SymbolEnum": 11021,
  "BTCEquity": 100.0,
  "USDTEquity": 10000000.0,
  "FLYEquity": 50000000.0,
  "USDEquity": 10000000.0,
  "ETHEquity": 2000.0,
  "TradingSessionID": 506,
  "LastSeqNum": 20101010,
  "SendingTime": 1624821404365664367
}
Field Name Data Type Data Length Required Field Required Value Example Value Notes
MsgType char 1 X f f Header
MsgType char 1
Length short 2 X
MessageType short 2 X
UpdateType short 2 X
Account int 4 X
TradingSessionID int 4 X
SymbolEnum short 2 X
Key int 4 X
MsgSeqNum int 4 X
SendingTime uint64_t 8 X
Total Length 34

JSON Risk Symbol Update

{
  "Len": 147
}
{
  "msg1": "w",
  "MessageType": "w",
  "Account": 100700,
  "SymbolEnum": 4,
  "TradingSessionID": 506,
  "Key": 123456,
  "MsgSeqID": 500,
  "SendingTime": 1624821406361022055
}

The above command returns JSON structured like this:

{
  "MessageType": "N",
  "Account": 100700,
  "SymbolEnum": 1,
  "Leverage": 25.0,
  "LongPosition": 0.0,
  "ShortPostion": 0.0,
  "LongCash": 0.0,
  "ShortCash": 0.0,
  "TradingDisabled": 0,
  "ExecLongCash": 0.0,
  "ExecLongPositon": 0.0,
  "ExecShortCash": 0.0,
  "ExecShortPosition": 0.0,
  "BTCEquity": 100.0,
  "USDTEquity": 10000000.0,
  "ETHEquity": 0.0,
  "USDEquity": 10000000.0,
  "FLYEquity": 0.0,
  "TradingSessionID": 506,
  "LastSeqNum": 200,
  "UpdateType": 2
}
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X w w Header
Msg2 char 1 Header
MsgLen short 2 X 34 34 Header
MessageType short 2 * w w Note 6
ResponseType short 2 X 2 Note 1
Account Int 4 X 100700 Note 2
TradingSessionID Int 4 X 506 Note 3
SymbolEnum short 2 1 Note 2
Key Int 2 Note 4
MsgSeqNum Int 4 X 1005231
SendingTime Uint64_t 4 X Note 6
TotalLength

JSON Instrument Data

{
  "Len": 186
}
{
  "msg1": "Y",
  "MessageType": 22,
  "Account": 100700,
  "SymbolName": "BTCUSD",
  "UserName": "BOU7",
  "SymbolEnum": 4,
  "TradingSessionID": 506,
  "Key": 123456,
  "MsgSeqID": 500,
  "SendingTime": 1624859180169634284
}

The above command returns JSON structured like this:

{
  "msg1": "Q",
  "MessageType": "21",
  "SymbolName": "USDUSDT",
  "SymbolEnum": 4,
  "SymbolType": 1,
  "PriceIncrement": 0.01,
  "MaxSize": 5000.0,
  "MinSize": 0.00001,
  "SendingTime": 1624863069122199720,
  "LastSeqNum": 505
}
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X Y Y Header
Msg2 char 1 Header
MsgLen short 2 X 62 62 Header
MessageType short 2 Not used
RejectReason Int 4 * Y Y Note 7
Account Int 4 X 100700 Note 1
RequestType short 2 X 2 Note 2
Key Int 4 X Note 2
SymbolName char[] 24 Note 3
SymbolType short 2 Note 4
SymbolEnum short 2 Note 5
TradingSessionID Int 4 506
SendingTime Long 8 X Note 6
MsgSeqNum Int 4 X 1500201
TotalLength

Note 1: TradingSessionID, UserName and Account number supplied by BO to the user. Note 2: RequestType is an enum with the following values:

Enum Name Enum Value(short int)
ALL 1 Request all instruments
SYMBOL_ENUM 2 Individual instruments

Note 3: Character string name representation an individual instrument if known, if not known the name will be provided in the BOInstrument response Note 4: SymbolType is a short integer enum with the following possible values:

Enum Name: Symbol Type Enum Value Enum Data Type: short
SPOT 1
FUTURES 2
DERIVATIVE

Note 5: Symbol Enum is a short integer with the following possible values:

Enum Name: Symbol Enum Enum Value
BTCUSD 1
USDUSDT 2
FLYUSDT 3
BTCUSDT 4

Note 6: Sending times are in nanoseconds from the epoch, January 1, 1970 Note 7: If the request was rejected, the reject reason will be in the field RejectReason, see section below for possible values

JSON Open Order

{
  "Len": 186
}
{
  "msg1": "e",
  "MessageType": 35,
  "Account": 100700,
  "SymbolName": "BTCUSD",
  "UserName": "BOU7",
  "SymbolEnum": 4,
  "TradingSessionID": 506,
  "Key": 123456,
  "MsgSeqID": 500,
  "SendingTime": 1624864277304478770
}

The above command returns JSON structured like this:

{
  "msg1": "T",
  "MessageType": 1,
  "UpdateType": 2,
  "Account": 100700,
  "OrderId": 2004,
  "SymbolEnum": 4,
  "OrderType": 1,
  "Bit24Price": 34998.0,
  "Side": 1,
  "Bit24OrderQty": 2.0,
  "TIF": 1,
  "DisplaySize": 0.0,
  "RefreshSize": 0.0,
  "Bit24Symbol": "BTCUSDT",
  "TraderID": "BOU7",
  "SendingTime": 1624866772603605,
  "TradingSessionID": 506,
  "Key": 123456,
  "MsgSeqID": 500
}

JSON Order Entry

{
  "Len": 298
}
{
  "msg1": "T",
  "MessageType": 1,
  "UpdateType": 2,
  "Account": 100700,
  "TraderID": "BOU7",
  "OrderType": 1,
  "OrderID": 14333181&Bit24,
  "Price," :35040.5,
  "Bit24OrderQty": 2,
  "Bit24Side": 1,
  "SendingTime": 1681931839281,
  "MsgSeqID": 500,
  "Key": 123456,
  "SymbolEnum": 4,
  "Symbol": "BTCUSDT",
  "TradingSessionID": 506,
  "TIF": 1
}

The above command returns JSON structured like this:

{
  "msg1": "T",
  "MessageType": 14,
  "UpdateType": 2,
  "Account": 100700,
  "OrderId": 14333181,
  "SymbolEnum": 4,
  "OrderType": 1,
  "Bit24Price": 35040.5,
  "Side": 1,
  "Bit24OrderQty": 2.0,
  "TIF": 1,
  "DisplaySize": 0.0,
  "RefreshSize": 0.0,
  "Bit24Symbol": "BTCUSDT",
  "TraderID": "BOU7",
  "SendingTime": 1624781419248402,
  "TradingSessionID": 506,
  "Key": 123456,
  "MsgSeqID": 500
}

Application Messages

LIMIT

New LIMIT order - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 3
OrderType short 2 X LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 2.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing

New LIMIT Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 42341
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel Replace LIMIT Order - Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCEL_REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 10
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing

Cancel Replace LIMIT Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REPLACED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1
OrderType short 2 X LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: ****If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel LIMIT Order - Client Sending

User wishes to cancel replace the order sent in the previous section

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCEL Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 10
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing

Cancel LIMIT Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::CANCELLED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

MARKET

New MARKET order - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X MKT Note 3
SymbolType short 2 X SPOT
BOPrice double 8
BOSide short 2 X BUY Note 4
BOOrderQty double 8 X 2.0
TIF short 2
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 5
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 5: Currently disabled for testing.

New MARKET Order - OES Response

The OES will respond to a MKT order only in the case it was rejected, MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REJECT Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X MKT
SymbolType short 2 X SPOT
BOPrice double 8
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

OCO

New OCO order - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X OCO Note 3
SymbolType short 2 X SPOT
BOPrice double 8 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 2.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a OCO order on the book, OrdType field should be set to OCO.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

New OCO Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X OCO
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 428888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel Replace OCO Order - Client Sending

User wishes to cancel replace the order sent in the previous section

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCEL_REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X OCO Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a OCO order on the book, OrdType field should be set to OCO.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID are the price and size of the order being replaced.

Cancel Replace OCO Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1
OrderType short 2 X OCO
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel OCO Order - Client Sending

User wishes to cancel replace the order sent in the previous section*.*

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCEL Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X OCO Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes are ignored on cancellations.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID are the price and order id of the order being cancelled.

Cancel OCO Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X OCO
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8 49200.00 Note 2
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2 * Note 3
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X
DisplaySize double 8 Note 4
RefreshSize double 8 Note 4
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 5

Notes:

Note 1: If the message was accepted MessageType = MessageType::CANCELLED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

PEG

New PEG / PEG_HIDDEN Order - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X PEG/PEG_HIDDEN Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 79448888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT. Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

New PEG / PEG_HIDDEN Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X PEG/PEG_HIDDEN
SymbolType short 2 X SPOT
BOPrice double 8 X 51100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Note 1:

If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel Replace PEG / PEG_HIDDEN Order - Client Sending

User wishes to cancel replace the order sent in the previous section

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCEL_REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X PEG/PEG_HIDDEN Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID are the price and order id of the order being replaced.

Cancel Replace PEG / PEG_HIDDEN Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REPLACED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X PEG/PEG_HIDDEN
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel PEG / PEG_HIDDEN Order – Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X PEG/PEG_HIDDEN Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID are the price and order id of the order being replaced.

Cancel PEG / PEG_HIDDEN Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = CANCELLED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCELED CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X PEG/PEG_HIDDEN Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8 Note 2
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2 * Note 3
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8 Note 4
RefreshSize double 8 Note 4
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 5

Notes:

Note 1: If the message was accepted MessageType = MessageType::CANCELLED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

HIDDEN

New HIDDEN Order - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X HIDDEN Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 2.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

New HIDDEN Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X HIDDEN
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel HIDDEN Order - Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X HIDDEN Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being cancelled.

Cancel Replace HIDDEN Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REPLACED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1
OrderType short 2 X HIDDEN
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel HIDDEN Order - Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X HIDDEN Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152 Note 9
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE and the DISPLAYSIZE_ATTRIBUTE are available but the other attributes will be available soon. Please see the section above on attribute behavior. In order to set an attribute a user should do something like this: // function accepts the position in the array to set the value and the actual value BOTransaction.setAtrributes(DISPLAYSIZE, ‘Y’);

If the DISPLAYSIZE attribute is set, the DisplaySize and RefreshSize in the message must also be set, if either is not set to a valid value the message will be rejected. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being cancelled.

Cancel HIDDEN Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = CANCELLED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X HIDDEN
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

ICEBERG

New ICEBERG Order - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X ICE Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 2.0 Note 13
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2 X Note 9
SizeIncrement double 8 X Note 10
PriceIncrement double 8 X Note 11
PriceOffset double 8 X Note 12
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Currently only GTC is available for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE is allowed for ICE orders.

Note 8: Currently disabled for testing.

Note 9: Maximum layers currently set to 10.

Note 10: SizeIncrement must be set. The SizeIncrement * Layers is the total order size.

Note 11: PriceIncrement is the price spacing between layers.

Example:

The second order will be placed at 50149.50

Note 12: PriceOffset is the offset from the top of the book, in increments of the price increment of the instrument. BTCUSD has a price increment of 0.50 so if the price offset is set to 2, then the second order will be place +/- $1.00 from the top of the book.

Note 13: BOOrdQty is the product of the SizeIncrement * Layers fields.

New ICEBERG Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X ICE
SymbolType short 2 X SPOT
BOPrice double 8 X 51000.5
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel Replace ICEBERG Order - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCEL_REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X ICE Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0 Note 14
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832151 Note 13
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2 X Note 9
SizeIncrement double 8 X Note 10
PriceIncrement double 8 X Note 11
PriceOffset double 8 X Note 12
BOOrigPrice double 8 50100.5 Note 13
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Currently only GTC is available for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE is allowed for ICE orders.

Note 8: Currently disabled for testing.

Note 9: Maximum layers currently set to 10.

Note 10: SizeIncrement must be set. The SizeIncrement * Layers is the total order size.

Note 11: PriceIncrement is the price spacing between layers.

Example:

The second order will be placed at 50149.50

Note 12: PriceOffset is the offset from the top of the book, in increments of the price increment of the instrument. BTCUSD has a price increment of 0.50 so if the price offset is set to 2, then the second order will be place +/- $1.00 from the top of the book.

Note 13: BOOrdQty is the product of the SizeIncrement * Layers fields.

Cancel Replace ICEBERG Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REPLACED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1
OrderType short 2 X ICE
SymbolType short 2 X SPOT
BOPrice double 8 X 51000.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel ICEBERG Order - Client Sending

User wishes to cancel replace the order sent in the previous section. Please see the section titled ICE Orders.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X ICE Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2 X
SizeIncrement double 8 X
PriceIncrement double 8 X
PriceOffset double 8 X
BOOrigPrice double 8 X Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above. Since in this example we would like to place a limit order on the book, OrdType field should be set to LMT.

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Currently only GTC is available for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Currently only the HIDDEN_ATTRIBUTE is allowed for ICE orders. If the user sets the HIDDEN_ATTRIBUTE to ‘Y’, this order will be hidden.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being cancelled.

Cancel ICEBERG Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = CANCELLED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X ICE
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::CANCELLED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

STOP MARKET/STOP LIMIT

New STOP_MKT/STOP_LMT - Client Sending
Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X STOP_MKT/ STOP_LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 2.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Currently only GTC is available for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

New STOP_MKT/STOP_LMT Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = CANCELLED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X STOP_MKT/ STOP_LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

If the message was accepted MessageType = MessageType::ORDER_ACK. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel Replace STOP_MKT/STOP_LMT Order - Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X STOP_MKT/ STOP_LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being replaced.

Cancel Replace STOP_MKT/STOP_LMT Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REPLACED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1
OrderType short 2 X STOP_MKT/ STOP_LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel STOP_MKT/STOP_LMT Order – Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCEL Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X STOP_MKT/ STOP_LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being replaced.

Cancel STOP_MKT/STOP_LMT Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X STOP_MKT/ STOP_LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 184467440 737095515 30
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

TRAILING STOP MARKET/TRAILING STOP LIMIT

New TSM/TSL Order - Client Sending

TSM order are trailing stop market orders. TSL orders are trailing stop limit orders.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X TSL/TSM Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51000.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 2.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Only GTC currently is a valid TIF value for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

New TSM/TSL Order - OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X TSL/TSM
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 2.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel Replace TSM/TSL Order – Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X TSL/TSM Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 10
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Only GTC currently is a valid TIF value for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being replaced.

Cancel Replace TSM/TSL Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REPLACED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1
OrderType short 2 X TSL/TSM
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel TSL/TSM Order – Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCEL Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X TSL/TSM Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832152 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 10
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values:

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being replaced.

Cancel TSL/TSM Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = CANCELLED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X TSL/TSM
SymbolType short 2 X SPOT
BOPrice double 8 X 50102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 184467440 737095515 30
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

SNIPER MARKET/SNIPER LIMIT

New SNIPER_MKT/SNIPER_LMT Order - Client Sending

Sniper orders allow a user to wait for a price to reach a certain price and then interact with the market at that previously set price.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_NEW Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X SNIPER_MKT/SNIPER_LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 2.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Only GTC is currently a valid TIF for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

New SNIPER_MKT/SNIPER_LMT Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = ORDER_ACK if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * ORDER_ACK Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832151
SymbolEnum short 2 X 1
OrderType short 2 X SNIPER_MKT/SNIPER_LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel Replace SNIPER_MKT/SNIPER_LMT Order – Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * CANCEL_REPLACE Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X SNIPER_MKT/SNIPER_LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51101.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Only GTC is currently a valid TIF for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being replaced.

Cancel Replace SNIPER_MKT/SNIPER_LMT Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = REPLACED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * REPLACED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832152
SymbolEnum short 2 X 1
OrderType short 2 X SNIPER_MKT/SNIPER_LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 50100.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

Cancel SNIPER_MKT/SNIPER_LMT Order – Client Sending

User wishes to cancel replace the order sent in the previous section.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * ORDER_CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1 Note 2
OrderType short 2 X SNIPER_MKT/SNIPER_LMT Note 3
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5 Note 4
BOSide short 2 X BUY Note 5
BOOrderQty double 8 X 3.0
TIF short 2 X GTC Note 6
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 46832151 Note 9
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X 1000
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 9
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Notes:

Note 1: Message types must be valid according to the values listed in the Message Type table above. Since in this example we would like to place a new order on the book, the MsgType field must be set to ORDER_NEW.

Note 2: Please see previous sections for valid values for the symbol enum.

Note 3: Order types must be a valid value as defined in the OrdType table above

Note 4: Price values must be be in a price increment according to the value the user received in the BOInstrument message - PriceIncrement field. Example, BTCUSD, symbol enum 1, has a price increment of 0.5. If the user sends a price of 51000.40, this price is invalid since the cents portion of the price is not in a 0.5 increment. The correct price should have been 51000.50 or 51000.00 or 51001.00, all of these are valid values.

Note 5: The valid side fields are:

Enum Name: SIDE Enum Value
BUY 1
SELL 2

Note 6: TIF valid values: Only GTC is currently a valid TIF for this order type.

Enum Name: TIF Enum Value
FOK 1
GTC 2
IOC 3
POO 4
RED 5
DAY 6

Note 7: Attributes allow an order to exhibit additional behavior. Not used on this order type.

Note 8: Currently disabled for testing.

Note 9: BOOrigPrice and OrigOrderID is the price and order id of the order being replaced.

Cancel SNIPER_MKT/SNIPER_LMT Order – OES Response

The OES will respond to the order submitted in the previous example with a BOTransaction message with a MessageType = CANCELLED if the message was accepted or MessageType = REJECT if the order was rejected.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * CANCELED Note 1
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X SNIPER_MKT/SNIPER_LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152
BOCancelShares double 8
ExecID long 8
ExecShares double 8
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4
DisplaySize double 8
RefreshSize double 8
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5
ExecPrice double 8
MsgSeqNum long 8 X 4248888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 *

Notes:

Note 1: If the message was accepted MessageType = MessageType::REPLACED. If the message was rejected the MessageType = MessageType::REJECT and the reject reason will be in the RejectReason field of the message.

EXECUTION/EXECUTION PARTIAL

These two message types are generated when an incoming Quote interacts with a resting order (order already on the book). Upon receiving an Execution message, the order in the Market Data Order Book should be removed. Upon receiving an Execution Partial, the volume of the resting order should be updated to reflect the remaining order quantity.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * * EXECUTION/EXECUTION_PARTIAL
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not Used Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 10
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

QUOTE_FILL /PARTIAL

These two message types are generated when an incoming Quote interacts with a resting order (order already on the book). Upon receiving an Execution message, the order in the Market Data Order Book should be removed. Upon receiving an Execution Partial, the volume of the resting order should be updated to reflect the remaining order quantity.

Field Name Data Type Data Length Required Field Required Value Example Value Notes
Msg1 char 1 X T T Header
Msg2 char 1 Header
MsgLen short 2 X 238 238 Header
MessageType short 2 * QUOTE_FILL/QUOTE_FILL_PARTIAL
Padding short 2 Not used
Account Int 4 X 100700
OrderID long 8 X 46832153
SymbolEnum short 2 X 1
OrderType short 2 X LMT
SymbolType short 2 X SPOT
BOPrice double 8 X 51102.5
BOSide short 2 X BUY
BOOrderQty double 8 X 3.0
TIF short 2 X GTC
StopLimitPrice double 8
BOSymbol char[] 12 X BTCUSD
OrigOrderID long 8 X 46832152
BOCancelShares double 8 *
ExecID long 8 *
ExecShares double 8 *
RemainingQuantity double 8
ExecFee double 8
ExpirationDate char[] 12
TraderID char[] 6 Not Used Not used
RejectReason short 2
SendingTime uint64_t 8 X
TradingSessionID Int 4 X 506
Key Int 4 X 42341 Note 8
DisplaySize double 8 *
RefreshSize double 8 *
Layers short 2
SizeIncrement double 8
PriceIncrement double 8
PriceOffset double 8
BOOrigPrice double 8 50100.5 Note 10
ExecPrice double 8
MsgSeqNum long 8 X 7948888
TakeProfitPrice double 8
TriggerType short 2
Attributes char[] 12 * Note 7

Protobuf

Protobuf Overview

Protobuf is a messaging protocol introduced and maintained by Google. The implementation details are hidden from the user and is popular because the .proto files can be used to generate code for a multitude of languages with the guarantee that both the sender and receiver can process the resulting message. The resulting messages are much smaller than other formats such as JSON for those interested in reducing bandwidth and reduced processing times due to the protocol being able to send and receive binary data in its native format.

Protobuf messages are identical in TCP/IP and in Websockets. The sending of the messages is the same and the receiving of messages is the same therefore the descriptions of the following messages will work the same for TCP/IP and for Websockets.

Protobuf Message Header

One of the drawbacks of protobuf messages is there is no way to determine how much data was received before processing the message. Nor is there a way to determine the type of message which was received after determining the data received was enough to create a full message. In order to alleviate these problems, we send an 8 byte header with each message. The first integer is the message type and the second integer is the message length. In order to find the values of these two fields use the following method:

// _size is the size of the data retrieved from the socket buffer if(_size > 8) { dataPtr = buffer.getData(); google::protobuf::uint32 psize; google::protobuf::uint32 stype; google::protobuf::io::ArrayInputStream ais(dataPtr, 1000); CodedInputStream coded_input(&ais); coded_input.ReadVarint32(&stype); //Decode the header and get the type coded_input.ReadVarint32(&psize); //Decode the header and get the size

As can be seen from the code, we don't even try to process the message if it is less than 8 bytes because we don't have a full header. Once we find the size and we know the type of message, we can then determine if the _size is large enough to continue processing the data.

Current Order Types:

  1. LMT = 1,
  2. MKT = 2,
  3. STOP_MKT = 3,
  4. STOP_LMT = 4,
  5. PEG = 5,
  6. HIDDEN = 6,
  7. PEG_HIDDEN = 7,
  8. OCO = 8,
  9. ICE = 9,
  10. SNIPER_MKT = 12,
  11. SNIPER_LIMIT 13,
  12. TSM = 14, // TRAILING_STOP_MKT
  13. TSL = 15 // TRAILING_STOP_LMT

Message Types

  1. ORDER_NEW = 1,
  2. CANCEL_REPLACE = 2,
  3. MARGIN_CANCEL_REPLACE = 3,
  4. MARGIN_EXECUTE = 4,
  5. ORDER_STATUS = 5,
  6. ORDER_CANCEL = 6,
  7. MARGIN_CANCEL = 7,
  8. EXECUTION = 8,
  9. EXECUTION_PARTIAL = 9,
  10. MARGIN_EXECUTION = 10,
  11. MARGIN_PARTIAL_EXECUTION = 11,
  12. REJECT = 12,
  13. ORDER_REJECT = 13,
  14. ORDER_ACK = 14,
  15. CANCELLED = 15,
  16. REPLACED = 16,
  17. QUOTE_FILL = 17,
  18. QUOTE_FILL_PARTIAL = 18,
  19. MARGIN_REPLACED = 19,
  20. CANCEL_REPLACE_REJECT = ,
  21. INSTRUMENT = 21,
  22. INSTRUMENT_REQUEST = 22,
  23. RISK_REJECT = 23,
  24. TOB_MSG = 24,
  25. THREE_LAYER_MD_MSG = 25,
  26. FIVE_LAYER_MD_MSG = 26,
  27. TEN_LAYER_MD_MSG = 27,
  28. TWENTY_LAYER_MD_MSG = 28,
  29. THIRTY_LAYER_MD_MSG = 29,
  30. EXEC_REPORT = 30,
  31. COLLATERAL_DATA = 31,
  32. COLLATERAL_UPDATE_REQ = 32,
  33. RISK_USER_SYMBOL = 33,
  34. RISK_UPDATE_REQUEST = 34,
  35. OPEN_ORDER_REQUEST = 35,
  36. CLIENT_LOGON = 36,
  37. MD_SNAPSHOT = 37,
  38. MD_SUBSCRIBE = 38,

Required Fields by Message Type and Order Type

The numerals in the Field Name row indicate the order type listed above. To find out if a particular field is required find the field name in the left hand column and then find the numerical value corresponding to the order type listed in the preceeding section. Example: To determine if the StopLimit price must be included in an OCO order, find the numerical value of the OCO order type in the section above (8) and then find StopLimitPrice in the left hand column and then go to the right to the header value of 8. In this case, yes, StopLimitPrice is required when sending the message ORDER_NEW with the ORDER_TYPE = OCO (8).

Message Type: ORDER_NEW

Field Name 1 2 3 4 5 6 7 8 9 12 13 14 15
Msg1 x x x x x x x x x x x x x
Msg2
MsgLen x x x x x x x x x x x x x
MessageType x x x x x x x x x x x x x
Padding
Account x x x x x x x x x x x x x
OrderID x x x x x x x x x x x x x
SymbolEnum x x x x x x x x x x x x x
OrderType x x x x x x x x x x x x x
SymbolType x x x x x x x x x x x x x
BOPrice x x x x x x x x x x x x x
BOSide x x x x x x x x x x x x x
BOOrderQty x x x x x x x x x x x x x
TIF x x x x x x x x
StopLimitPrice x x x x x
BOSymbol x x x x x x x x x x x x x
OrigOrderID
BOCancelShares
ExecID
ExecShares
RemainingQuantity
ExecFee
ExpirationDate
TraderID
RejectReason
SendingTime x x x x x x x x x x x x x
TradingSessionID x x x x x x x x x x x x x
Key x x x x x x x x x x x x x
DisplaySize 1 1 1 1 1
RefreshSize 1 1 1 1 1
Layers x
SizeIncrement x
PriceIncrement x
PriceOffset x
BOOrigPrice
ExecPrice
MsgSeqNum x x x x x x x x x x x x x
TakeProfitPrice
TriggerType
Attributes 1 1 1 1 1

Note 1: Attributes currently are used to indicate Hidden or Display Refresh is to be used. Currently only HIDDEN_TYPE and DISPLY_TYPE are in use.

ATTRIBUTE_TYPES:

  1. RESERVED_TYPE,
  2. HIDDEN_TYPE = 1,
  3. DISPLY_TYPE = 2,
  4. SIZEINCREMENT_TYPE = 3,
  5. POST_TYPE = 4,
  6. PRICEINCREMENT_TYPE = 5,
  7. OFFSET_TYPE = 6,
  8. STOP_MKT_TYPE = 7,
  9. STOP_LMT_TYPE = 8,
  10. PEG_TYPE = 9,
  11. TSL_TYPE = 10,
  12. TSM_TYPE = 11,

Message Type: CANCEL_REPLACE

Field Name 1 2 3 4 5 6 7 8 9 12 13 14 15
Msg1 x x x x x x x x x x x x x
Msg2
MsgLen x x x x x x x x x x x x x
MessageType x x x x x x x x x x x x x
Padding
Account x x x x x x x x x x x x x
OrderID x x x x x x x x x x x x x
SymbolEnum x x x x x x x x x x x x x
OrderType x x x x x x x x x x x x x
SymbolType x x x x x x x x x x x x x
BOPrice x x x x x x x x x x x x x
BOSide x x x x x x x x x x x x x
BOOrderQty x x x x x x x x x x x x x
TIF x x x x x x x x x x x x x
StopLimitPrice x x x x x
BOSymbol x x x x x x x x x x x x x
OrigOrderID
BOCancelShares
ExecID
ExecShares
RemainingQuantity
ExecFee
ExpirationDate
TraderID
RejectReason
SendingTime x x x x x x x x x x x x x
TradingSessionID x x x x x x x x x x x x x
Key x x x x x x x x x x x x x
DisplaySize 1 1 1 1 1
RefreshSize 1 1 1 1 1
Layers
SizeIncrement
PriceIncrement
PriceOffset
BOOrigPrice
ExecPrice
MsgSeqNum x x x x x x x x x x x x x
TakeProfitPrice
TriggerType
Attributes 1 1 1 1 1

Note 1: Attributes currently are used to indicate Hidden or Display Refresh is to be used. Currently only HIDDEN_TYPE and DISPLY_TYPE are in use.

ATTRIBUTE_TYPES:

  1. RESERVED_TYPE,
  2. HIDDEN_TYPE = 1,
  3. DISPLY_TYPE = 2,
  4. SIZEINCREMENT_TYPE = 3,
  5. POST_TYPE = 4,
  6. PRICEINCREMENT_TYPE = 5,
  7. OFFSET_TYPE = 6,
  8. STOP_MKT_TYPE = 7,
  9. STOP_LMT_TYPE = 8,
  10. PEG_TYPE = 9,
  11. TSL_TYPE = 10,
  12. TSM_TYPE = 11,

Message Type: ORDER_CANCEL

Field Name 1 2 3 4 5 6 7 8 9 12 13 14 15
Msg1 x x x x x x x x x x x x x
Msg2
MsgLen x x x x x x x x x x x x x
MessageType x x x x x x x x x x x x x
Padding
Account x x x x x x x x x x x x x
OrderID x x x x x x x x x x x x x
SymbolEnum x x x x x x x x x x x x x
OrderType x x x x x x x x x x x x x
SymbolType x x x x x x x x x x x x x
BOPrice x x x x x x x x x x x x x
BOSide x x x x x x x x x x x x x
BOOrderQty x x x x x x x x x x x x x
TIF x x x x x x x x x x x x x
StopLimitPrice x x x x x
BOSymbol x x x x x x x x x x x x x
OrigOrderID x x x x x x x x x x x x x
BOCancelShares
ExecID
ExecShares
RemainingQuantity
ExecFee
ExpirationDate
TraderID x x x x x x x x x x x x x
RejectReason
SendingTime x x x x x x x x x x x x x
TradingSessionID x x x x x x x x x x x x x
Key x x x x x x x x x x x x x
DisplaySize
RefreshSize
Layers
SizeIncrement
PriceIncrement
PriceOffset
BOOrigPrice x x x x x x x x x x x x x
ExecPrice
MsgSeqNum x x x x x x x x x x x x x
TakeProfitPrice
TriggerType
Attributes

Note 1: Attributes currently are used to indicate Hidden or Display Refresh is to be used. Currently only HIDDEN_TYPE and DISPLY_TYPE are in use.

ATTRIBUTE_TYPES:

  1. RESERVED_TYPE,
  2. HIDDEN_TYPE = 1,
  3. DISPLY_TYPE = 2,
  4. SIZEINCREMENT_TYPE = 3,
  5. POST_TYPE = 4,
  6. PRICEINCREMENT_TYPE = 5,
  7. OFFSET_TYPE = 6,
  8. STOP_MKT_TYPE = 7,
  9. STOP_LMT_TYPE = 8,
  10. PEG_TYPE = 9,
  11. TSL_TYPE = 10,
  12. TSM_TYPE = 11,

Protobuf BOClientLogon

BOClientLogon -- Client Sending


  BOMsg::BOClientLogon logon;
  logon.set_msg1("H");
  logon.set_logontype(1);
  logon.set_account(100700);
  logon.set_username("BOU7");
  logon.set_tradingsessionid(506);
  logon.set_sendingtime(1833818393838331);
  logon.set_msgseqid(500);
  logon.set_key(123456);

  // prep for sending message
  int siz = logon.ByteSizeLong() + 8;  // need an extra 8 bytes for the message header
  char pkt[siz];
  google::protobuf::io::ArrayOutputStream aos(&pkt, siz);
  CodedOutputStream coded_output(&aos);
  coded_output.WriteVarint32(type);
  coded_output.WriteVarint32(siz);
  logon.SerializeToCodedStream(&coded_output);
  // send message

AES response


  BOMsg::BOClientLogon logon;
  logon.msg1();
  logon.logontype();
  logon.account();
  logon.username();
  logon.tradingsessionid();
  logon.primaryorderentryip();
  logon.secondaryorderentryip();
  logon.primarymarketdataip();
  logon.secondaryorderentryip();
  logon.sendingtime();
  logon.msgseqid();
  logon.loginstatus();
  logon.key();
  logon.rejectreason();

OES response


  BOMsg::BOClientLogon logon;
  logon.msg1();
  logon.logontype();
  logon.account();
  logon.username();
  logon.tradingsessionid();
  logon.sendingtime();
  logon.msgseqid();
  logon.key();
  logon.loginstatus();
  logon.rejectreason();

message BOClientLogon {
  string msg1 = 1;
  string msg2 = 2;
  int32 MsgLen = 3;
  int32 LogonType = 4;
  int32 Account = 5;
  string UserName = 6;
  int32 TradingSessionID = 7;
  string PrimaryOrderEntryIP = 8;
  string SecondaryOrderEntryIP = 9;
  string PrimaryMarketDataIP = 10;
  string SecondaryMarketDataIP = 11;
  uint64 SendingTime = 12;
  int64 MsgSeqID = 13;
  int32 Key = 14;
  int32 LoginStatus = 15;
  int32 RejectReason = 16;
  string RiskMaster = 17;
}
  1. The BOClientLogon message must be sent to the AES in order to initiate the logon process (please contact BO Representative for IP address and port).
  2. The AES will respond with a BOClientLogon with logon status and if logon was successful the IP Address and Port of the OES and MDS (Order Entry Server and Level Based Market Data Server).
  3. After a successful logon to the AES the user will proceed to log into the OES and/or MDS using the IP and port information provided in the AES Response to the login. Upon successful login to either or both of the OES and/or MDS the user may enter orders or subscribe to market data.
  4. Only one login session is permited for a unique account ID and UserName.
  5. BO requests that if they user is going to close the connection a BOClientLogon message should be sent with the LogonType set to 2 prior to closing the connection in order to allow the OES to close the connection gracefully.
  6. BOClientLogon Example Message - Client Sending
Field Name Data Type Required Field Required Value Example Value Notes
Msg1 string c/s H H Header
LogonType Int c/s 1 Note1
Account Int c/s 253336 Note2
2FA string[] c 1F6A Note4
UserName string[] c BOU1 Note2
TradingSessionID Int s 506 Note2
PrimaryOESIP string[] s 192.81.32.5:40025 Note3
SecondaryOESIP string[] s Note3
PrimaryMDIP string[] s Note Used
SecondaryIP string[] s Not Used
SendingTime Long c/s Note 5
MsgSeqNum Int c/s 1500201
Key Int c 432451
LoginStatus string s
RejectReason string s
RiskMaster string

Notes:

  1. LogonType is an integer enum, values: Login = 1, Logout = 2
    • If the value is not one of the values above, a logout message will be sent and the connection closed.
  2. Value assigned by BO. If this is a logout, the TradingSessionID must be supplied.
  3. IP address and port of the OES and MDS will be sent in the server response BOClientLogon message.
  4. Sending times are in nanoseconds from the epoch, January 1, 1970.

Protobuf Collateral Data

Collateral data is the equity maintained by the user. In order to find out the current balance of any equity on account, the user should send a BOCollateralUpdateRequest with the symbol enum of the instrument in question. Example, if the user was interested in finding out the equity balance of BTCUSDT then the user would set the symbol enum = 4. A symbol enum value of 0 will result in the sending of all instruments where the user has an equity balance.


  BOMsg::BOCollateralUpdateRequest req;
  req.set_msg1("f");
  req.set_updatetype(2);
  req.set_account(100700);
  req.set_tradingsessionid(506);
  req.set_symbolenum(4);
  req.set_key(123456);
  req.set_msgseqid(500);
  req.set_sendingtime(1624821404362542113);
  // prep for sending message
  int siz = req.ByteSizeLong() + 8;  // need an extra 8 bytes for the message header
  char pkt[siz];
  google::protobuf::io::ArrayOutputStream aos(&pkt, siz);
  CodedOutputStream coded_output(&aos);
  int type = (int)'f';
  coded_output.WriteVarint32(type);
  coded_output.WriteVarint32(siz);
  req.SerializeToCodedStream(&coded_output);
  // send message

OES response


  char* buf = msg.buf;                                   // incoming data from the socket reader
  google::protobuf::uint32 size;
  google::protobuf::uint32 stype;
  google::protobuf::io::ArrayInputStream ais(buf, 1000);
  CodedInputStream coded_input(&ais);
  coded_input.ReadVarint32(&stype);                      //Decode the HDR and get the type
  coded_input.ReadVarint32(&size);                       //Decode the HDR and get the size
  char msgtype = (char)stype;

  BOMsg