Skip to main content

SBE Messages

This section describes the implementation and protocol for Order messages transmitted from the Binary Market Data Gateway. These messages are encoded using the Simple Binary Encoding (SBE) format, with fields encoded in big-endian byte order.

Common SBE Header​

Every message begins with the SBE Header, which describes the message payload.

OffsetLengthNameDescriptionType
02Block LengthThe number of fixed sized bytes in the message body.Unsigned 16-bit integer
21Template IDIdentifier of the message type.Unsigned 8-bit integer
31Schema IDIdentifier of the message schema.Unsigned 8-bit integer
42VersionIdentifier of the message version.Unsigned 16-bit integer

Versioning​

Versioning of the Order Message schema is encoded within the Common SBE Header. The first 8 bits of the version field represents the major version of the schema, and the subsequent 8 bits represents the minor version of the schema. A version of 0300 in hex therefore represents the semantic version 2.0.

Messages​

InstrumentDirectory​

This message will be emitted as part of a Snapshot to inform the client of available instruments.

Header Values​

NameValue
Block Length46
Template ID1
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
1416Token IDUnique identifier of the Order instrument16-byte character sequence
305Base CurrencyBase Currency Symbol5-byte character sequence
355Quote CurrencyQuote Currency Symbol5-byte character sequence
402Unit MultiplierThe Unit Multiplier of the InstrumentSigned 16-bit integer
421Is Test SymbolIf the Instrument is a Test InstrumentBoolean Type
438MPVThe price increment of the instrumentFixedPointDecimal
511Instrument TypeType of Instrument1 byte character

Instrument Type Values​

ASCII ValueName
'1'Spot
'2'Perpetual Futures

Instrument Trading Status​

This message will be emitted as part of a Snapshot to inform the client of the status of available instruments.

Header Values​

NameValue
Block Length26
Template ID2
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
1416Token IDUnique identifier of the Order instrument16-byte character sequence
3031Instrument Trading StatusThe Trading Status of the Instrument1-byte character sequence
311Instrument Trading Status ReasonThe Reason for this Status1-byte character sequence

Instrument Trading Status Values​

ASCII ValueName
'H'Halted
'Q'Quoting
'L'Limit Only Trading
'T'Trading

Instrument Trading Status Reason Values​

ASCII ValueName
'X'None
'A'Administrative

Trading Session Status​

This message will be emitted as part of a Snapshot to inform the client of the status of the trading session

NameValue
Block Length9
Template ID3
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
141Session statusStatus representing if the Exchange is open or closed1-byte character sequence

Trading Session Status Values​

ASCII ValueName
'1'Trading
'2'Closed

Snapshot Complete​

This message will be emitted as part of a Snapshot to indicate the end of the snapshot.

Header​

NameValue
Block Length16
Template ID4
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
148Sequence NumberThe current broadcast Sequence numberSigned 64-bit integer

Order Added​

This message will be emitted when an order has been added to the book or as part of a snapshot.

Header​

NameValue
Block Length58
Template ID10
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
1416Token IDUnique identifier of the Order instrument16-byte character sequence
308Order IDUnique identifier of the OrderSigned 64-bit integer
388Correlation IDCorrelating ID between this message and the Order feed. This value will always be equal to the Order IDSigned 64-bit integer
461SideThe side of the order being added1 byte character
478QuantityThe total quantity being addedOrder Quantity
558PriceThe price of the new orderFixedPointDecimal
631Retail IndicatorThe retail disposition of the order1 byte character

Order Deleted​

This message will be emitted when an order has been removed from the book. This message will not be emitted when an order is fully filled.

Header​

NameValue
Block Length32
Template ID11
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
1416Token IDUnique identifier of the Order instrument16-byte character sequence
308Order IDUnique identifier of the OrderSigned 64-bit integer

Order Reduced​

This message will be emitted when an order has been reduced in quantity.

Header​

NameValue
Block Length40
Template ID12
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
1416Token IDUnique identifier of the Order instrument16-byte character sequence
308Order IDUnique identifier of the OrderSigned 64-bit integer
388QuantityThe new quantityOrder quantity

Order Executed​

This message will be emitted when an order on the book has been executed against. When the quantity executed reduces the remaining quantity to zero, consumers of this message should consider the order to be removed from the book. Otherwise, any outstanding quantity remains on the book with the same priority as the original order.

Header​

NameValue
Block Length64
Template ID13
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
1416Token IDUnique identifier of the Order instrument16-byte character sequence
308Order IDUnique identifier of the OrderSigned 64-bit integer
3816Trade IDUnique identifier of the Trade2 Signed 64-bit integers
548QuantityThe total quantity executedOrder quantity
628PriceThe executed price of the orderFixed Point Decimal

Incremental Trading Metric​

Header​

NameValue
Block Length33
Template ID14
Schema ID6
Version514

Payload​

OffsetLengthNameDescriptionType
06HeaderCommon SBE Header
68TimestampThe timestamp when the event occurred, in nanosecondsSigned 64-bit integer
1416Token IDUnique identifier of the Order instrument16-byte character sequence
301MdEntryTypeType of trading metric1-byte character
318MDEntryValueValue of trading metricFixedPointDecimal

MdEntryType Values​

ASCII ValueName
'3'IndexValue
'm'PreliminaryMarkPrice
'n'FinalMarkPrice
'p'PreliminaryFundingRate
'f'FinalFundingRate
'C'OpenInterest

Common Field Types​

Timestamp​

LengthTypeNameDescription
8Signed 64-bit integerTimestampTime represented as the number of nanoseconds since the UNIX epoch.

Token ID​

LengthTypeNameDescription
1616-byte character sequenceToken IDUnique identifier of an Instrument.

Order ID​

LengthTypeNameDescription
8Signed 64-bit integerOrder IDUnique identifier of an Order.

Trade ID​

Trades are identified using a 128-bit globally unique value. They are expressed as two signed 64-bit integers.

OffsetLengthTypeNameDescription
08Signed 64-bit integerUpper BitsThe most significant bits of the ID.
88Signed 64-bit integerLower BitsThe lease significant bits of the ID.

Side​

ASCII ValueName
'B'Buy
'S'Sell

Order Quantity​

This field represents the quantity that is present on an order or has been executed against an order as part of a trade. It is encoded as a signed 64-bit integer. To obtain the true quantity value, consumers of this data need to multiply the quantity by 10^(unit multiplier). The unit multiplier is available on the instrument directory. For example, an order quantity of 123456789 with a corresponding instrument unit multiplier of -8 would represent the decimal number 1.23456789. This was calculated by 123456789 * 10^(-8).

LengthTypeNameDescription
8Signed 64-bit integerOrder Quantity

FixedPointDecimal (Used in Price and MPV)​

This field represents a fixed point decimal, encoded as a signed 64-bit integer with a constant exponent of -8. For example, a value 123456789 would represent the decimal number 1.23456789.

LengthTypeNameDescription
8Signed 64-bit integerPrice

Retail Indicator​

ASCII ValueName
'1'Normal
'2'Designated Retail
'3'Retail Liquidity Provider