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

Results
Order books
| Day (events) | Machine | Implementation | Seconds | With copy | Events per second | Same checksums | Cost of the day |
|---|---|---|---|---|---|---|---|
| Nasdaq, 28 Nov 2025 (347.1M) | Xeon 8275CL | CPU, 1 thread | 61.9 | 5.6M | yes | $0.0007 | |
| Xeon 8275CL | CPU, 8 threads | 13.1 | 26.4M | yes | $0.0012 | ||
| Xeon 8275CL | CPU, 64 threads | 6.50 | 53.4M | yes | $0.0049 | ||
| A100 40 GB | GPU, Riptide | 0.634 | 3.07 | 547M | yes | $0.0018 | |
| A100 40 GB | GPU, cuDF (default allocator) | out of memory | |||||
| EPYC 7R32 (4 vCPU) | CPU, 1 / 4 threads | 62.3 / 23.7 | 5.6M / 14.7M | yes | $0.0007 / $0.0010 | ||
| Nasdaq BX, 30 Jan 2020 (48.9M) | A100 40 GB | GPU, Riptide | 0.090 | 0.446 | 545M | yes | $0.0003 |
| A100 40 GB | GPU, cuDF (default allocator) | 1.92 | 2.32 | 25.5M | yes | $0.0014 | |
| Xeon 8275CL | CPU, 1 / 64 threads | 4.93 / 1.83 | 9.9M / 26.7M | yes | $0.0001 / $0.0014 | ||
| A10G 24 GB | GPU, Riptide | 0.200 | 0.488 | 244M | yes | $0.0001 | |
| A10G 24 GB | GPU, cuDF (default allocator) | out of memory | |||||
| A10G 24 GB | GPU, cuDF (RMM pool) | out of memory | |||||
| A10G 24 GB | GPU, cuDF (RMM pool, managed memory) | 1.27 | 1.42 | 38.5M | yes | $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

| Implementation | Seconds | Not correctly rounded | Worst relative error | Median relative error of the misses | Same bits run to run |
|---|---|---|---|---|---|
| Riptide exact (integer sums, one division) | 0.0045 | 0% | 0 | 0 | yes |
| PyTorch float64, prefix sums, torch.compile | 0.0011 | 100% | 1.8 × 10³ | 1.9 × 10⁻⁴ | no |
| PyTorch float64, prefix sums | 0.0036 | 99.8% | 1.1 × 10⁴ | 6.6 × 10⁻⁴ | no |
| cuDF float64, groupby rolling | 0.0336 | 99.5% | 9.5 × 10⁻¹¹ | 2.3 × 10⁻¹³ | yes |
| PyTorch float64, two-pass per window | 0.0409 | 99.3% | 3.8 × 10⁻¹¹ | 4.2 × 10⁻¹⁴ | yes |
| PyTorch float64, two-pass on integer ticks | 0.0412 | 58.0% | 7.9 × 10⁻¹³ | 2.5 × 10⁻¹⁶ | yes |
| PyTorch float32, prefix sums, torch.compile | 0.0008 | 100% | 1.9 × 10¹¹ | 8.9 × 10⁴ | no |
| polars float64 (CPU) | 0.270 | 99.5% | 3.0 × 10⁻¹⁰ | 1.8 × 10⁻¹³ | yes |
| pandas float64 (CPU) | 1.38 | 99.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
| Implementation | Seconds | Not correctly rounded | Worst relative error | Same bits run to run | Same bits A10G vs A100 |
|---|---|---|---|---|---|
| Riptide exact | 0.0061 | 0% | 0 | yes | yes |
| PyTorch float64 (index_add) | 0.0053 | 43.8% | 1.2 × 10⁻¹⁴ | no | no (106,931 differ) |
| PyTorch float64, torch.compile | 0.0050 | 43.8% | 1.2 × 10⁻¹⁴ | no | no (150,342 differ) |
| PyTorch float32 | 0.0052 | 97.7% | 1.4 × 10⁻⁵ | no | no |
| cuDF float64 | 0.0219 | 32.6% | 1.3 × 10⁻¹⁴ | no | no (72,981 differ) |
| cuDF float64 on integer ticks | 0.0219 | 14.0% | 2.2 × 10⁻¹⁶ | yes | yes |
| polars float64 (CPU) | 0.111 | 21.6% | 4.4 × 10⁻¹⁶ | yes | yes |
| pandas float64 (CPU) | 0.559 | 21.6% | 4.4 × 10⁻¹⁶ | yes | yes |
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
| GPU | Riptide exact (int8 tensor cores) | float64 | float32 | TF32 | float32 wrong | TF32 wrong |
|---|---|---|---|---|---|---|
| A10G | 0.266 s | 1.84 s (exact) | 0.054 s | 0.042 s | 0.56% | 0.54% |
| A100 | 0.226 s | 0.049 s (exact) | 0.048 s | 0.021 s | 0.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) and20200130.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-v50and20200130.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
- R. Huang, T. Polak, "LOBSTER: Limit Order Book Reconstruction System" (2011), SSRN 1977207, doi:10.2139/ssrn.1977207.
- Nasdaq, "Nasdaq TotalView-ITCH 5.0" specification and sample data, https://emi.nasdaq.com/ITCH/.
- J. Demmel, H. D. Nguyen, "Fast reproducible floating-point summation", ARITH 21 (2013), doi:10.1109/ARITH.2013.9.
- 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.
- 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.
- 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.
- cuDF, https://github.com/rapidsai/cudf; PyTorch, https://pytorch.org; pandas, https://pandas.pydata.org; polars, https://pola.rs; CuPy, https://cupy.dev.
- 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.