Deconstructing quant-research-ig: How a Dedicated Quant Builder bridged C++ HFT, Statistical Rigor, and Agentic AI on the IG API
Share
In the world of retail and independent quantitative finance, there is a massive chasm between toy projects and institutional-grade architectures. On one side of the canyon, you have thousands of GitHub repositories featuring basic moving-average crossovers in Jupyter notebooks, backtested on Yahoo Finance daily candles with zero regard for look-ahead bias, transaction costs, or market microstructure. On the other side, you have proprietary trading desks operating black-box engines written in bare-metal C++, consuming direct exchange feeds, and subjecting every tiny alpha signal to a brutal battery of statistical falsification tests.
Every so often, however, an open-source portfolio project surfaces that attempts to bridge this exact gap.
Enter quant-research-ig by developer koatedevopskpai. Designed as a comprehensive, systematic quantitative trading platform built on top of the IG API, this repository is a love letter to modern quantitative engineering. For followers of Bryan Downing (the founder of QuantLabsNet.com / HFTCode.com) and Quant Beckman, this repository is particularly exciting: it directly credits, synthesizes, and implements their core methodologies into a cohesive, multi-tiered software stack.
Spanning data engineering, classical derivatives pricing, microsecond-conscious C++ order book mechanics, machine learning regime detection, and LangGraph-powered autonomous agents, quant-research-ig is a fascinating blueprint of what the modern quantitative developer’s skill set looks like.
In this deep dive, we are going to unpack the architecture, the intellectual influences, the five core functional modules, and the refreshing engineering honesty that makes quant-research-ig such a standout reference project.
1. The Vision: A Full-Stack Quant Portfolio
Modern quantitative finance is no longer siloed into neat little boxes where a "math person" writes a formula on a whiteboard and throws it over the wall to a software engineer. Today’s quant researcher is expected to be a polymath capable of navigating:
- Data Engineering: Ingesting, normalizing, and storing real-time streaming tick data without dropping packets.
- Derivative Pricing & Econometrics: Understanding the foundational mathematics of volatility, options Greeks, and stochastic calculus.
- Market Microstructure & Low-Latency Engineering: Knowing how limit order books actually clear, how informed traders leave footprints in order flow, and how to drop down into C++ when Python’s Global Interpreter Lock (GIL) becomes a bottleneck.
- Statistical Validation: Cultivating a ruthless, falsification-first mindset to ensure that backtested profits aren't just the result of data mining and overfitting.
- Machine Learning & Agentic Systems: Leveraging non-linear models for regime classification and utilizing Large Language Models (LLMs) as state-machine orchestrators with strict audit trails.
The creator of quant-research-ig explicitly designed the repository to demonstrate mastery across all six of these domains. Rather than building five disconnected mini-projects, they unified them around a single commercial broker gateway—the IG API—and organized the system along an 8-phase implementation roadmap (documented in the repo's STRATEGY.md and docs/ Architecture Decision Records).
2. Standing on the Shoulders of Mentors: Downing and Beckman
What gives quant-research-ig its philosophical soul is that it doesn’t try to reinvent quantitative theory in a vacuum. Instead, the developer grounds the entire platform in the contrasting yet complementary philosophies of two prominent educators in the space: Bryan Downing and Quant Beckman.
The Speed & Microstructure Pillar: Bryan Downing
If you follow Bryan Downing’s work across QuantLabsNet and HFTCode.com, you know his obsession with practical, high-speed execution, C++ architecture, and modern AI integrations in high-frequency trading.
In quant-research-ig, Downing’s architectural blueprint—specifically drawn from his 2025 works "Deconstructing an Advanced Ether High Frequency Trading Bot: A C++ Breakdown" and "Unlocking AI High Frequency Trading C++ and the Future of Quantitative Finance"—serves as the direct foundation for the platform's hft-engine module.
Rather than treating the market as a simple series of closing prices, Downing’s methodology treats the market as a continuous, adversarial game of order flow. Following this blueprint, quant-research-ig incorporates:
- Hidden Markov Models (HMM) to classify the market into distinct volatility regimes (low, medium, and high) in real time.
- A Bayesian Order Flow Toxicity Detector utilizing Hawkes processes (self-exciting point processes) to sniff out "informed trading" and adverse selection before it runs over resting limit orders.
- Reinforcement Learning (RL) loops designed to dynamically adapt the HMM transition matrix based on the feedback of profitable versus losing trades.
- A Multi-Layered Exit Strategy that doesn't just wait for a static stop-loss or take-profit, but actively pulls risk off the table when order flow toxicity spikes or time-decay thresholds are breached.
The Statistical Rigor Pillar: Quant Beckman
Having a fast C++ engine and clever microstructure signals means nothing if your underlying strategy is statistically spurious. This is where the second mentor enters the picture.
Drawing from Quant Beckman’s 2025 book "Quantitative Research Foundations" and his "Trading the Breaking" Substack, quant-research-ig adopts Beckman’s Research → Know → Do → Get cycle across its quant-methods, ml-for-finance, and agentic-finance modules.
Beckman advocates for a falsification-first approach. In retail trading, people run backtests to prove a strategy works. In institutional quant research, you run tests to try and break the strategy; only if you fail to prove it is garbage do you cautiously deploy capital. To enforce this discipline, quant-research-ig integrates Beckman’s "falsification gauntlet":
- The Monkey Test: A Monte Carlo permutation framework that pits your strategy against thousands of randomized signal entries to see if your edge is simply riding macro drift.
- Probabilistic Sharpe Ratio (PSR): Adjusting the classic Sharpe ratio to account for the skew and kurtosis (fat tails) of non-normal financial return distributions.
- Deflated Sharpe Ratio (DSR): Correcting for multiple-testing bias—because if you test 1,000 parameter combinations, finding one with a Sharpe of 2.5 is a statistical certainty, not an alpha discovery.
- Combinatorial Purged Cross-Validation (CPCV): A technique popularized by Marcos López de Prado and emphasized by Beckman to eliminate time-series leakage and serial correlation during ML training.
- Walk-Forward Analysis (WFA): Continuously testing how parameters drift and degrade across shifting market regimes.
By marrying Downing’s low-latency C++ microstructure mechanics with Beckman’s statistical gatekeeping, quant-research-ig achieves a rare conceptual balance: speed governed by skepticism.
3. A Tour of the 5 Core Modules
Let’s pop the hood and walk through the directory tree of quant-research-ig. The repository is cleanly modularized into five distinct functional packages, each representing a specific phase of the platform's operational pipeline.
quant-research-ig/
├── market-data/ # Phase 1: IG API client + Lightstreamer streaming + PostgreSQL
├── quant-methods/ # Phase 2a: Black-Scholes, trees, Monte Carlo, GARCH, portfolio opt.
├── hft-engine/ # Phase 2b: C++ Order book, microstructure analytics, execution sim.
├── ml-for-finance/ # Phase 3a: HMM regimes, XGBoost, LSTM, sentiment-augmented models
├── agentic-finance/ # Phase 5: Autonomous LangGraph agents, LLM reasoning + audit trailsModule 1: market-data (Phase 1) — Ingestion & Storage
Every systematic platform lives or dies by its data plumbing. The market-data module interfaces directly with the IG API.
Notice the architectural maturity in the authentication layer: IG deprecated its older v2 CST/XST token flow, so the developer built the client around IG API v3 using OAuth 2.0 Bearer tokens. For real-time tick ingestion, polling REST endpoints is a non-starter. Instead, the module implements IG’s Lightstreamer push protocol, subscribing to Level 1 (top of book) and Level 2 (market depth) streaming updates with built-in reconnection logic.
Once the ticks arrive, where do they go? Rather than dumping raw CSVs onto a hard drive or prematurely paying for an expensive enterprise time-series database, the developer chose PostgreSQL paired with BRIN (Block Range Index) indexes. Why BRIN? Because tick data is naturally appended in chronological order. Standard B-Tree indexes balloon in size and slow down write performance on massive time-series tables. A BRIN index stores only the minimum and maximum timestamps across large physical blocks of disk pages—delivering lightning-fast timestamp range queries and allowing standard SQL JOINs across instruments with minimal storage overhead.
Module 2: quant-methods (Phase 2a) — Classical Financial Engineering
Before jumping into deep learning or HFT, a quant platform needs a bedrock of mathematical finance. Written in a Python-first paradigm (numpy, scipy, pandas) for rapid research iteration, quant-methods houses the classical toolkit:
- Derivative Pricing: Analytical Black-Scholes-Merton pricing alongside full Greeks calculation (Delta, Gamma, Vega, Theta, Rho) for sensitivity analysis, plus Binomial Trees for American-style exercise profiles.
- Stochastic Simulation: Monte Carlo engines for path-dependent payoff modeling and risk scenario generation.
- Econometric Volatility: GARCH (Generalized Autoregressive Conditional Heteroskedasticity) models to forecast volatility clustering.
- Portfolio Construction: Mean-variance and modern portfolio optimization routines to translate raw asset signals into risk-weighted capital allocations.
Module 3: hft-engine (Phase 2b) — The C++ / Python Hybrid Hot-Path
For fans of HFTCode.com, the hft-engine directory is the crown jewel of the repository. Python is fantastic for orchestrating workflows and running vector math, but when you are reconstructing a Level 2 limit order book tick-by-tick and calculating order flow toxicity in real time, Python object overhead becomes fatal. To solve this, quant-research-ig uses a hybrid architecture: C++ on the hot path, exposed to Python via pybind11.
Inside this module, you will find:
- C++ Order Book & Feed Handler: Lock-free data structures in C++ handle high-throughput order insertions, cancellations, modifications, and trade matches, exposing a clean memory interface back to the Python orchestration layer.
- Microstructure Analyser & Toxicity Detector: Implementing Downing’s Hawkes-process-inspired Bayesian order flow toxicity metrics. When aggressive market orders begin clustering abnormally on one side of the book, the toxicity detector flags the surge in adverse selection risk.
-
Simulation Suite: Because testing HFT logic on live broker connections is perilous and expensive, the developer built an entire synthetic testing environment inside
hft-engine. This includes an Execution Simulator, a Colocation Simulator, a Latency Monitor, and a Market Simulation Feed. This allows a researcher to model how network jitter, physical distance from the matching engine, and queue position impact fill probabilities.
Module 4: ml-for-finance (Phase 3a) — Regimes, Trees, and Sequences
Financial time series are notoriously non-stationary; a model trained in a calm, low-volatility bull market will blow up during a liquidity crisis. The ml-for-finance module attacks this problem by blending regime awareness with diverse model architectures:
- Hidden Markov Models (HMM): Unsupervised learning models that infer hidden market states (e.g., low/med/high volatility regimes) so downstream strategies know when to press their edge and when to flatten out.
- XGBoost Forecasting: Gradient-boosted decision trees engineered for tabular microstructure and technical features—still the reigning champion of structured financial data competitions.
- LSTM Networks: Long Short-Term Memory recurrent neural networks designed to capture complex temporal dependencies across sequential price and volume bars.
- Sentiment-Augmented Models: Pipelines that blend quantitative price action with natural language sentiment signals to capture narrative shifts before they fully price into the curve.
All of these models are designed to be piped through Beckman’s CPCV and Walk-Forward validation layers to strip out overfitted noise.
Module 5: agentic-finance (Phase 5) — Autonomous LangGraph Trading Agents
If C++ order books represent the battle-tested present of quant finance, the agentic-finance module represents its rapidly emerging frontier.
Many developers today are slapping ChatGPT wrappers onto trading scripts with disastrous, hallucination-prone results. quant-research-ig takes a much more disciplined, institutional approach to AI agents by utilizing LangGraph paired with OpenAI’s gpt-4o-mini.
Why LangGraph? Because trading workflows require deterministic state machines, cyclic graph execution, and strict boundaries—not free-wheeling conversational chatbots. The agentic-finance module breaks the trading desk down into specialized, autonomous sub-agents:
- Research Agent: Synthesizes quantitative metrics and generates structured LLM research reports.
- Risk Agent: Enforces portfolio constraints, drawdown limits, and toxicity thresholds.
- Portfolio Agent: Determines optimal sizing across correlated instruments.
- Execution Agent: Interfaces with the execution layer to route orders cleanly.
Crucially, these agents communicate over an internal MessageBus and log every single state transition and reasoning step into an immutable AuditTrail. In regulated financial environments (and even for solo systematic traders who want to sleep at night), auditable reasoning is non-negotiable. You need to know why an agent decided to cut exposure at 2:14 AM.
To top it off, the developer wrapped agentic-finance in a full observability stack: a FastAPI REST + WebSocket API for programmatic control, an interactive Streamlit Dashboard for visual monitoring, and a slick Terminal Dashboard built with Python’s rich library for low-overhead command-line telemetry.
4. A Masterclass in Engineering Honesty
There is one more aspect of the quant-research-ig repository that deserves massive praise, and it’s right at the very top of the README.md.
In the quant open-source community, it is overwhelmingly common to see developers inflate their claims. People regularly post fake 99% test coverage badges, boast about "10,000x speedups" without benchmarks, or imply that their code is currently printing millions of dollars in live production.
The author of quant-research-ig does the exact opposite. The repository recently underwent what the author calls a rigorous "claim-sweep" and verification review. Right in the introduction and architecture tables, the documentation states with refreshing candor:
- "Historical saved coverage badge assets remain under
.github/badges/; their values are not a fresh coverage measurement. See the claim-sweep evidence for attempted test commands and their exact results." - "The current full-suite attempt fails during collection; no passing total or coverage is asserted by this wording sweep... No live market, provider or trading-execution run was performed for this review."
- In the Architecture Highlights table, under PostgreSQL BRIN indexes: "SQL JOINs across instruments and indexing for timestamp queries; no throughput comparison established here."
- Under Lightstreamer push protocol: "Push updates and reconnect support; no latency comparison reproduced here."
Why is this so important?
Because this is what real quantitative research looks like. Remember Quant Beckman’s core tenet: falsification first. A true scientist does not hide broken test collections or fabricate latency benchmarks to look cool on GitHub. By maintaining an evidence/ directory in the root of the repo and explicitly documenting what has been verified, what is currently blocked, and what metrics have not yet been formally benchmarked, koatedevopskpai demonstrates the highest level of engineering integrity.
If an institutional hiring manager or senior quant developer looks at a portfolio repo, they aren't expecting a solo developer to have a live co-located server at Equinix LD4 running 24/7. What they are looking for is architectural vision, clean separation of concerns, mathematical literacy, C++/Python interoperability, and the intellectual honesty to separate verified facts from unverified assumptions. On that scorecard, quant-research-ig hits it out of the park.
5. Getting Hands-On with the Codebase
For fellow quants, C++ tinkerers, and fans of Downing and Beckman who want to explore the implementation details, the repository is MIT-licensed and structured as installable Python sub-packages.
Getting the environment spun up to inspect the hft-engine and agentic-finance modules is straightforward:
# 1. Clone the repository
git clone https://github.com/koatedevopskpai/quant-research-ig.git
cd quant-research-ig
# 2. Configure credentials
cp .env.template .env
# Populate .env with your IG API credentials (from labs.ig.com) and OpenAI keys
# 3. Install the core sub-modules in editable mode
pip install -e agentic-finance/
pip install -e hft-engine/
# 4. Run the module test suites
pytest agentic-finance/tests/ hft-engine/tests/Once inside, make sure to read STRATEGY.md in the root directory, which lays out the entire 8-phase roadmap from initial project housekeeping to full autonomous agent deployment, as well as the docs/ folder, which records the Architecture Decision Records (ADRs) for each module.
Final Thoughts: The Future of the Independent Quant
Projects like quant-research-ig prove that the barrier to entry for sophisticated quantitative systems design has fundamentally shifted. Ten years ago, putting together a Lightstreamer tick ingestion pipeline, a C++ limit order book with Hawkes process toxicity detection, a Combinatorial Purged Cross-Validation ML pipeline, and a multi-agent decision hub would have required a team of ten engineers at a mid-sized hedge fund.
Today, equipped with open-source bindings like pybind11, orchestration frameworks like LangGraph, broker APIs like IG, and the publicly shared wisdom of mentors like Bryan Downing (HFTCode / QuantLabsNet) and Quant Beckman, a single dedicated developer can architect the entire stack from scratch.
Whether you are looking for inspiration on how to structure your own systematic trading platform, curious about how to bind C++ microstructure engines into Python, or exploring how to safely constrain LLMs with state machines and audit trails in finance, koatedevopskpai/quant-research-ig is well worth a star, a fork, and a deep weekend read.