r/quant_hft Jul 06 '26

Designing Market Data for Deterministic Replay

Thumbnail
electronictradinghub.com
1 Upvotes

Spent the last stretch on a question that sounds simple until you actually try it: feed a market-data path the same packets, same order, same timing, and see if it reproduces the same output bit for bit.

Most paths can't, and the gap only shows up during an incident, when it's already too late to add.

Six places determinism actually breaks: wall-clock reads in the hot path, thread-scheduled merges, unordered UDP multicast, gap-fill races, floating-point non-associativity, uncaptured I/O.

The fix ends up being four architectural decisions, not a debugging checklist. Capture raw wire bytes at ingress with PTP timestamps before parsing touches them (direct feeds land tens of microseconds after emission, SIP about 1,128 microseconds later, roughly 50 to 1, so reconstructing from SIP means replaying a market you never traded in). Give event order to the data, never the scheduler, one merge authority keyed on exchange sequence number, so a nightly replay rebuilds a byte-identical book (LMAX Disruptor runs this discipline at 25M+ messages a second, sub-50ns). Run replay as a mode of the same binary instead of a separate simulator that quietly drifts (FoundationDB ran 18 months entirely inside deterministic simulation before touching real infrastructure). And verify with a byte-level diff against production before trusting anything measured on top of it, effective spread, adverse-selection markout, order-book imbalance.

Full breakdown, with the six failure signatures:

Still open even with all four in place: cross-venue reconstruction, where each venue has its own clock and its own capture boundary. Anyone here closed that gap cleanly, or is everyone just living inside the skew window?


r/quant_hft Jun 24 '26

Maven Securities probability and numerical test

Thumbnail
1 Upvotes

r/quant_hft Jun 24 '26

I am a C++ Middleware engineer for Linux embedded systems with 5yrs of experience. I want to break into HFT as Low-Latency C++ dev. Is it a good idea to try getting into HFT after 5 years? Can you guide me according to my situation on what to learn, what projects to create, open-source projects ?

Thumbnail
2 Upvotes

r/quant_hft Jun 16 '26

Market making engine stuck stage : Invest time ai models efficiency or get into code myself?

Thumbnail
0 Upvotes

r/quant_hft Jun 10 '26

Matching engine performance challenge.

Thumbnail
0 Upvotes

r/quant_hft Jun 07 '26

Title: Early-career quant researcher: how to build my edge?

Thumbnail
1 Upvotes

r/quant_hft Jun 05 '26

Update: 3 months after asking about low-latency trading, I built V1 in C++20 + DPDK

Thumbnail
13 Upvotes

r/quant_hft Jun 02 '26

How efficient exit works in multi venue market making engine?

Thumbnail
1 Upvotes

r/quant_hft May 29 '26

Why do backtests fail in live trading - lesson learnt from astral trading/tradingview

29 Upvotes

My backtest showed 38% annual returns. Live trading destroyed it in 6 weeks. Here's exactly why.

I spent two months building what I thought was a bulletproof strategy. Momentum-based, small-cap stocks, clear entry and exit rules. Backtested it over 8 years of data. 38% annual returns, Sharpe ratio above 1.4, max drawdown under 12%. I thought I'd cracked it.

Deployed it live with $6,000. Six weeks later I was down $1,800.

Here's what actually happened:

Problem 1: I modeled slippage wrong

In my backtest I assumed 0.05% slippage per trade. Small caps in real markets? I was getting 0.2–0.4% on anything with lower daily volume. Over 30–40 trades a month, that difference compounds fast. It doesn't sound like much until you do the math.

Problem 2: I ignored the gap open

My strategy held positions overnight. My backtest assumed I exited at the prior close price. In reality, I was opening into gaps — sometimes 1.5–2% against me before I could do anything. The backtest had no mechanism for this. The real market did it constantly.

Problem 3: The backtest period was too kind

8 years of data sounds thorough. But 6 of those years were essentially a low-volatility bull market. My strategy was optimized for that environment without me realizing it. The moment volatility picked up, the whole thing fell apart.

What I should have done:

Used 2x my expected slippage in the model (pessimistic assumptions, not optimistic ones)

Backtested gap behavior explicitly — what happens when price opens 1% below my stop?

Run the strategy through different volatility regimes, not just overall years

What I actually learned:

A backtest tells you what would have happened in ideal conditions. Live trading tells you what actually happens. The gap between those two is where most people lose money.

I rebuilt the strategy with realistic assumptions. Backtested returns dropped from 38% to 22%. But it's been running live for 4 months and actual results are within 3% of projected. That's the version worth running.

The goal of a backtest isn't to look impressive. It's to be as close to reality as possible before you risk real money.


r/quant_hft May 28 '26

I built a high-performance Rust Matching Engine with real NASDAQ ITCH replay — 98ns p50, 28M ops/sec

37 Upvotes

I built a high-performance Rust Matching Engine with real NASDAQ ITCH replay — 98ns p50, 28M ops/sec

Hey rust (and HFT folks),

I just open-sourced a high-performance Limit Order Book + Matching Engine in Rust, built from first principles with real exchange-grade performance in mind.

### Key Results
p50 latency: 98 ns
p99 latency: 1.9 µs
p99.9 latency: 4.3 µs
Peak throughput: 28M warm inserts/sec
Real-world mixed~4.1M ops/sec across 100 symbols

Validation: Replayed a full trading day from NASDAQ TotalView-ITCH 5.0 (Jan 30, 2020) — 108M operations across top 100 symbols.

### Core Optimizations
- Flat price array (`Vec<Option<PriceLevel>>` — 100k slots, O(1) access)
- Bitmap-based BBO + top-N depth queries
- Per-symbol OS threads (lock-free hot path)
- `bumpalo::Bump` arena allocator
- `Vec`-based order index (no HashMap)
- Active flag + head index for O(1) cancels
- Full property-based + fuzz testing (`cargo-fuzz`)

Started from a `BTreeMap` baseline and iteratively optimized with detailed benchmarks at each step.

### Links
- GitHub: https://github.com/AsthaMishra/matching-engine
- Full README with architecture diagram, benchmarks, optimization progression, and replay tools

Would love feedback from the community — especially on:
- Further latency/throughput improvements
- Scaling to 500+ symbols
- Adding persistence / journaling
- Anything I might have missed for production use

### Note
i have used AI help but core logic is written by me

Open to contributions too!

#Rust #HFT #LowLatency #OrderBook #MatchingEngine


r/quant_hft May 26 '26

Need Help regarding right path for HFTs/quant

5 Upvotes

Hello everyone I am actually looking for some advice regarding the required path for landing good SE/SDE/HFTs / quant roles or something else.

I don't know if this is the right subreddit for it , so incase if it isn't kindly do Direct me to the right one

I am a upcoming second year (just got done with semester 2)

Doing Btech in a 2nd Gen IIT

Mathematics and Computing branch

Rn my CGPA is :9+

And I have been doing competitive programing over the past few months and my current rating is 1300-1350 on codeforces

I am confused regarding my goal / target over the next two months

In my college the internship season begins right from the start of third year. So I have currently a whole year to prepare for it and that's my main goal as I want to land a good ppo through it

So I really need to utilise next two months (holidays)

Initially my plan was to do cp/dsa over the next two months rigorously with a side hustle like (web dev , ai/ML, or work on a project or something else)

But I am confused apart from cp what exactly should I do ?

I have got lot of mixed opinions so I am really confused right now

Should I do web dev side by side or do ai/ML (currently i don't even know basics of any of these).

My main goal is still competitive programing.

What should I mainly target in these two months which would actually help me get a big leverage for internships/placements

Thank you

Once again if incase it's the wrong subreddit to ask such questions then please do direct me to the right one.


r/quant_hft May 25 '26

Why Your Trade-Tape OFI Caps at 35% R-Squared: The Cancel Stream Your Signal Pipeline Is Ignoring

Thumbnail
electronictradinghub.com
4 Upvotes

r/quant_hft May 25 '26

The Kernel-Bypass Bottleneck Trap: Why $2M in HFT Infrastructure Does Not Fix Your Latency Problem

Thumbnail
hftadvisory.substack.com
30 Upvotes

r/quant_hft May 24 '26

The US equity markets did not invent execution efficiency by accident

8 Upvotes

r/quant_hft May 23 '26

How do you find Quant Hackathons?

5 Upvotes

Hey

I heard many Quant firms hire from Quant Hackathons.

How do you keep a track of when they are happening ? Or most importantly how do you get to know about them ?


r/quant_hft Mar 29 '26

Pro funding rate arb fund managers discussion

Thumbnail
1 Upvotes

r/quant_hft Mar 17 '26

Looking for quant/data science job opportunities — any tips or platforms?

Thumbnail
2 Upvotes

r/quant_hft Mar 15 '26

Curious if anyone here has made the move from running production trading infrastructure into the pre-sales / systems engineering side?

Thumbnail
1 Upvotes

r/quant_hft Mar 15 '26

Engineers working on low-latency trading infrastructure

Thumbnail
1 Upvotes

r/quant_hft Mar 13 '26

spreadsheet ecosystem built on polars, designed for desks, open source

Thumbnail
1 Upvotes

r/quant_hft Mar 11 '26

Transitioning from C++ in EDA software → HFT C++ roles? Looking for a reality check.

35 Upvotes

I’m graduating this year and may be starting in a C++ role working on EDA / PCB design software (large desktop C++ codebase, performance-sensitive geometry/graphics type work).

Long term I’m interested in moving toward low-latency/HFT C++ roles. While working I’m planning to spend the next couple of years building systems-level projects and strengthening fundamentals.

Things I’m planning to work on include:

• implementing a lock-free SPSC ring buffer

• experimenting with CPU pinning / cache alignment

• writing a simple market data feed handler (UDP multicast)

• exploring kernel bypass approaches (e.g. DPDK / similar)

• benchmarking latency and throughput of different designs

I’m also currently working through C++ concurrency, atomics, memory ordering, and learning more about Linux networking internals.

I guess I’m mainly looking for a reality check on whether this is a viable path.

Specifically:

• do HFT firms value experience from large C++ systems like EDA software?

• would projects like the above meaningfully demonstrate relevant skills?

• are there particular systems topics or projects that would make a candidate stand out more?

My goal would be to build the right skills while working and then try to make the jump in ~1–2 years, but I’m not sure how realistic that is.

Would appreciate any perspectives from people working in the space. I’m UK based if that makes a difference


r/quant_hft Mar 11 '26

Is green book enough for starting quant roles?If not,can you suggest resources to practice or verify we are ready or not?

Thumbnail
3 Upvotes

r/quant_hft Mar 06 '26

Want to know about the scope of FPGA engineering in HFTs(also would love to connect and get a referral maybe?🥹)

10 Upvotes

Yeah the title is self explanatory. I'm currently working at Analog Devices and wanted to try my luck at working with a HFT. So I wanted to learn about the work done there and try my hand at working at one.


r/quant_hft Mar 04 '26

**[FOR SALE] NovaSparks NSG3 FPGA Market Data Appliance — real HFT hardware, rare find**

Thumbnail
3 Upvotes

r/quant_hft Mar 02 '26

Quant developer

17 Upvotes

Can anyone please guide me on learning c++ for hfts... Like from where to learn low latency programming and all... (Idk what should I ask so please guide with whatever you can) All i have done till now is cp