Skip to the content
AI Test AutomationPreview AI Security Learning Center

AI Test AutomationCapital markets AI testingMarket data lab

Capital markets AI testing Preview

Market data lab: an exchange feed, byte by byte

IEX's TOPS feed in its own binary format, read the way a production feed handler reads it, then spoken in FIX 4.4 and squeezed into FAST 1.1. Inspect every byte, break the feed on purpose, and run the tests that hold each format to its specification.

The feed

From the exchange's wire format to the two formats the industry speaks

IEX publishes its top-of-book feed, TOPS, as binary messages in its own transport protocol, IEX-TP, and posts each day's feed as a free recording (IEX HIST). This lab reads it byte for byte, checks it as a production feed handler must, and republishes it as FIX 4.4 and as FAST 1.1.

  1. Capturepcap or pcapng, Ethernet, IPv4, UDP
  2. IEX-TP40-byte segment header, sequence numbers, stream offset
  3. TOPS 1.66Quote Update, Trade Report, System Event; little endian, 4 implied decimals
  4. Feed handlergaps, duplicates, crossed quotes, halts, gap fill requests
  5. FIX 4.435=X incremental refresh; 35=D and 35=8 for orders
  6. FAST 1.1presence maps, stop bits, copy, increment and delta

The sample on this page is synthetic: 3,144 messages for this lab's fictional symbols and ten popular tickers from 09:29:58 to 09:32:00 on October 26, 2026, written in the exact IEX-TP and TOPS 1.66 layouts by tools/make_sample.py. The trading lab can replay it, or a small real slice you load, into a working product. Real data.

IEX Transport Protocol (IEX-TP) v1 specification · IEX TOPS Specification v1.66 · IEX market data: HIST, free historical data on a T+1 basis

Inspect the bytes

Every field, where it sits, and what it decodes to

Pick a segment: the 40-byte IEX-TP header, then each message after its 2-byte length. Hover or tap a field for its name, bytes and value. Integers are little endian, so a size reads backwards.


          
FieldBytesValue

Three wire formats

The same quote as the exchange sent it, as FIX, and as FAST

IEX TOPS

FIX 4.4

FAST 1.1

The whole sampleBytesPer messageAgainst FIX
How the three compare

FIX here includes the session header (49, 56, 34, 52) every real message carries. FAST uses two templates: Quote (sequence by increment, time by delta, symbol and sizes by copy, prices as decimals with a copied exponent and a delta mantissa) and Trade (the same, plus the trade ID by increment). The FAST stream depends on the messages before it: lose one and the receiver's dictionary is wrong, which is why FAST feeds reset it on every packet or carry a reset message. FAST Specification 1.x.1 (FIX Trading Community) · FIX 4.4 MarketDataIncrementalRefresh (35=X), OnixS dictionary · FIX CheckSum and BodyLength, OnixS dictionary appendix B

Break the feed

What a feed handler must notice, and the tests that prove it

Multicast feeds lose packets, arrive twice (IEX sends A and B copies) and sometimes say something impossible. Each button replays the sample through a fresh feed handler with one thing done to it.

IEX Transport Protocol (IEX-TP) v1 specification. The gap fill request is the IEX-TP layout: a 16-byte header (version, request type 1 for sequenced messages, protocol, channel, session, range count) and one 16-byte inclusive range per gap.

25 tests against the specifications, 9 defects to catch

The FAST tests check the byte examples printed in the specification itself; the IEX tests build messages from the TOPS layout tables and read the sample; the FIX tests check the checksum, body length, gap handling and the order messages. Turn a defect on and run them, or let the mutation run try each alone.

Real IEX data

Swap the sample for a real trading morning

IEX HIST files are a few gigabytes a day, far too much for a page. iex_slice.py streams one and keeps only the symbols and minutes you name (Python standard library only). Load the result in the trading lab: open its Data tab, choose Your own slice, and the page cuts it again to what it needs.

Cut a real sample, then rebuild

python data/testlab/trading/feed/tools/iex_slice.py \
    20261027_IEXTP1_TOPS1.6.pcap.gz \
    data/testlab/trading/feed/iex-tops-sample.pcap \
    --symbols SPY,AAPL,MSFT,NVDA --start 09:29:55 --minutes 2
python scripts/build_learn_site.py

The slicer on the synthetic sample, gzipped

$ python iex_slice.py 20261026_SAMPLE_TOPS1.6.pcap.gz slice.pcap --symbols KITE,LUMA --start 09:30:00 --minutes 1
read 1604 messages, kept 328 for KITE,LUMA from 09:30:00 EDT on 2026-10-26: slice.pcap
exit 0

node run.js (the market data part)

$ node run.js
FAST
  PASS  Stop-bit unsigned integers match the specification: 942755 is 39 45 a3
  PASS  Signed integers are two's complement: -7942755 is 7c 1b 1b 9d, -2 is fe, -5 is fb
  PASS  ASCII strings set the stop bit on the last character: "ABC" is 41 42 c3
  PASS  Every quote and trade in the sample survives FAST encoding and decoding unchanged
  PASS  FAST carries the same quotes and trades in under a third of the FIX bytes

FIX
  PASS  CheckSum is the byte sum modulo 256, three digits; BodyLength counts the body
  PASS  A TOPS quote becomes a 35=X with a bid and an offer entry, prices in dollars
  PASS  A sequence gap is answered with a ResendRequest; the resend keeps the original numbers
  PASS  An order goes out as 35=D and comes back as 35=8 with the fill
  PASS  A cancel goes out as 35=F naming the order it cancels in 41; a filled one comes back as 35=9, too late to cancel
  PASS  A change goes out as 35=G with the new ClOrdID and the old one in 41, and is answered with ExecType 5, Replace
  PASS  A trailing stop goes out pegged: OrdType P, ExecInst a, a signed PegOffsetValue; good till date carries ExpireDate
  PASS  Lost heartbeats are not resent: one SequenceReset-GapFill skips them, and the next order arrives in sequence

FIX checker
  PASS  A message the engine built has nothing wrong with it, written with SOH, |, ^A or <SOH>
  PASS  A limit order with no price and a wrong checksum: both found; mending fixes the frame, not the missing price
  PASS  An execution report whose CumQty and LeavesQty do not add up to OrderQty is flagged
  PASS  A log with a gap that a gap fill closed: the gap is noted, and the session counts as recovered
  PASS  The same gap, never filled: the checker says the messages are lost

FIX
  PASS  A message is read into tag, field name, value and meaning
  PASS  An accepted order is ACKed, a rejected one is NACKed with the reason, and a heartbeat is neither

Feed
  PASS  A TOPS Quote Update decodes: 4 implied decimals, little endian sizes, padded symbol
  PASS  Every segment in the sample is IEX-TP v1, TOPS on channel 1, blocks adding up to the payload
  PASS  The sample decodes clean: 3,144 messages, no gaps, no alerts, the open at 09:30:00
  PASS  A lost segment is a gap, and the gap fill request names exactly the missing messages
  PASS  The same segment twice (the A and B feeds) is counted once
  PASS  A crossed quote raises an alert and stays out of the book
  PASS  A quote flagged unavailable for trading marks the symbol halted
  PASS  The cutoff keeps only the chosen symbols inside the window, and every system event
  PASS  New York time follows daylight saving: UTC-4 in October, UTC-5 in January
  PASS  The same feed in a pcapng capture decodes to the same messages

78 passed, 0 failed
exit 0

Data provided for free by IEX. By accessing or using IEX Historical Data, you agree to the IEX Historical Data Terms of Use. IEX Historical Data Terms of Use · IEX market data: HIST, free historical data on a T+1 basis

Sources

Read on these pages, 2026-10-29

The decoders are data/testlab/trading/feed/iex.js, fix.js and fast.js; the page runs them as they are. The symbols in the sample are this lab's fictional ones, and the trading lab replays the same feed into its product.