Messages
JSON key: <message type value> - This is the message type and must be in the format described by the "type" of the msg type field.
For integers, it must be a number e.g. "1".
For strings, it is a string of the specified string size e.g. "A" or "AE" etc.
JSON value: <message definition options> - this a JSON object containing additional key/values.
Each Message Definition value must contain a minimum of two keys: "name" and "fields", in which "name" is the name of the message being decoded, and then the set of fields for the message type value.
Each Message Definition can also optionally contain an additional key called "message_types". If the protocol being implemented contains multiple values which map to the same message, then we can specify a JSON array of values as shown in the Messages example below. In the Messages example below, the message "SymbolNationalBestOfferUpdate" will be decoded if the message type is 17, 18 or 19.
How the decoder decodes MessageDefinition datafields
Once the decoder has decoded the Message Header and Message Type, its selects a message definition using the Message Type. The internal offset counter is set to 0 again as it decodes each "field" defined for the selected message definition.
Messages example
"Messages"
: {
"1"
: {
"name"
:
"SymbolMemxTradingStateUpdate"
,
"fields"
: [
{
"name"
:
"TradingState"
,
"type"
:
"SymbolTradingState"
},
{
"name"
:
"StateChangeReason"
,
"type"
:
"SymbolStateReason"
},
]
},
"2"
: {
"name"
:
"Delete Order"
,
"fields"
: [
{
"name"
:
"SymbolId"
,
"type"
:
"ASCII64"
},
{
"name"
:
"OpeningState"
,
"type"
:
"SymbolOpeningState"
},
{
"name"
:
"MatchPrice"
,
"type"
:
"INT64_BE"
},
]
},
"17"
: {
"name"
:
"SymbolNationalBestOfferUpdate"
,
"message_types"
: [
"18"
,
"19"
],
"fields"
: [
{
"name"
:
"SymbolId"
,
"type"
:
"ASCII64"
},
{
"name"
:
"MarketDataTimestamp"
,
"type"
:
"timestamp"
},
{
"name"
:
"MarketDataSequence"
,
"type"
:
"UINT64_BE"
},
{
"name"
:
"NationalAskPrice"
,
"type"
:
"INT64_BE"
},
{
"name"
:
"AwayAskPrice"
,
"type"
:
"INT64_BE"
},
]
},
}