Skip to content
Ahmed Hamza

Work in progress / independent research system

QAP

A deterministic crypto research workbench that tests strategies against matched passive controls, realistic costs, immutable evidence, and an explicit live-capital NO-GO boundary.

Python 3.14FastAPIReact / ViteDeterministic replayForward-paper evidenceMatched controls

Repository snapshot

QAP

Deterministic research workbench for evidence before promotion.

Commits
218
Product
Workbench
Research
Deterministic

Work done

Matched passive controlsForward-paper evidenceReact research workbench

QAP

A research system is more useful when it can reject its own strategy.

QAP evolution from signal authority to evidence authority The older tradingview_ratio QAP CLI evolves through an evidence reset into the current deterministic qap research workbench with matched passive controls and an explicit live-capital no-go boundary. QAP / the authority moved MODEL CONFIDENCE → MATCHED ECONOMIC EVIDENCE EARLIER / tradingview_ratioSignal-led QAP CLICopula signal authorityvetoes + paper workflow EVIDENCE RESETCan it beat the control?after costs, causally CURRENT / qapResearch workbenchdeterministic replaymatched HODL / controlsimmutable evidenceFastAPI + React/Vite CURRENT PRODUCT BOUNDARY Research and forward-paper work can continue while live-capital authority remains NO-GO. LESSONThe code got larger; the claim got smaller.
QAP changed most when the authority moved from model confidence to matched economic evidence.

The project has two generations

The earlier tradingview_ratio repository grew into QAP — Quantitative Arbitrage Pairs. It was a correctness-first Python CLI with an explicit Discovery → Validation → Signal → Execution lifecycle, vetoes, paper workflows, and Student-t Copula evidence near the center of signal authority.

That work is the predecessor, not the current architecture.

The current qap repository starts from a different product law: portfolio wealth relative to the correct matched passive HODL/control after costs is the primary economic objective. Coin-unit accumulation remains useful attribution, but it cannot turn wealth destruction into a success story.

What changed

Earlier QAPCurrent QAP
Pair-validation CLILocal research workbench
Model-led signal authorityMatched economic controls are authoritative
Coin accumulation as the headline objectiveMatched-HODL-relative portfolio wealth after costs
Typer-first operator surfaceDeterministic engine + FastAPI boundary + React/Vite UI
Paper bundles around pair decisionsImmutable experiments, scanner research, and forward-paper operations
Stronger model = likely next stepRicher models must earn admission with a falsifiable question

The biggest improvement is not the web UI. It is that a model can now end as REJECT without the project treating that as a failed implementation.

Current architecture

public market evidence
  -> deterministic experiment / replay engine
  -> exact portfolio accounting
  -> HODL + matched controls
  -> immutable run artifacts
  -> forward-paper operations
  -> finite FastAPI command/query boundary
  -> React/Vite research workbench

The workbench is organized around user questions—Home, Discover, Validate, Portfolios, Results, Activity—while the scientific and economic authority stays in backend evidence.

A prettier chart cannot promote rejected research.

Evidence before promotion

The current research flow is deliberately simple-first. A candidate has to survive the declared controls and costs before a richer relationship model gets to matter.

That means a useful run can end with:

strategy: interesting
vs periodic control: positive
vs matched HODL: negative
promotion: NO

The weaker comparison does not rescue the strategy.

The same discipline applies to final out-of-sample evidence. Holdout data is not allowed to become another tuning set just because the result is disappointing.

Forward-paper is not live trading

QAP can run deterministic forward-paper operations over recorded public venue inputs and reconcile the resulting artifacts. That is still a research boundary.

The current Phase-12 decision remains NO-GO for live operation. The repository has no private exchange credentials, authenticated live-trading API, browser order controls, live scheduler, or live-capital authority.

That boundary is visible in the product because implementation progress and permission to deploy capital are different claims.

Why the API is deliberately finite

The local FastAPI layer is not a generic remote-control surface. It exposes a finite research mutation boundary and validated evidence reads for a single-operator local workbench.

Longer scientific operations have durable operation records rather than pretending one HTTP request owns their whole lifetime. The frontend can ask what happened without becoming the source of scientific truth.

What I learned

The original QAP taught me to make vetoes explicit. The current QAP pushed that idea further: the research thesis itself needs a veto.

A system that can only discover promising results is not doing much research. The more trustworthy version preserves rejected runs, compares against boring controls, and allows the correct conclusion to be “do not promote this.”