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.
| Offset | Type | Field | Value |
|---|---|---|---|
| 0 | uint16 | blockLength | The number of bytes in the root block (the fixed-length part after the header) |
| 2 | uint16 | templateId | The message type (table below) |
| 4 | uint16 | schemaId | 1 |
| 6 | uint16 | version | 1 |
| templateId | Message | Direction |
|---|---|---|
| 1 | Subscribe | Client → Tick server |
| 2 | SubscribeAck | Tick server → client |
| 3 | Heartbeat | Client → Tick server |
| 4 | HeartbeatAck | Tick server → client |
| 5 | Ticks | Tick server → client |
| 6 | Hello | Client → Tick server |
| 7 | Challenge | Tick server → client |
| 8 | Authenticate | Client → Tick server |
| 9 | AuthenticateAck | Tick 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, uint16numInGroup= number of entries) followed by the entries. Find the position of each entry from the group header'sblockLengthas well. - Ignore messages whose
schemaIdis 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).
000008000500010001003207000000000000
001022000100030000c377060000000058de
0020770600000000a575ffedbdcbe818a575
0030ffedbdcbe818
00000800050001000100
00083207000000000000
001022000100030000c3
001877060000000058de
0020770600000000a575
0028ffedbdcbe818a575
0030ffedbdcbe818
| messageHeader | 0–7 | blockLength 8, templateId 5 (Ticks), schemaId 1, version 1 | |
| sequence | 8–15 | 1842 (per-subscriber sequence) | |
| groupSize | 16–19 | 34-byte entries, 1 entry | |
| symbolId | 20–21 | 3 (EURUSD) | |
| bid | 22–29 | 108512000 → 1.08512 | |
| ask | 30–37 | 108519000 → 1.08519 | |
| upstreamTime | 38–45 | Same as receiveTime (Alpha sends no time) | |
| receiveTime | 46–53 | 2026-11-17 09:41:08.109342117 UTC |
| Offset | Type | Field |
|---|---|---|
| 0 | uint64 | sequence (per-subscriber datagram sequence number, starting at 1) |
| 8 | Group header | 34-byte entries |
| 12 + 34 × i | uint16 | Symbol ID |
| 14 + 34 × i | int64 | Bid (price × 10⁸) |
| 22 + 34 × i | int64 | Ask (price × 10⁸) |
| 30 + 34 × i | int64 | Upstream time (the time the LP put on the tick; UTC, nanoseconds since 1970-01-01) |
| 38 + 34 × i | int64 | Receive 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
108512000is 1.08512. - A gap in
sequencemeans 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)
| Offset | Type | Field |
|---|---|---|
| 0 | uint8[32] | Padding (all zeros) |
40 bytes in total. The Tick server does not reply to a Hello without the padding.
Challenge (7)
| Offset | Type | Field |
|---|---|---|
| 0 | uint8[16] | Cookie |
Authenticate (8)
| Offset | Type | Field |
|---|---|---|
| 0 | uint32 | requestId (returned unchanged in AuthenticateAck) |
| 4 | uint16 | Length of the JWT (at most 1,024) |
| 6 | uint8[length] | JWT (compact form, ASCII) |
AuthenticateAck (9)
| Offset | Type | Field |
|---|---|---|
| 0 | uint32 | requestId |
| 4 | uint8 | result (Authentication results) |
| 5 | uint8[16] | Subscriber token (valid only when Accepted; zeros otherwise) |
Subscribe (1)
| Offset | Type | Field |
|---|---|---|
| 0 | uint8[16] | Subscriber token |
| 16 | uint32 | requestId (returned unchanged in SubscribeAck) |
| 20 | Group header | 16-byte entries, at most 64 |
| 24 + 16 × i | char[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)
| Offset | Type | Field |
|---|---|---|
| 0 | uint32 | requestId |
| 4 | uint8 | result (0 = Accepted, 1 = UnknownSubscriber) |
| 5 | Group header | 18-byte entries |
| 9 + 18 × i | uint16 | Symbol ID (65535 for a symbol that does not exist) |
| 11 + 18 × i | char[16] | Symbol name |
- When
Accepted, there is one entry for each requested symbol, in the order of the request. UnknownSubscribermeans 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 fromHello.
Heartbeat (3)
| Offset | Type | Field |
|---|---|---|
| 0 | uint8[16] | Subscriber token |
HeartbeatAck (4)
| Offset | Type | Field |
|---|---|---|
| 0 | uint8 | subscribed (1 = the subscription is alive, 0 = it has ended) |
| 1 | uint8 | upstreamStatus (LP connection status) |
| 2 | uint8 | endReason (Why a subscription ends; 0 when subscribed is 1) |