Skip to content
QuantLabTickDirect

DocsProtocol

Message format

The byte layout of each SBE message.

Messages are encoded with FIX SBE (Simple Binary Encoding). The formal definition is the SBE schema (freqrelay-sbe.xml, schema ID 1, version 1). All numbers are little-endian.

Message header

Every message starts with an 8-byte message header.

OffsetTypeFieldValue
0uint16blockLengthThe number of bytes in the root block (the fixed-length part after the header)
2uint16templateIdThe message type (table below)
4uint16schemaId1
6uint16version1
templateIdMessageDirection
1SubscribeClient → Tick server
2SubscribeAckTick server → client
3HeartbeatClient → Tick server
4HeartbeatAckTick server → client
5TicksTick server → client
6HelloClient → Tick server
7ChallengeTick server → client
8AuthenticateClient → Tick server
9AuthenticateAckTick server → client

Rules for reading

  • Find the position after the root block (where repeating groups start) from the header's blockLength. Fields may be added to the end of the root block in the future.
  • A repeating group is a 4-byte group header (uint16 blockLength = bytes per entry, uint16 numInGroup = number of entries) followed by the entries. Find the position of each entry from the group header's blockLength as well.
  • Ignore messages whose schemaId is not 1.

The offsets in the tables below are counted from just after the message header (byte 8 of the message) as 0.

Ticks (5)

Ticks for the subscribed symbols. The figure below shows a whole Ticks message with one tick (54 bytes).

Ticks message (one tick)54 bytes
00000800050001000100
00083207000000000000
001022000100030000c3
001877060000000058de
0020770600000000a575
0028ffedbdcbe818a575
0030ffedbdcbe818
messageHeaderblockLength 8, templateId 5 (Ticks), schemaId 1, version 1
sequence1842 (per-subscriber sequence)
groupSize34-byte entries, 1 entry
symbolId3 (EURUSD)
bid108512000 → 1.08512
ask108519000 → 1.08519
upstreamTimeSame as receiveTime (Alpha sends no time)
receiveTime2026-11-17 09:41:08.109342117 UTC
OffsetTypeField
0uint64sequence (per-subscriber datagram sequence number, starting at 1)
8Group header34-byte entries
12 + 34 × iuint16Symbol ID
14 + 34 × iint64Bid (price × 10⁸)
22 + 34 × iint64Ask (price × 10⁸)
30 + 34 × iint64Upstream time (the time the LP put on the tick; UTC, nanoseconds since 1970-01-01)
38 + 34 × iint64Receive time (the time the Tick server received the tick; UTC, nanoseconds)
  • One datagram can carry several ticks that had accumulated at the time. It can also carry more than one tick for the same symbol. Entries are in the order the Tick server received them, so process them from first to last.
  • Prices are fixed-point. A bid of 108512000 is 1.08512.
  • A gap in sequence means that many datagrams were lost. A tick is superseded by the next update, so the Tick server does not resend it.
  • For the same symbol, a tick whose upstream time is older than a tick already sent is not sent.

Hello (6)

OffsetTypeField
0uint8[32]Padding (all zeros)

40 bytes in total. The Tick server does not reply to a Hello without the padding.

Challenge (7)

OffsetTypeField
0uint8[16]Cookie

Authenticate (8)

OffsetTypeField
0uint32requestId (returned unchanged in AuthenticateAck)
4uint16Length of the JWT (at most 1,024)
6uint8[length]JWT (compact form, ASCII)

AuthenticateAck (9)

OffsetTypeField
0uint32requestId
4uint8result (Authentication results)
5uint8[16]Subscriber token (valid only when Accepted; zeros otherwise)

Subscribe (1)

OffsetTypeField
0uint8[16]Subscriber token
16uint32requestId (returned unchanged in SubscribeAck)
20Group header16-byte entries, at most 64
24 + 16 × ichar[16]Symbol name (UTF-8, padded with zero bytes)
  • Replaces the subscription with the set of symbols sent.
  • Sending an empty set ends the subscriber.

SubscribeAck (2)

OffsetTypeField
0uint32requestId
4uint8result (0 = Accepted, 1 = UnknownSubscriber)
5Group header18-byte entries
9 + 18 × iuint16Symbol ID (65535 for a symbol that does not exist)
11 + 18 × ichar[16]Symbol name
  • When Accepted, there is one entry for each requested symbol, in the order of the request.
  • UnknownSubscriber means the subscriber token cannot be used from this source (the subscriber ended, the request came from another source, or the Tick server restarted). There are no entries. Start over from Hello.

Heartbeat (3)

OffsetTypeField
0uint8[16]Subscriber token

HeartbeatAck (4)

OffsetTypeField
0uint8subscribed (1 = the subscription is alive, 0 = it has ended)
1uint8upstreamStatus (LP connection status)
2uint8endReason (Why a subscription ends; 0 when subscribed is 1)