RiptideRiptide
Download Riptide SDKInstall Riptorch
Menu
Whitepapers · Riptide · Quantitative finance

Exact order books for every US equity symbol, on a GPU

Market data is integers: prices in ticks, sizes in shares, order numbers, timestamps in nanoseconds. A book or a feature built from them has one exact answer. This paper rebuilds the full order book of every US equity symbol for a real trading day on a GPU, computes three standard features on every trade exactly, and measures what the usual GPU and CPU tools return for the same inputs.

Version
1
Date
1 December 2026
Author
Samario Torres, Riptide
Software
Riptide exact order-book and feature code (CuPy 14.2.0 arrays plus custom CUDA kernels, C++ for the CPU reconstructor; not published); cuDF 26.10.02 (default allocator; RMM pool and RMM pool over managed memory for the rerun), PyTorch 2.15.0+cu132 (torch.compile: max-autotune for rolling variance, max-autotune-no-cudagraphs for VWAP), pandas 3.0.6, polars 2.2.0, NumPy 2.4.6, Python 3.12.3; gcc 13 at -O3 -march=native; NVIDIA driver 620.70.06
Download PDFOpen in new tabriptidecompute.com/whitepapers/exact-us-equities-order-books

Abstract

On 1 December 2026 Riptide rebuilt the full-depth order book of every symbol in two public Nasdaq TotalView-ITCH 5.0 sample days: Nasdaq on 28 November 2025 (a half trading day: 353,357,889 messages, 347,132,343 order and trade events, 12,320,360 trades) and Nasdaq BX on 30 January 2020 (48,908,210 events). Every message was applied: adds, executions, cancels, deletes and replaces, including replace chains thousands of links long. Every 5 minutes from 04:00 to 20:00 each implementation took a 64-bit checksum of the whole book (every symbol, side and price level with its resting shares).

Order books. On one NVIDIA A100 40 GB, the Nasdaq day took 0.634 s with the messages already on the GPU (547 million events per second) and 3.07 s including the copy to the GPU. A classic per-event CPU reconstructor (open-addressing hash tables, sharded by symbol) took 61.9 s on one thread, 13.1 s on 8 and 6.50 s on 64 threads of an Intel Xeon Platinum 8275CL: the GPU was 10× the 64-thread CPU with the data on the GPU and 2.1× including the copy. The same algorithm written with cuDF joins and groupbys took 1.92 s on the BX day, against 0.090 s, with cuDF's default allocator, and with that allocator ran out of memory on the Nasdaq day on the A100 and on the BX day on an A10G 24 GB. At its best memory settings on the A10G (an RMM pool over CUDA managed memory), cuDF finished the BX day in 1.27 s, against Riptide's 0.200 s on the same GPU, with the same checksums; an RMM pool without managed memory still ran out of memory. Every implementation that finished returned the same 193 checksums (156 of them of a non-empty book; the book is empty before the first add and after the close) on both days and every machine.

Features on every trade. On the Nasdaq day's trades, on the A100:

  • Rolling variance of the last 100 trade prices, every trade of every symbol (11.7 million windows). Exact: 4.5 ms. PyTorch's prefix-sum formula compiled with torch.compile ran in 1.1 ms but returned no correctly rounded window and was off by up to 1,818× (relative); cuDF's rolling variance (33.6 ms), PyTorch two-pass (40.9 ms), polars (0.27 s on the CPU) and pandas (1.38 s) were not correctly rounded on 99.3–99.8% of windows; the careful two-pass on integer ticks on 58%.
  • VWAP per symbol per minute (785,755 groups). Exact: 6.1 ms. PyTorch float64 was faster (5.0–5.3 ms) and cuDF slower (21.9 ms); their results were not correctly rounded on 44% and 33% of groups, by at most 1.3 × 10⁻¹⁴ relative. PyTorch and cuDF float64 returned different VWAPs on the A10G and the A100 (73,000–150,000 of 785,755 groups) and from run to run on the same GPU; the exact results, pandas and polars did not change.
  • All-pairs lead–lag of the 512 most-traded symbols, lags 0–60 s (16 million cross-products of 1-second price changes). The exact path on the integer tensor cores took 0.266 s on the A10G against 1.84 s for float64 (6.9× faster, both exact); on the A100, whose float64 tensor cores are strong, float64 took 0.049 s against 0.226 s. On the A100, float32 was wrong on 0.54% of entries and TF32 on 11.9% (A10G: 0.56% and 0.54%), and both differed between the two GPUs.

The data are Nasdaq's public sample files. Nasdaq posts no licence for them and we have not confirmed terms with Nasdaq, so this paper reports only aggregate timings, counts and error statistics: no prices, tickers or per-symbol values.

What this lets you do

  • Rebuild a whole market's books in under a second. Backtests, replays, surveillance and research that need the book of every symbol at every moment can run on one GPU at about half a billion events a second, with the same book bits as the CPU reconstructor.
  • Prove two systems agree. An order-independent book checksum every 5 minutes lets a CPU feed handler, a GPU replay and an auditor's copy show they hold the same book, bit for bit.
  • Get one feature value everywhere. Integer sums of ticks and shares and one division at the end give the same VWAP and variance on every GPU and CPU, every run; float64 GPU group sums gave different VWAPs on different GPUs and on reruns.
  • Find the windows your float pipeline gets wrong, and how badly: from the last bit (VWAP) to 1,818× the true value (a compiled prefix-sum variance).
Bar chart, log scale: seconds to rebuild every symbol's full order book for the Nasdaq 28 November 2025 session (347 million events). CPU 1 thread 61.90 s, 8 threads 13.14 s, 64 threads 6.50 s; GPU including the copy to the GPU 3.07 s; GPU with the data on the GPU 0.63 s.
Figure 1. Every symbol's full order book, one trading day, on an Intel Xeon 8275CL and one NVIDIA A100 40 GB. All runs produced the same 193 book checksums.

Results

Order books

Table 1. Rebuilding every symbol's full-depth book from every event, with a whole-book checksum every 5 minutes (193 snapshots). GPU times are best of three warm runs (the A10G BX run used an earlier single-pass version of the reduction; the A100 runs used the chunked reduction described in Method); "with copy" adds the copy of the event columns from host memory. Cost uses the GPU's share of the instance price (A100: one of eight GPUs of a p4d.24xlarge spot box at $16.91/h; A10G: g5.xlarge on-demand $1.006/h) and, for CPU runs, a comparable CPU instance's on-demand price per vCPU used (c5.24xlarge for the Xeon, c5a.xlarge for the EPYC).
Day (events)MachineImplementationSecondsWith copyEvents per secondSame checksumsCost of the day
Nasdaq, 28 Nov 2025 (347.1M)Xeon 8275CLCPU, 1 thread61.95.6Myes$0.0007
Xeon 8275CLCPU, 8 threads13.126.4Myes$0.0012
Xeon 8275CLCPU, 64 threads6.5053.4Myes$0.0049
A100 40 GBGPU, Riptide0.6343.07547Myes$0.0018
A100 40 GBGPU, cuDF (default allocator)out of memory
EPYC 7R32 (4 vCPU)CPU, 1 / 4 threads62.3 / 23.75.6M / 14.7Myes$0.0007 / $0.0010
Nasdaq BX, 30 Jan 2020 (48.9M)A100 40 GBGPU, Riptide0.0900.446545Myes$0.0003
A100 40 GBGPU, cuDF (default allocator)1.922.3225.5Myes$0.0014
Xeon 8275CLCPU, 1 / 64 threads4.93 / 1.839.9M / 26.7Myes$0.0001 / $0.0014
A10G 24 GBGPU, Riptide0.2000.488244Myes$0.0001
A10G 24 GBGPU, cuDF (default allocator)out of memory
A10G 24 GBGPU, cuDF (RMM pool)out of memory
A10G 24 GBGPU, cuDF (RMM pool, managed memory)1.271.4238.5Myes$0.0004

The single CPU thread is the cheapest way to rebuild a day (its work per event is about 178 ns), and it is the right tool for a live feed, where each message must be applied as it arrives. The GPU is the fastest way to rebuild many symbols or many days at once.

Rolling variance on every trade

Two bar charts for 11.7 million rolling 100-trade windows: share of windows not correctly rounded (exact 0%, PyTorch compiled float64 100%, cuDF rolling 99.5%, PyTorch two-pass 99.3%, polars 99.5%, pandas 99.8%) and worst relative error on a log scale (exact 0; PyTorch compiled 1.8 × 10³; cuDF 9.5 × 10⁻¹¹; two-pass 3.8 × 10⁻¹¹; polars 3.0 × 10⁻¹⁰; pandas 1.4 × 10⁻⁴).
Figure 2. Sample variance of the last 100 trade prices for every trade of every symbol, Nasdaq 28 November 2025, against the correctly rounded exact value.
Table 2. Sample variance of the last 100 trade prices (dollars²), every trade of every symbol with at least 100 trades: 11,711,053 windows. GPU: one A100; pandas and polars on the same machine's CPU. "Not correctly rounded" compares with the exact rational rounded once to float64. Run to run: whether two runs on the same GPU returned the same bits.
ImplementationSecondsNot correctly roundedWorst relative errorMedian relative error of the missesSame bits run to run
Riptide exact (integer sums, one division)0.00450%00yes
PyTorch float64, prefix sums, torch.compile0.0011100%1.8 × 10³1.9 × 10⁻⁴no
PyTorch float64, prefix sums0.003699.8%1.1 × 10⁴6.6 × 10⁻⁴no
cuDF float64, groupby rolling0.033699.5%9.5 × 10⁻¹¹2.3 × 10⁻¹³yes
PyTorch float64, two-pass per window0.040999.3%3.8 × 10⁻¹¹4.2 × 10⁻¹⁴yes
PyTorch float64, two-pass on integer ticks0.041258.0%7.9 × 10⁻¹³2.5 × 10⁻¹⁶yes
PyTorch float32, prefix sums, torch.compile0.0008100%1.9 × 10¹¹8.9 × 10⁴no
polars float64 (CPU)0.27099.5%3.0 × 10⁻¹⁰1.8 × 10⁻¹³yes
pandas float64 (CPU)1.3899.8%1.4 × 10⁻⁴6.2 × 10⁻¹¹yes

The PyTorch prefix-sum lane also returned different values on the A10G and the A100 for 1,242,285 windows. The exact path is the same prefix-sum idea done in integers: prices relative to each symbol's first trade, integer prefix sums of and , and per window, divided once.

VWAP per symbol per minute

Table 3. VWAP of every symbol in every minute with trades (785,755 groups), Nasdaq day, on the A100. PyTorch, cuDF and pandas/polars receive prices in dollars as float64, the usual form; "integer ticks" keeps the 4-decimal integer prices in float64 and divides by 10⁴ at the end.
ImplementationSecondsNot correctly roundedWorst relative errorSame bits run to runSame bits A10G vs A100
Riptide exact0.00610%0yesyes
PyTorch float64 (index_add)0.005343.8%1.2 × 10⁻¹⁴nono (106,931 differ)
PyTorch float64, torch.compile0.005043.8%1.2 × 10⁻¹⁴nono (150,342 differ)
PyTorch float320.005297.7%1.4 × 10⁻⁵nono
cuDF float640.021932.6%1.3 × 10⁻¹⁴nono (72,981 differ)
cuDF float64 on integer ticks0.021914.0%2.2 × 10⁻¹⁶yesyes
polars float64 (CPU)0.11121.6%4.4 × 10⁻¹⁶yesyes
pandas float64 (CPU)0.55921.6%4.4 × 10⁻¹⁶yesyes

The float64 VWAP errors are in the last bits; they matter for reconciliation and audit, where two runs of the same job should return the same number, not for a trading decision.

All-pairs lead–lag

Table 4. Cross-products of 1-second price changes (integer ticks) for every ordered pair of the 512 most-traded symbols at lags 0–60 s: 15,990,784 sums of about 27,000 products each, from 09:30 to the last trade (the half day's regular session closed at 13:00, so after-hours trading is included), Nasdaq day.
GPURiptide exact (int8 tensor cores)float64float32TF32float32 wrongTF32 wrong
A10G0.266 s1.84 s (exact)0.054 s0.042 s0.56%0.54%
A1000.226 s0.049 s (exact)0.048 s0.021 s0.54%11.9%

The exact results and the float64 results were identical on both GPUs; float32 and TF32 differed between them (59,098 and 1,894,281 entries).

Method

Book as integer deltas. Each side of each symbol's book is a polynumber in price: the coefficient at price is the number of shares resting there. Every message is an integer change to one coefficient: an add puts at the order's price; an execution or cancel removes its shares; a delete or replace removes what is left of the order, and a replace adds the new order. The book at time is the sum of every change with a timestamp at or before .

On the GPU, all at once. Orders (adds, and the orders replaces create) are sorted by order number; every later message finds its order by binary search. Replaces inherit the symbol and side of the order they replace, through chains of any length, by pointer jumping: each order points at its parent, and the pointers are squared until they stop changing (about of the longest chain rounds). What is left of an order when it is deleted or replaced is its shares minus the shares removed by its executions and cancels, one scatter-add. Each change is then keyed by (symbol, side, price) and its 5-minute bucket, sorted, and summed per key and bucket in chunks of 2²⁶ changes; a running sum over buckets gives each level's shares at every snapshot. Everything is 64-bit integer arithmetic.

Checksum. For every level with positive shares, a 64-bit mix of (symbol, side, price) and the shares; the sum of these modulo 2⁶⁴ over all levels. It does not depend on the order levels are visited, so the CPU and GPU compare directly.

CPU reconstructor. One pass over the messages in order, with open-addressing hash tables for live orders and for price levels (backward-shift deletion), sharded by symbol across threads; checksums taken at each snapshot time.

Features. VWAP: integer sums of price × shares and of shares per (symbol, minute), one division. Rolling variance: integer prefix sums of prices relative to each symbol's first trade and of their squares; per window, then one division (rounded through exact rational arithmetic when ; it never was). Lead–lag: price changes are split into three 7-bit limbs, the nine limb products run as int8 matrix products with 32-bit accumulation (exact: every sum stays below 2³¹), and the results are recombined in 64-bit integers; 64 random entries were checked against Python integers.

Prior work. The book-from-deltas view is the standard limit-order-book model; LOBSTER [1] reconstructs Nasdaq books from ITCH for research, and JAX-LOB [8] is an open GPU limit-order-book simulator that replays LOBSTER message data for reinforcement learning; we found no open GPU reconstructor for full-day ITCH replay of every symbol to compare with. Exact and reproducible summation in floating point is studied by Demmel and Nguyen [3] and Collange et al. [4]; splitting integers into limbs for integer matrix units follows Ozaki et al. [5].

Setup

  • Data. Nasdaq TotalView-ITCH 5.0 sample files published by Nasdaq at emi.nasdaq.com: S112825-v50 (Nasdaq, 28 November 2025, a half trading day) and 20200130.BX_ITCH_50 (Nasdaq BX, 30 January 2020). Nasdaq posts no licence for the sample files, and we have not confirmed terms with Nasdaq; this paper therefore reports aggregate statistics only (no prices, tickers or per-symbol values). Data: Nasdaq TotalView-ITCH sample files, courtesy of Nasdaq.
  • Machines (AWS us-east-1). One NVIDIA A100-SXM4-40GB of a p4d.24xlarge (spot), with 96 vCPU Intel Xeon Platinum 8275CL; one NVIDIA A10G 24 GB in a g5.xlarge with 4 vCPU AMD EPYC 7R32 and 16 GB RAM. NVIDIA driver 620.70.06.
  • Software. cuDF 26.10.02 (default RMM allocator; the A10G rerun also used an RMM pool, and an RMM pool over CUDA managed memory, with CuPy allocating from RMM), PyTorch 2.15.0+cu132 (torch.compile mode max-autotune with CUDA graphs for the rolling-variance prefix sums; max-autotune-no-cudagraphs for the VWAP lanes), pandas 3.0.6, polars 2.2.0, CuPy 14.2.0, NumPy 2.4.6, Python 3.12.3; C++ with gcc 13 at -O3 -march=native.
  • Timing. Best of three runs after a warm-up; GPU work synchronised before and after; compile time excluded.
  • Correctness. Books: 193 whole-book checksums, compared with the single-thread CPU reconstructor. Features: every value compared with the exact rational rounded once to float64.

Limitations and next steps

The limits of these results, each with its cause and, where one is planned, the next step.

  • Two GPUs and two days. Cause: the L40S and H100 had no capacity in our AWS region on the day, and our other regions have no GPU quota yet. Next step: rerun on H100 and B200 and on full trading days.
  • The full Nasdaq day did not fit the A10G machine. Cause: the Riptide GPU book needs the day's event columns (12.5 GB) in host and GPU memory, and the A10G box had 16 GB of host RAM. Next step: stream the day in time slices.
  • cuDF was not measured at its best settings on the A100. With cuDF's default allocator it ran out of memory on the BX day on the A10G and on the Nasdaq day on the A100; on the A10G, an RMM pool over managed memory let it finish the BX day (1.27 s, 6.4× slower than Riptide on the same GPU, same checksums), while a pool without managed memory still ran out. Cause: the join-based pipeline holds several full-size intermediate tables, and no A100 capacity was available for the managed-memory rerun. An earlier version of our cuDF pipeline also failed an internal consistency check on the A10G BX day (133 executions unmatched to orders), a bug in our code since fixed; the runs reported here pass it. Next step: the managed-memory rerun on an A100 for the Nasdaq day, and a purpose-built RAPIDS order-book implementation.
  • The CPU baseline is our own reconstructor. Cause: we found no open GPU or CPU reconstructor for full-day ITCH replay of every symbol to compare with; JAX-LOB [8] simulates books from LOBSTER data but is not a full-day ITCH replay. Next step: compare with a production feed handler with an evaluation partner.
  • For a single live feed the CPU is the right machine: 178 ns per event on one thread, with no batching delay. Cause: a GPU only pays off on many events at once.
  • Some float paths were faster than the exact path, with the errors above: PyTorch float64 VWAP 1.2×, torch.compile's prefix-sum variance 4.0×, and on the A100 float64 matrix products 4.6× on lead–lag; float32 and TF32 lead–lag were also faster on both GPUs (A10G 0.054 s and 0.042 s against 0.266 s). Cause: the A100's float64 tensor cores, and fewer bits moved by float32 and TF32.
  • Options and futures were not measured. Cause: the option-chain and futures sources we found need an account. Next step: Nasdaq's public options order-book sample (ITTO).
  • Per-symbol results are not published. Cause: Nasdaq posts no licence for the sample files. The raw outputs are kept with checksums for evaluation partners.

Reproduction notes

  • Data: download the two sample days from Nasdaq (emi.nasdaq.com/ITCH/): S112825-v50 and 20200130.BX_ITCH_50. Parse the ITCH 5.0 binary into columns (type, locate, timestamp, order reference, new reference for replaces, side, shares, price).
  • Check a reconstructor: apply every add, execution, cancel, delete and replace in order, and every 5 minutes from 04:00 to 20:00 take the order-independent checksum described in Method. Any correct reconstructor, CPU or GPU, must return the same 193 values as every implementation here.
  • Check a feature pipeline: compute VWAP per symbol-minute and the 100-trade rolling variance in integer ticks and shares, divide once, and compare with your float pipeline's values value by value; then run it twice and on a second GPU.

References

  1. R. Huang, T. Polak, "LOBSTER: Limit Order Book Reconstruction System" (2011), SSRN 1977207, doi:10.2139/ssrn.1977207.
  2. Nasdaq, "Nasdaq TotalView-ITCH 5.0" specification and sample data, https://emi.nasdaq.com/ITCH/.
  3. J. Demmel, H. D. Nguyen, "Fast reproducible floating-point summation", ARITH 21 (2013), doi:10.1109/ARITH.2013.9.
  4. S. Collange, D. Defour, S. Graillat, R. Iakymchuk, "Numerical reproducibility for the parallel reduction on multi- and many-core architectures", Parallel Computing 49, 83–97 (2015), doi:10.1016/j.parco.2015.09.001.
  5. K. Ozaki, T. Ogita, S. Oishi, S. M. Rump, "Error-free transformations of matrix multiplication by using fast routines of matrix multiplication and its applications", Numerical Algorithms 59, 95–118 (2012), doi:10.1007/s11075-011-9478-1.
  6. B. P. Welford, "Note on a method for calculating corrected sums of squares and products", Technometrics 4(3), 419–420 (1962), doi:10.1080/00401706.1962.10490022.
  7. cuDF, https://github.com/rapidsai/cudf; PyTorch, https://pytorch.org; pandas, https://pandas.pydata.org; polars, https://pola.rs; CuPy, https://cupy.dev.
  8. S. Y. K. Frey, K. Li, P. Nagy, S. Sapora, C. Lu, S. Zohren, J. Foerster, A. Calinescu, "JAX-LOB: A GPU-accelerated limit order book simulator to unlock large scale reinforcement learning for trading", 4th ACM International Conference on AI in Finance (ICAIF '23), 583–591 (2023), doi:10.1145/3604237.3626880.

Date and version

1 December 2026, version 1.

Working with Riptide

Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.