esc

Search pages, or explore a browser-only workspace. Try help.

work / research platforms

AI quant research system

Three parts: a vault that keeps book notes and measured results as cited, version-controlled notes; a harness whose gates decide when work is done; and AI coding agents that read, build and review.

the engineering

AI agents can turn a quant textbook into code quickly, but an agent saying "done" is not evidence. Across hundreds of tasks, one unchecked claim compounds.

  • Every claim is paraphrased and cited, never copied.
  • A task is done only when its gate command exits 0, not when it looks done.
  • Measured results are kept as cited, version-controlled notes.

The result, computed

BUILD-COMPUTED by the Lab's own code when this page was built · a SYNTHETIC five-task chain, not the build's real tasks

  1. 01Read the chaptergate: notes cite every page they usedone
  2. 02Extract claimsgate: each claim paraphrased and citeddone
  3. 03Write a test per claimgate: tests collected, none emptydone
  4. 04Implement the functiongate: pytest -q exits 0evidence: pytest -q exited 1: a planted bug in the functionpending · ready
  5. 05Reviewgate: a fresh reviewer finds nothingpending · blocked
  1. gates 1, 2 and 3 pass: those tasks are done
  2. task 4's gate fails: dated evidence is recorded and the task returns to pending
  3. task 4 stays pending: a claim is not evidence, run its gate
  4. task 5 is not ready: its dependencies are not done
Try it liverun the gates yourself, plant the bug, then claim the task is done

What it shows

A planted bug sends its task back to pending with dated evidence; claiming it is done changes nothing, and the next task cannot start. The real build links library implementations to cited textbook claims and reproducible checks in a versioned vault.

The tradeoff

chose
a gate per task: a command that can fail is the only way to mark work done
over
trusting an agent's report, or a reviewer reading its summary
because
an exit code is evidence and a confident summary is not, and agents write confident summaries
cost
every task needs its check written before the work, and a wrong check has to be fixed openly, never routed around

What I built

The orchestration, the gated work graph, the vault and the agent harness, designed and written by me; the AI agents implemented the tasks under those gates.

The centrepiece build

Its centrepiece is a Python quant-research library built from López de Prado’s Advances in Financial Machine Learning, using AI coding agents. The versioned vault links implementations to paraphrased, cited source claims and reproducible tests. The contribution is the reviewable connection from a claim to code and evidence, rather than an agent’s assertion that it has finished.

The repository’s dated build record lists 1,805 claims and 1,417 with all named tests passing at that revision. These are historical inventory counts, not a measure of research quality. The evidence record explains coverage and limits.

  1. 01One bookread by agents
  2. 02Claimsparaphrased, cited
  3. 03Gated tasksexit 0 or not done
  4. 04Librarytested Python
a task is done when its gate command exits 0, not when it looks done

The vault in this build keeps book notes and measured results as cited, version-controlled notes.

Point-in-time research platform

Designer and sole authorPython · C++20 · pybind11 · pandas · pytest · hypothesis

2.3×
Python API-call speed vs Python batch, including conversion; preloaded synthetic 100k-message / 64-query fixture; loading and answer checking excluded

Code: the point-in-time research platform (platform/)

The problem

A backtest is only as honest as its inputs and its process. Data that was not yet known at the time (look-aheadlook-ahead biasUsing information in a backtest that was not yet available when the decision was made. It makes results look better than anything that could have traded.), a rule tweaked after seeing the test, or an AI assistant that grades its own idea can each make a weak strategy look strong. I wanted a research loop where code, not discretion, controls what data a study sees, when its rule is fixed, and who writes the numbers. In that loop, an LLM-proposed idea has to beat simple controls.

What I built

  • A point-in-time data layerpoint-in-timeReading data exactly as it was known at a given moment, so later corrections and revisions stay invisible.. Every read is as-of: a study at time t cannot see anything stamped after t.
  • Pre-registered studiespre-registeredThe test, the data split and the pass rule are fixed and recorded before the study runs, so none of them can be tuned to the result.. Each hypothesis becomes a method card, which is frozen and hashed together with its data before it runs. Any later tweak counts as a new trial.
  • A bounded AI role. An LLM may draft hypotheses (without seeing prices) and a critic may object through a fixed schema. Neither can promote a result. Only the pre-registered rule decides.
  • A C++20 order-book replay engine that reconstructs the book at any time T. It replaced the Python batch path, and parity is checked byte for byte.
  • Two packages built on the same contract: the Market-Making Lab and the Factor Lab.

Result

On a preloaded synthetic 100k-message, 64-query fixture, the native replay’s Python API call is 2.3× faster than the optimized Python batch path, including conversion into C++ and back. A C++ caller is 25× faster than that Python baseline on the same fixture. Workload loading and answer checking are excluded from both timings. Output matches byte for byte; the native replay had 47 tests at the recorded revision.

How it works

  1. 01ProposeLLM sees no prices
  2. 02Validateschema, duplicates
  3. 03Freezehashed method card
  4. 04Testtest data sealed
  5. 05Gaterule decides
the critic can only object; the frozen rule decides
  • The critic cannot promote. A broken or adversarial critic can block a result but never pass one. The design accepts false negatives to rule out false positives.
  • The test data is sealed in code until the gate, so a card that fails earlier never gets a test number to be tempted by.
  • The order book is a sorted vector, not a hash map, because real books are shallow. Prices and sizes are integers, so parity with Python needs no tolerance.
  • The native path is opt-in, because it accepts strictly less input than Python (it refuses fractional and NaN timestamps).

designed and verified by Oscar, implemented with AI coding agents (Claude Code, Codex)

Limits

  • The archived replay benchmark is synthetic: one instrument and a shallow book. Neither ratio measures whole-platform speed. When called from Python, most of the time goes to preparation and crossing the binding.
  • No model has run the full loop yet: the LLM steps so far replay hand-written responses, so the loop is tested but the AI arm is not yet measured.
  • Execution is idealized (flat cost, no slippage, borrow or funding), and the universe is a single market.

Factor Lab

Designer and sole authorPython · convex optimization

Package: platform/packages/factor

The problem

Factor research fails quietly in three places: using prices before they were available, choosing a factor after peeking at the test window, and building portfolios that ignore turnover and limits. The Factor Lab rules out each of those mistakes by construction, not by discipline.

What I built

  • Momentum vs reversal on lagged prices, scored by Spearman rank ICrank ICRank information coefficient: the Spearman correlation between how a signal ranks assets today and how those assets return tomorrow. on fixed train, validation and test dates.
  • Selection on validation only. Test labels never enter selection, and only the chosen factor is scored, once, on the held-out test.
  • Portfolio construction as a convex optimization: weights under risk and position limits with a turnover cost, checked against hand-solved cases.
  • Append-only, hashed trials. Failed runs are kept, and any trial can be verified and recomputed later.

Result

On synthetic data: the optimizer is checked against hand-solved cases, and every trial can be recomputed from its hashes.

How it works

  1. 01Price CSVexplicit mapping
  2. 02Preparepoint-in-time panel
  3. 03Scorerank IC, lagged
  4. 04Selectvalidation only
  5. 05Optimizelimits, turnover
availability clocks are supplied, or an assumed delay is declared
  • No guessing of timestamps or columns. Unknown or conflicting rows are refused.
  • The report states its clock: whether availability times were supplied or an assumed delay was declared.

designed and verified by Oscar, implemented with AI coding agents (Claude Code, Codex)

Limits

  • Synthetic data, with no corporate-action, calendar or survivorship corrections.
  • Execution is idealized, and no significance claims are made.

Market-Making Lab

Designer and sole authorPython · exact decimals

Package: platform/packages/imc-sim

The problem

A market-making strategy that looks profitable in a naive simulator often is not. The simulator fills every quote, ignores where the order sits in the queue, and values inventory at prices that came later. After IMC Prosperity 4 I wanted tooling that reviews a quoting policy the way a risk desk would. It contains none of the team’s competition code.

What I built

  • An inventory-aware quoting policymarket makingContinuously quoting a price to buy (the bid) and to sell (the ask), earning the spread while managing the inventory that builds up.: the reservation price shifts against the position the book is carrying.
  • A fill simulator with a declared queue position, partial fills and cancel delays, run across synthetic scenarios.
  • A causal analyzer for saved runs that reports cash, fees, inventory-limit breaches and fill markouts.

Result

Across synthetic scenarios, fill quality is measured with as-of markoutsmarkoutsJudging each fill by how the price moved after it, using only prices that had been observed at the time.: each fill is valued only against prices already observed when it happened, and the forward markout is computed separately afterwards.

How it works

  1. 01Quote policyinventory-adjusted
  2. 02Fill simulatorqueue, cancel delay
  3. 03Log importpinned format
  4. 04Analyzercash, inventory, markouts
  5. 05ReportHTML, JSON, hashes
valuations only use marks already observed
  • Money is exact decimals, never binary floats.
  • Missing fees or identities are never guessed. Ambiguous logs are refused.
  • Every run records hashes of its inputs and of the installed code, and never overwrites an earlier output.

designed and verified by Oscar, implemented with AI coding agents (Claude Code, Codex)

Limits

  • Scenarios are synthetic, and only one pinned community log format is supported.
  • Inputs are capped in size, and sampled reports do not preserve extremes.

Agent harness

Designer and sole authorPython · SQLite full-text search · Model Context Protocol

Repository: agent-harness

The problem

Every AI coding tool keeps its own instruction file. None of them share memory, and they forget between sessions, so they repeat the same mistakes. And a tool running with broad permissions can execute a destructive command.

What I built

  • One rulebook, translated per tool, so the tools cannot drift apart. It stays short because it is paid for in every request.
  • Shared memory and retrieval over MCPMCPModel Context Protocol: an open standard for connecting AI tools to external tools and data., including search over past session transcripts.
  • A command guard for Claude Code that parses each shell command and fails closed.
  • A keep rule: features that showed no measured gain ship off by default.

How it works

  1. 01One rulebooksingle source
  2. 02Tool adaptersown format, backups
  3. 03MCP servermemory, retrieval
  4. 04Command guardfails closed
installs with the standard library alone, so it runs wherever the tools run

Why fail closed: the guard blocks any command it cannot parse. A false block costs the user one question. A missed delete of the home directory cannot be undone.

designed and verified by Oscar, implemented with AI coding agents (Claude Code, Codex)

Limits

  • The guard is a seat belt, not a sandbox, and has known gaps.
  • The evaluation was small and ran on a private corpus. Only some of the supported tools were measured.

Quant-system blueprint

Designer; implemented with AI coding agents under my design and reviewPython · typed Protocols · conformance tests

16 of 20
experiments, each with a control arm, support their rule; the other four are reported
20
deliberately broken implementations, each caught by the conformance suite

Repository: crypto-desk-blueprintDemo: the blueprint and three of its experiments

An asset-agnostic architecture for a quantitative research and trading system, for a person or an AI agent. The repository’s current worked example uses crypto; it does not establish implementations for other asset classes. It splits the system into nine typed stages, from data and features through pricing, risk and portfolio sizing to execution and validation. Each stage has conformance tests that any implementation must pass, and tested building blocks: a point-in-time store that refuses future reads, a fee and slippage model, risk limits with a kill switch, purged cross-validation, deflated Sharpe and capped half-Kelly. No trading profit is claimed.

Crypto Trading Pipeline

Author; rebuilt after the WQT 2025 hackathon, with the public cleanup and tests done with AI coding agents under my design and reviewPython · ccxt

Repository: crypto-trading-pipeline

The problem

A trading bot is mostly plumbing: fetching prices, turning them into a decision, protecting the position, sending orders and confirming fills, and keeping a record that adds up. If a fill is assumed instead of confirmed, or the backtest runs different code from the live loop, nothing the bot reports can be trusted.

What I built

After the WQT 2025 hackathon I rebuilt my competition bot into a general, exchange-agnostic pipeline, adapted to the crypto desk blueprint:

  • Market data from Binance through ccxt, with a fallback source.
  • Signals: MACD, RSI, Bollinger bands, volume, engulfing candles and order-book imbalance, combined into one entry decision. The strategy is a simple, swappable example; the point is the pipeline around it.
  • Risk limits before every order: a −2% stop, a tiered exit ladder up to +5%, a per-coin daily loss cap, a 72-hour holding limit and a 10% drawdown guard.
  • Market orders through a broker you choose: paper trading by default, or any exchange ccxt supports. A position opens or closes only on a confirmed fill.
  • Records: every order and close in JSONL with a CSV mirror, and a daily P&L file that counts each close once.
  • A backtester that runs the same decision code as the live loop.

Result

  • The live loop and the backtest make the same entry decision on all 130 checked bars.
  • 56 tests in three tiers, and 58 blueprint conformance tests for its data, feature, strategy and execution stages. Its risk and sizing stages do not pass the blueprint’s tests yet.

How it works

  1. 01Market dataBinance via ccxt
  2. 02Signalsone entry decision
  3. 03Risk limitsstop, exit ladder, drawdown
  4. 04Brokerpaper by default, or ccxt
  5. 05RecordsJSONL, CSV, daily P&L
the backtester calls the same decision code as the live loop

designed and verified by Oscar, implemented with AI coding agents (Claude Code, Codex)

Limits

  • The strategy is a simple example. This page makes no claim about its returns.
  • Orders are market orders, so every trade pays the spread.
  • Live and backtest agreement was checked on 130 bars, not on every bar the bot saw.

The vault’s paper layer

Designer and sole author

Repository: quant-research-vault

The paper layer of the vault: arXiv and optional OpenAlex paper metadata fetched into SQLite, indexed in ChromaDB and served to AI assistants through a read-only search server. It was not used in the centrepiece build.

An earlier, separate experiment

Designer and sole author

Repository: Polymarket-Crypto-5min

An earlier, separate experiment (July 2026, not built from the book): a point-in-time walk-forward backtester whose availability audit caught a look-ahead leak in candle timing.