Basic Prerequisites: Low-Latency Linux & Networking (TCP sockets, kernel bypass) and Market Microstructure & Order Types (what an order is at the venue). (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)
1. Intuition & Practical Objective
An exchange is a conversation partner, not a database you query. You do not “submit” an order; you send a message, wait for the venue to acknowledge it, and then live with a shared state that both sides must keep in sync over an inherently unreliable wire. FIX - the Financial Information eXchange protocol - is the standard language for that conversation: a text, tag=value messaging format with its own session layer (logon, heartbeats, sequence numbers, resend) sitting on top of TCP.
The practical objective of this folder is to make you fluent in three layers at once: the message (what goes on the wire), the session (how two engines agree on what has been sent and received), and the order lifecycle (how a single order’s state evolves so that your book and the exchange’s book never disagree). This folder is a hub: it gives you the fast message-tag lookup below (job #1 of this pillar) and routes you to six sub-pages that walk from raw intuition to binary venue feeds.
The one-sentence essence. “FIX is a sequenced, recoverable conversation: every message carries a tag-value payload and a monotone sequence number, and correctness means that after any drop, replay, or failover, both sides reconstruct the identical order state from the same message stream.”
The three laws of connectivity (each a first principle, not a convention):
- Ordering is guaranteed by sequence numbers, not by TCP - TCP gives you an ordered byte stream, but applications restart, and a byte stream has no memory of what your engine did before it crashed. Tags
34(MsgSeqNum) give application-level order and recovery. - State is shared and must converge - your order book is a replica of the venue’s; every
ExecutionReport(35=8) is a state transition, and a lost one leaves you desynced until you resend. - Reliability is expensive; exotic protocols trade it for speed - binary feeds (ITCH/OUCH) drop the text framing and the rich session semantics to shave bytes and nanoseconds; you pay for that speed in recovery complexity.
2. Mathematical Ground Truth & Lookups
Quick-reference lookup (job #1). Every number below is reproduced by a verified script in §3 or a sub-page.
Notation: arrival rate (msg/s), message size (bytes), link capacity (bit/s), round-trip latency, backlog (messages).
Message rate and bandwidth. A session’s required bandwidth is the message rate times the message size:
For msg/s at B on a 1 Gbps link this is Mbit/s - only of the link, so latency, not bandwidth, is the binding constraint.
Journal (resend-log) growth. Every outbound message must be persisted for replay, so the log grows at
Sequence-number invariant. Let be the next inbound sequence number expected. On receipt of message with MsgSeqNum = M:
The gap size is exactly , and the request covers the half-open-closed range .
Replay drain time. A backlog replayed at rate clears in : a 30 s outage at 20,000 msg/s leaves messages, which at msg/s drains in ms.
Little’s law for the session. Messages in flight ; a single in-order session needs a window , and s at 20,000 msg/s puts only messages in flight - FIX is a conversation, not a pipeline.
FIX message anatomy. A FIX message is a strictly ordered triplet: header → body → trailer, with 8 (BeginString) first, 9 (BodyLength) second, 35 (MsgType) in the header, and 10 (CheckSum) last. BodyLength counts the bytes between the 9-field’s SOH and the 10-field’s start; CheckSum is the byte sum modulo 256 rendered as three digits:
Common message types (35) and key tags.
MsgType 35 | Message | Role |
|---|---|---|
0 | Heartbeat | session keep-alive |
1 | TestRequest | probe a silent peer |
2 | ResendRequest | request a sequence gap |
3 | Reject | session-level reject |
4 | SequenceReset | gap-fill / hard reset |
5 | Logout | graceful session end |
A | Logon | session establish (HeartBtInt in 108) |
D | NewOrderSingle | submit an order |
F | OrderCancelRequest | cancel an order |
G | OrderCancelReplaceRequest | amend (cancel/replace) |
8 | ExecutionReport | order state transition (fill/ack/reject) |
V | MarketDataRequest | subscribe to a quote stream |
| Tag | Name | Notes |
|---|---|---|
8 / 9 / 35 | BeginString / BodyLength / MsgType | header |
49 / 56 | SenderCompID / TargetCompID | who is talking |
34 / 52 | MsgSeqNum / SendingTime | sequence + timestamp |
43 | PossDupFlag | Y on a replayed message |
122 | OrigSendingTime | original send time of a resend |
11 / 37 | ClOrdID / OrderID | your id / venue id |
17 | ExecID | unique id per execution (dedup key) |
150 / 39 | ExecType / OrdStatus | transition type / resulting state |
38 / 32 / 31 | OrderQty / LastQty / LastPx | size and fill price |
151 / 14 / 6 | LeavesQty / CumQty / AvgPx | running state |
55 / 54 / 40 / 44 / 59 | Symbol / Side / OrdType / Price / TimeInForce | the order itself |
10 | CheckSum | trailer |
3. Computational Implementation - the order-flow budget
This hub ships one self-contained model that ties the folder together: a session’s wire bandwidth, its resend-log growth, and its outage-replay time. Standard library only.
Read it as the operational consequence of the three laws: the resend log is the real infrastructure cost (285 GB/day for one session’s outbound stream), and the replay drain time is the floor on how long a disconnect can keep you out of the market.
4. Failure Modes & First-Principles Breakdowns
Hub signposts - the folder’s fault analysis lives in 05 · Failure Modes & Practice. In one line each:
- Sequence-number desync - crashing without persisting the last
MsgSeqNumforces aResendRequest(or aSequenceNumberTooLowrejection) and freezes trading until an operator clears it (this is law #1 failing). - Order-state desync on replay - reprocessing a resent
ExecutionReportwithout checkingPossDupFlag/ExecIDdouble-counts a fill and leaves you short an unhedged position (law #2 failing). - Silent session death - a peer that stops sending with no heartbeat timeout leaves you quoting into a dead link; the OS buffers and the fills never come (the heartbeat contract, §03).
5. References
- FIX Trading Community: *FIX Protocol
- FIX Trading Community: The FIX Algorithmic Trading Definition Language (FIXatdl) v1.1
- OnixS: FIX Dictionary & Protocol Reference
- Nasdaq: TotalView-ITCH 5.0 Specification
- Donadio, Sebastien: Learn Algorithmic Trading (Packt, 2019)
6. Connected Graph Bridges
- Sibling topic: Low-Latency Linux & Networking (the TCP/kernel-bypass layer a FIX session sits on)
- Sibling topic: High-Performance C++ for Trading (the encoder/decoder hot path)
- Sibling topic: Production Risk Guards & Kill Switches (the pre-trade check between signal and
NewOrderSingle) - Venue semantics: Market Microstructure & Order Types (what the
40/59fields actually mean) - Latency context: Colocation & Clock Synchronization (why the session’s RTT is the whole game)
- Sub-pages (in-folder): 01 From Zero · 02 The FIX Protocol · 03 Session Management · 04 Order Lifecycle & Connectivity · 05 Failure Modes · 06 Advanced Extensions
Beginner: start at 01 · Practitioner: start at 05
- Absolute beginner (zero messaging background): 01 · From Zero - why an order is a message.
- Engineering core (undergrad / job-seeking): 02 · The FIX Protocol → 03 · Session Management → 04 · Order Lifecycle & Connectivity.
- Robustness & scale (practitioner / graduate): 05 · Failure Modes → 06 · Advanced Extensions.
- Forward links: Low-Latency Systems Architecture · Risk Guards & Kill Switches