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):

  1. 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.
  2. 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.
  3. 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 35MessageRole
0Heartbeatsession keep-alive
1TestRequestprobe a silent peer
2ResendRequestrequest a sequence gap
3Rejectsession-level reject
4SequenceResetgap-fill / hard reset
5Logoutgraceful session end
ALogonsession establish (HeartBtInt in 108)
DNewOrderSinglesubmit an order
FOrderCancelRequestcancel an order
GOrderCancelReplaceRequestamend (cancel/replace)
8ExecutionReportorder state transition (fill/ack/reject)
VMarketDataRequestsubscribe to a quote stream
TagNameNotes
8 / 9 / 35BeginString / BodyLength / MsgTypeheader
49 / 56SenderCompID / TargetCompIDwho is talking
34 / 52MsgSeqNum / SendingTimesequence + timestamp
43PossDupFlagY on a replayed message
122OrigSendingTimeoriginal send time of a resend
11 / 37ClOrdID / OrderIDyour id / venue id
17ExecIDunique id per execution (dedup key)
150 / 39ExecType / OrdStatustransition type / resulting state
38 / 32 / 31OrderQty / LastQty / LastPxsize and fill price
151 / 14 / 6LeavesQty / CumQty / AvgPxrunning state
55 / 54 / 40 / 44 / 59Symbol / Side / OrdType / Price / TimeInForcethe order itself
10CheckSumtrailer

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:

  1. Sequence-number desync - crashing without persisting the last MsgSeqNum forces a ResendRequest (or a SequenceNumberTooLow rejection) and freezes trading until an operator clears it (this is law #1 failing).
  2. Order-state desync on replay - reprocessing a resent ExecutionReport without checking PossDupFlag/ExecID double-counts a fill and leaves you short an unhedged position (law #2 failing).
  3. 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

Beginner: start at 01 · Practitioner: start at 05