Skip to main content

Aether Quant logo

Aether Quant

A self-adapting algorithmic trading system on QuantConnect Lean and PyTorch, and an open toolkit for building, testing and proving your own algorithms.

Python 3.11 Library license: Apache-2.0 Trading system license: AGPL-3.0 Tests passing on CI PyPI version Docker image on GHCR

CI CodeQL Python coverage OpenSSF Scorecard OpenSSF Best Practices Documentation Python versions on PyPI Dashboard image on GHCR

PyTorch QuantConnect Lean Interactive Brokers FastAPI React Redis PostgreSQL GitHub Actions

Aether Quant is not a single static strategy. It's a dynamic system. At its core, an ensemble of neural models predicts, for every asset every day, a multi-horizon view of the market: direction at 1, 5 and 20 days, expected return magnitude and volatility, and each asset's cross-sectional rank. Predictions come from a Mixture-of-Experts ensemble (bullish/bearish/sideways/volatility specialists) routed by a learned gating network, plus a causal-TCN sequence encoder, all reading one feature pipeline that folds in a market-regime detector, a 3D market topology layer and a liquidity/market-impact engine. A unified multi-asset-class layer routes equities, crypto, bonds, futures, options and forex through one portfolio, behind a kill switch, position reconciliation and a hash-chained audit log, while a controlled retraining loop and a research cycle let generations of models share capital and hand it over as evidence arrives. Everything is wired together and validated end to end inside QuantConnect's Lean engine. The thesis this project exists to test: markets are non-stationary, so a trading model should be too.

Proving that thesis is only half the purpose. Aether Quant is also meant to help build the next algorithm, whoever writes it. The aether_quant library and the aq CLI work on any signal, not just this project's, and offer the same tools it judges itself by: position sizing, book construction, order gates, a cost-aware simulator, pre-registered research with counted trials and once-only holdouts, overfitting tests, Lean-exact statistics, and generations that hand over gradually. The safety-critical functions behind them are proved in Lean 4 and tested against those proofs. Documentation, tutorials and the API reference: https://leon1706-lol.github.io/Aether-quant/.

The book trading today is simpler than the stack around it: a long-only crypto trend sleeve, on paper only. It is labelled improved, not verified, because no pre-registered test has found a verified edge yet.

Lean Sharpe Net profit Max drawdown Sharpe without T-bill carry Alpha t Deflated Sharpe
0.65 34.379% 7.82% 0.74 0.15 5.12%

Lean run 2026-11-07_17-54-01, 2023-07-01 to 2026-11-02, computed 2026-11-07 18:27 UTC. Details: Backtest Statistics.

Quickstart

pip install aether-quant        # numpy and pandas only: no torch, no Lean, no Docker
aq hello                        # downloads 11 coins (keyless), runs the shipped rule with costs, prints the report

aq hello --offline uses the sample shipped in the wheel. The tutorials cover signal evaluation, book construction and overfitting tests, and each opens in Colab. The docs hold the guide and the API reference. The dashboard runs with demo data in one command: docker run --rm -p 8080:8000 ghcr.io/leon1706-lol/aether-quant-dashboard:latest.

Known Limitations

  • No demonstrated edge. The sleeve is mostly crypto exposure, and almost all of its result came before mid-2025. See Alpha by Period.
  • Nothing has survived selection. None of the project's 217 pre-registered trials survived, so the holdouts stay unread. See Research Record.
  • Hindsight in the universe. The 11 coins are today's survivors. The same rule scored Sharpe -0.06 on coins no rule had read (#301). EOS, which Coinbase delisted, left the book on 2026-11-07 (#311).
  • Paper only, and no broker yet. Interactive Brokers cannot fill this sleeve, and the crypto venue (Coinbase assumed) needs an API key (#192). See RUNBOOK "When the keys arrive".
  • IB is unverified end to end. Connection, live futures margin and all 43 option structures have only met Lean's samples, never a real Gateway. Futures and options stay data-empty until a key is connected (aq ib status).
  • Not ready for live capital, measured. aq live-readiness scores 21 conditions and reads NOT READY: no 60-session forward record, no paper period, no broker. See docs/live/paper-to-live.md.
  • Safety is field-tested without a broker only. In Lean's paper brokerage on a fake feed, main.py passes the field test (#351, scripts/lean_smoke/field_test.py). Its orders fill, injected drift breaches reconciliation, and an injected shock trips the kill switch and flattens the book. It survives Redis and then Postgres being stopped, restarts cleanly, runs two accounts apart, and its audit chain verifies on a real Postgres. The kill switch, reconciliation and auto-rollback have still never run against a real broker over paper hours (#228, #338, #192).

Table of Contents


The aether_quant Library

One importable package over the same pure functions the live algorithm and the research chain call: 930 public names across 32 modules.

pip install "aether-quant[research]"    # the library is Apache-2.0; scipy, scikit-learn and friends come with [research]
# from a clone: pip install -e .[research]

Score your own signal, build a constrained book, gate an order and test for overfitting:

import numpy as np
import pandas as pd

from aether_quant import execution, portfolio, research, risk

# Your signal: one score per ticker per date, next to the realised rank it should predict
rng = np.random.default_rng(0)
rows = []
for date in pd.date_range("2024-01-01", periods=120, freq="B").strftime("%Y-%m-%d"):
    future = rng.normal(size=30)
    ranks = pd.Series(future).rank(pct=True).to_numpy()
    for i in range(30):
        rows.append({"date": date, "ticker": f"T{i}", "split": "validation", "my_score": 0.3 * future[i] + rng.normal(),
                     "target_rank_5d": ranks[i], "target_rank_20d": ranks[i]})
frame = pd.DataFrame(rows)

# 1. The report this project judges its own models by: rank IC, HAC t, bootstrap interval
report = research.evaluate_signal(frame, score_column="my_score", splits=("validation",), bootstrap_draws=200)
h20 = report["splits"]["validation"]["h20"]
print(f"IC {h20['mean_ic']:.3f}, HAC t {h20['hac_t']:.1f}")

# 2. A market-neutral book: per-name and sector caps, dollar neutrality, gross cap
weights, _ = portfolio.apply_book_neutrality(
    {"AAA": 0.20, "BBB": 0.10, "CCC": -0.15, "DDD": -0.05},
    sector_by_symbol={"AAA": "tech", "BBB": "tech", "CCC": "energy", "DDD": "tech"},
    dollar_neutral=True, sector_neutral=True, gross_exposure_cap=0.5, max_weight_per_name=0.12, sector_max_net_weight=0.15,
)

# 3. Sizing never flips a trade or exceeds its cap; a tripped risk lock stops the order
sized = risk.build_dynamic_position_sizing(-0.3, 0.9, 0.02, 0.10)
allowed, reason = execution.resolve_order_permission("paper", True, True, False)
print(round(sized.target_weight, 4), allowed, reason)

# 4. How likely is the best of your variants just the luckiest? (daily returns, one column per variant)
trial_returns = rng.normal(0, 0.01, size=(400, 8))
print("PBO:", research.probability_of_backtest_overfitting(trial_returns, blocks=8)["pbo"])

How it works:

  • A facade, not a copy. Every name is re-exported from the module main.py and the offline tools already use, so a library result and a live decision come from the same code.
  • Light to import. No torch, Lean, Redis, Postgres or web stack. Optional extras load only when called.
  • Modules map to jobs:
    • signals, sizing, neutrality, costs, backtest, overfitting: the research toolkit by task, with Kelly, volatility targeting, beta and factor neutrality, composable cost models, backtest(), the minimum track record and the haircut Sharpe.
    • samples, hello: the bundled sample and aq hello as a call.
    • risk, portfolio, execution: sizing, kill switch, book construction, HRP, order gates, cost model, reconciliation.
    • features, training, data: indicators, cross-sectional ranks, purged folds, data parsers.
    • evaluation, research: simulators, Monte Carlo, Lean-exact statistics, deflated Sharpe, PBO, factor spanning, leakage audits.
    • cycle: pre-registered rounds, generation shares, decay detection, retraining preflight.
    • audit, formal, io: the hash chain, Lean 4 proof cases, finite-safe JSON.
  • Stable surface. The public names are pinned in tests/data/aether_quant_api.json, so a change is always deliberate. Every export is fully annotated and documented: the API reference.

Runnable tours: examples/aether_quant_quickstart.py, examples/aether_quant_cycle.py. Full module list: aether_quant/README.md.

Download

Command What
Library + aq pip install aether-quant numpy and pandas only (about 145 MB in a fresh venv)
Research pip install "aether-quant[research]" adds scipy, scikit-learn, statsmodels, pyarrow, httpx
Notebooks pip install "aether-quant[notebooks]" adds matplotlib and the Jupyter kernel
Dashboard docker run --rm -p 8080:8000 ghcr.io/leon1706-lol/aether-quant-dashboard:latest the web UI with demo data, no database
Whole system pip install "aether-quant[full]", docker pull ghcr.io/leon1706-lol/aether-quant:latest Lean CLI, torch, Redis, Postgres clients, the engine image

The 40 GB Lean engine image is only for real Lean backtests and deployments, never for research.

Getting Started

From a clone, with a virtual environment active:

pip install -r requirements/requirements.txt
pip install -r requirements/requirements-dev.txt
pip install -e .                # registers the `aq` command
aq --help
aq test                         # the suite, without Redis, Postgres or IB
aq evaluate --lean-report       # refresh the statistics from a finished run
aq cycle status                 # what is due today
  • Dashboard: aq webui --docker (the demo image, port 8080), or for development aq api (port 8001), then npm install in webui/ and aq webui (port 3002).
  • Live operations: secrets (aq secrets), accounts (aq accounts, aq live), users (aq users) and the scorecard (aq live-readiness). See RUNBOOK.md and docs/live/.
  • Training: aq train, aq cycle retrain. See RUNBOOK.md.

Requirements

  • Python 3.11, which CI runs. Package metadata says >=3.10, and a first-party check (vermin -t=3.10-) in CI keeps the sources importable on 3.10 (#326).
  • For backtests: Docker and the Lean CLI (pip install lean). The first run pulls the pinned engine image, quantconnect/lean:17900, about 40 GB.
  • For the infrastructure: Docker Compose (Redis, Postgres, workers). Everything degrades gracefully without it.
  • For the dashboard: Node.js.
  • For retraining: 14 GB of RAM, or the training Codespace through the GitHub CLI (gh).

Dependency sets are listed in requirements/README.md.

Architecture

Every decision runs daily inside Lean's on_data(). A config flag picks what drives the book:

  • Target weights (shipped): phase_v2.target_weights reads ml/target_weights.csv, produced by a rule or by blended generations, and an offline twin tracks it at a daily correlation above 0.99.
  • Model book (trained, not trading): the ensemble's rank heads drive a dollar- and sector-neutral long/short book. It has failed the pre-registered bar every time.
flowchart LR
    D["Lean data<br/>equities, bonds, crypto, forex"] --> F["Feature pipeline<br/>regime, liquidity, topology, macro"]
    F --> M["Models<br/>4 experts + gating,<br/>multitask, sequence"]
    M -. "model book" .-> B["Book construction<br/>neutrality, sizing, costs"]
    W["Target weights<br/>rule or blended generations"] -- "shipped" --> B
    B --> G["Safety gates<br/>kill switch, order gate,<br/>reconciliation"]
    G --> L["Lean orders"]
    L --> R["Redis, then PostgreSQL<br/>experience and audit log"]
    R --> T["Performance triggers"]
    T --> C["Controlled retraining<br/>validate, promote, roll back"]
    C --> M
    Q["Research cycle<br/>rounds, generations, decay"] --> W
    C --> Q

Models (one shared feature code path for training and runtime)

  • Baseline + 4 experts: bullish, bearish, sideways and volatility specialists, routed by a learned gating network.
  • Multitask: a shared trunk with direction, magnitude, volatility and rank heads, including residualised ranks that measure skill rather than beta.
  • Sequence: a causal-TCN over a 30-bar window.
  • Ranking objective: trained directly on soft-Spearman or ListNet over whole dates.

Risk and execution

  • Sizing: bounded and direction-preserving, scaled down when expected edge does not clear round-trip cost.
  • Controls: an automated kill switch, reconciliation against broker holdings, a drawdown lock and an opt-in auto-rollback.
  • Asset classes: one router for equities, crypto, bonds, forex, futures and options.

Live operations (off until configured; docs/live/)

  • Secrets: each credential comes from a file, a Docker secret, the environment or the OS keyring, and never shows itself.
  • Accounts: one Lean deployment each, with overrides that can only tighten the config (proved in Lean 4); the default account is the single-account system.
  • Users: viewer, operator and admin tokens for the API and dashboard; locks are audited.
  • Readiness: aq live-readiness measures every paper-to-live condition, and the broker-free field test exercises the safety paths in Lean.

Research cycle (aq cycle)

  • Rounds: rules are hashed before any score, trials go in a ledger, and a holdout read happens once.
  • Generations: up to four share a book, each one's share computed from its record and moving smoothly.
  • Admission: a candidate must earn its share (R-ADMIT1); real money is always the owner's manual action.
  • Off by default: ml/generations/policy.json has enabled: false, and nothing in Lean reads it.

Stack: Lean CLI, Docker Compose, Redis, PostgreSQL, PyTorch, NumPy/pandas, FastAPI, React/Vite, Telegram alerts, GitHub Actions, Codespaces. Full contracts: development/architecture.md.

Universe Size

103 assets in `config.json`: 55 equities and broad ETFs, 22 bond ETFs, 11 crypto pairs, 15 forex pairs. The shipped book trades the crypto pairs; the rest feed the models.
Split Dates
Training 2014-12-01 to 2021-12-31
Validation 2022-01-01 to 2023-06-30
Backtest 2023-07-01 to 2025-06-30
Holdout 2025-07-01 to 2026-11-02

Tickers and roles: development/asset_universe.md.

Project Structure

Single-responsibility Python packages, each with its own README, a few top-level entry points (main.py for the Lean algorithm, train*.py for the trainers, aq_cli.py for the CLI) and the runtime config (config.json, lean.json). The annotated tree is in development/project_structure.md.

Documentation Site

The guide, the live-operations pages and the API reference are published at https://leon1706-lol.github.io/Aether-quant/ after each green CI on main, together with the coverage reports. Preview it with mkdocs serve; see docs/. The table below is generated from mkdocs.yml by aq docs sync.

Section Pages
Home Home
Getting started Install · Hello world · The dashboard
Tutorials Hello world · Signal evaluation · Book construction · Overfitting tests
Guide Signals · Sizing · Neutrality · Costs · Backtesting · Overfitting · Research cycle · Safety
Live trading Paper to live · Secrets · Accounts · Users · Field test
API reference Overview, one page per facade (32), generated by scripts/build_docs.py
About License · Security · Changelog

Module Documentation

Area Module What it owns
Library aether_quant/ The importable facade over every subsystem
Library formal/ Lean 4 proofs of the safety-critical functions (aq prove)
Library notebooks/ · docs/ Colab tutorials, built from percent-format sources · the MkDocs site sources
Trading risk/ Position sizing, leverage, kill switch, asset-class routing
Trading portfolio/ Book construction, HRP, sleeves, target weights, options
Trading execution/ Order gate, cost model, reconciliation, paper readiness
Trading analyzer/ The final per-asset action layer
Models features/ Feature functions shared by training and runtime
Models inference/ · cpp_inference_ext/ The numpy forward pass · its optional C++ accelerator
Models moe/ · experts/ The gating network · the four expert models
Models regime/ · topology/ · liquidity/ Regime detection · market topology · market impact
Models ml/ Weights, datasets, candidates, generations
Research evaluation/ Simulators, audits, statistics, the research cycle
Research retraining/ · performance/ Controlled retraining and rollback · performance triggers
Research backtests/ Lean run output (gitignored)
Data data/ · data_pipeline/ The Lean data layout · backfills and bar synthesis
Ops experience/ · audit/ Redis-to-Postgres decision history · the hash-chained audit log
Ops monitoring/ · webui/ · visualization/ FastAPI · the React dashboard · runtime state exports
Ops notifications/ · storage/ Telegram alerts · reserved for future persistent artifacts
Tooling tests/ · scripts/ · requirements/ The suite · dev and research scripts · dependency sets
Tooling .devcontainer/ · .githooks/ The training and Lean Codespace definitions · the opt-in git hooks

Development Documentation

Document Contents
development/README.md What each development document is for
development/architecture.md Subsystem contracts and the offline/live parity contract
development/infrastructure.md Docker, ports, Codespaces, database inspection
development/verification.md Every way the project is verified, and when each is required (aq verify)
development/research_results.md Generated results of the retired model book and past rule chains
development/project_structure.md The directory tree
development/asset_universe.md The tickers
development/Changelog.md Build history
development/Problems.md Bug log
development/backups/ Full text from before each condensing pass

Open Source Files

File Purpose
LICENSE The GNU AGPL-3.0, the license of the trading system. LICENSING.md maps the two licenses: the library (what the wheel and dashboard ship, the UI, notebooks, docs, proofs) is Apache-2.0 with NOTICE, and REUSE.toml maps every path
CONTRIBUTING.md Setup and conventions for people
AGENTS.md Setup and conventions for AI agents
RUNBOOK.md Everyday commands, incidents, the research cycle, what to do when keys arrive
REPRODUCIBILITY.md How to reproduce every published number
SECURITY.md Reporting a vulnerability
CODE_OF_CONDUCT.md Community conduct
todo.md The owner's current objectives

Backtest Statistics

The shipped book's numbers from the real Lean engine. Every table is generated, never hand-edited: aq backtest or aq evaluate --lean-report --backtest-dir backtests/<run> refreshes them.

  • Portfolio is the whole Lean run. Strategy is that run without its T-bill sweep, because idle-cash carry is not alpha.
  • The current code reproduces the pinned run order for order. No newer run is needed until the book changes.
  • Results of the retired model book live in development/research_results.md.

Overview

Backtest equity curve

Metric Value
Backtest window 2023-07-01 to 2026-11-02
Sharpe Ratio 0.651
Net Profit 34.379%
Compounding Annual Return 9.229%
Drawdown 7.800%
Total Orders 987
Win Rate 61%
Last updated 2026-11-07 18:25 UTC (auto-generated by aq backtest)

Benchmarks

Series Total return Annual return Volatility Sharpe Max drawdown
Portfolio (with the T-bill sweep) +34.78% +9.39% 7.66% 1.21 7.82%
Strategy (without the sweep) +19.44% +5.49% 7.67% 0.73 9.88%
SPY +76.55% +18.64% 14.91% 1.22 18.76%
60/40 SPY/AGG, rebalanced daily +48.09% +12.53% 9.63% 1.27 11.27%
Bitcoin, buy and hold +157.01% +32.83% 46.20% 0.84 53.06%
The book's 11 coins, equal weight +156.78% +32.79% 65.28% 0.76 57.09%

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC · same sessions to the last equity close, no risk-free rate

Alpha by Period

Period Dates Sharpe 95% interval Alpha per year Alpha t Deflated Sharpe
Whole run 2023-07-02 to 2026-11-04 0.74 -0.44 to 1.93 +0.40% 0.15 5.12%
First half 2023-07-02 to 2025-06-30 1.17 -0.43 to 2.76 -0.68% -0.18 26.05%
Second half 2025-07-01 to 2026-11-02 0.07 -1.57 to 1.67 +2.49% 0.66 3.65%
Long run, same rule 2014-12-02 to 2026-11-04 0.94 0.28 to 1.55 +1.48% 0.95 0.88%

Proof of alpha (R-ALPHA1): not demonstrated (full-window alpha t < 2.0; deflated Sharpe < 0.95).

With SPY and AGG read a session late, as the crypto series is, the full-window alpha t is 0.12 (#330). R-ALPHA1 reads the figure in the table.

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC · alpha against SPY / AGG / BTCUSD with a Newey-West t · deflated over 206 ledger trials

General Characteristics

Metric Portfolio Strategy Note
Time range 2023-07-01 to 2026-11-02
Years 3.35
Average AUM $122,140
Capacity (Lean estimate) $37,000,000 lowest-capacity asset XLMUSD 2XR
Leverage, mean (gross exposure / NAV) 0.96x 0.11x
Leverage, max 1.04x 0.20x
Maximum dollar position — $7,493 BCHUSD on 2026-01-03
Ratio of longs (share of bets) — 86.27%
Longs : shorts (bets) — 132 : 21
Frequency of bets (per year) — 45.7
Average holding period (days, notional-weighted) — 32.3
Annualized turnover (traded notional / AUM) 2.77x 2.34x
Correlation to underlying (SPY, daily) 0.290 0.291
Start equity $100,000
End equity $134,379
Total orders 987
Lean portfolio turnover (daily mean) 0.780%

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC

Performance

Metric Portfolio Strategy
PnL +$34,379 +$19,855
PnL from the T-bill sweep (carry) +$14,524
PnL from long positions (closed bets, net of fees) — +$19,891
PnL from short positions (closed bets, net of fees) — +$0
Annualized rate of return +9.23% +5.56%
Hit ratio (closed bets net of fees) — 48.79%
Average return from hits — +39.97%
Average return from misses — -13.96%
Time-weighted return (no external flows: the chained return) +34.38% +19.85%
Net profit (Lean) 34.379%
Win rate / loss rate (Lean, all trades) 61% / 39%
Average win / average loss (Lean) 0.13% / -0.11%
Profit-loss ratio (Lean) 1.21
Expectancy (Lean) 0.344
Unrealized at the end (Lean) +$12,378

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC

Runs and Drawdowns

Metric Portfolio Strategy
HHI of positive returns 0.002 0.002
HHI of negative returns 0.002 0.002
HHI of time between bets (bets per month) — 0.026
95-percentile drawdown 4.78% 7.05%
95-percentile time under water (days) 227.8 240.8
Maximum drawdown 7.82% 10.81%
Longest time under water (days) 393 393
Drawdown episodes 33 25
Drawdown (Lean) 7.800%
Drawdown recovery (Lean, days) 243
Maximum drawdown duration (Lean) 152.00:00:00

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC

Implementation Shortfall

Metric Portfolio Strategy
Traded notional $1,133,700 $957,535
Broker fees $7,726 $7,660
Broker fees per turnover (bps of traded notional) 68.2 bps 80.0 bps
Average slippage per turnover (bps vs the bar's open) 8.6 bps 10.0 bps
Dollar performance per turnover (bps) 303.2 bps 207.4 bps
Return on execution costs (net PnL / (fees + slippage)) 3.95x 2.30x
Total fees (Lean) $7,726

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC

Return/Risk Efficiency

Metric Portfolio Strategy Note
Annualized Sharpe ratio (Lean: risk-free rate subtracted) 0.651
Annualized Sharpe ratio (no risk-free rate) 1.221 0.737
Information ratio vs SPY -0.616 -0.864
Information ratio (Lean) -0.706
Probabilistic Sharpe ratio (P[true Sharpe > 0]) 98.86% 91.38%
Probabilistic Sharpe ratio (Lean, vs its benchmark) 22.668%
Deflated Sharpe ratio 27.51% 6.81% 173 registered trials, expected best Sharpe 1.54
Sortino ratio (Lean) 1.004
Alpha / beta (Lean) 0.027 / 0.146
Annual standard deviation (Lean) 0.075
Annual variance (Lean) 0.0060
Tracking error (Lean) 0.146
Treynor ratio (Lean) 0.334
Sharpe, Lean formula (shipped rate file/365) 0.651

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC

Attribution

Class Net PnL Return on AUM (annual) Volatility (annual) Sharpe Max drawdown (on AUM) Risk share Fees
cash_sweep +$14,524 +3.55% 0.28% 12.85 0.30% 0.27% $66
crypto +$19,856 +4.86% 7.47% 0.74 11.35% 99.73% $7,660
unattributed (Lean minus rebuilt) -$1

Run 2026-11-07_17-54-01 · computed 2026-11-07 18:27 UTC

Robustness

Monte Carlo Simulation

Monte Carlo equity curves

Metric p5 p50 p95
Final return 4.787522% 33.146986% 79.410487%
Annualized Sharpe 0.235344 1.195824 2.213417
Max drawdown 4.985192% 7.883263% 13.205712%
P(negative total return): 0.026

1000 block-bootstrapped histories (block 20 days, seed 42) of Lean run 2026-11-07_17-54-01's 1222 daily returns, 2023-07-01 to 2026-11-02. The run itself returned 34.38%; computed 2026-11-07 18:25 UTC (rendered 2026-11-08 02:03 UTC).

Full distribution

Deeper distribution statistics across all Monte Carlo runs:

Final total return (%)

p5 p25 p50 p75 p95
4.787522 20.277565 33.146986 48.34783 79.410487

Annualized Sharpe

p5 p25 p50 p75 p95
0.235344 0.796524 1.195824 1.587901 2.213417

Max drawdown (%)

p5 p25 p50 p75 p95
4.985192 6.350005 7.883263 9.734714 13.205712
  • Best run total return: 143.6281%
  • Worst run total return: -12.2954%
  • Probability of a negative total return: 0.026
  • Config: n_runs=1000, method=block, block_size=20d, seed=42 (pinned - the section only changes when underlying results change)

The red line in the chart above is the element-wise AVERAGE of all run equity curves; faint blue lines are the individual bootstrap histories.

Research Record

Each search used rules written before any score. Details are in development/Problems.md.

Search Trials Survivors Nearest result Entry
Candidate pool, strict bar 38 selection trials 0; overfitting probability 0.53 ended verification The installed sleeve, Lean Sharpe 0.63, by fallback rule R-LEAN19 #279
Round 1: fundamentals, insiders, short volume, funding, point-in-time retrain, wide crypto 28 0 The sleeve itself scored -0.06 on unread coins #300, #301
Round 2 8 0 Sharpe 0.57 #310
Round 3: pooled books, composites, published signs, quarterly accruals 10 0 Sharpe 0.58, second half 0.29 #315
Round 4C: crypto risk, liquidity and trend filters, a boosted model 14 0; overfitting probability 0.58 Idiosyncratic volatility, Sharpe 0.62 (halves 0.39, 0.69) #336
Round 4E: EDGAR filings, seasonality, insiders, cash profitability, ETF trend, macro timing 9, two voided by a runner defect 0 Cash profitability, Sharpe 0.39 #336
Round 4F: the two voided trials again 2 0 SPY on term and credit, Sharpe 0.75 on one name, failed the placebo #336

Disclaimer

  • Only the Lean backtest counts as ground truth. Offline numbers are estimates.
  • Capacity is theoretical. It is a participation cap on historical volume, never tested against real fills at size.
  • A backtest is not a forecast. The record since the data freeze is the real test: aq cycle status, forward/ on the forward-ledger branch.

Test Suite

One test file per source module; the badge above counts them on CI's last green run of main. aq test runs them, and aq test --coverage measures every tracked module on a small PC. Conventions: tests/README.md.

CLI Reference

aq --help lists 35 commands, and aq <command> --help gives every flag. Dry run is the default wherever a command writes data or config.

aq hello

aq hello [--offline] [--start YYYY-MM-DD] [--end YYYY-MM-DD] [--json FILE] [--html FILE] [--no-cache]

Start here: one command, no key, no Docker. It downloads daily bars for the shipped book's 11 coins from Coinbase's public candles, runs the shipped rule through a cost-aware backtest, and prints a report with BTC and equal-weight benchmarks and the overfitting checks (PSR, PBO, deflated and haircut Sharpe, minimum track record).

  • --offline: the sample bundled in the wheel (2021-06 to 2026-10). Any failed download falls back to it too, with a notice.
  • --json, --html: also write the report, or a self-contained page with the equity curve.
  • --no-cache: download again instead of reading ~/.cache/aether-quant/candles.
  • From Python: aether_quant.hello.run(offline=True).

aq train

aq train [--dataset-only|--init-only|--experts-only|--gating-only|--multitask-only|--sequence-only|--topology-only|--strategy-selector-only|--rl-sizing-only]
aq train --walk-forward [--step-days N] [--mode rolling|expanding] [--include-multitask] [--include-sequence] [--metrics M] [--resume-run-id ID]
aq train [--seed N] [--ranking-objective mse|soft_spearman|listnet]

Builds the dataset and trains the models into ml/.

  • No flag: trains everything.
  • --*-only: one piece. --topology-only and --strategy-selector-only need outcome events in Postgres and skip cleanly without them.
  • --walk-forward: one diagnostic run per window, never touches the active models.

aq test

aq test [--ruff] [--parallel] [--lean|--full] [--coverage [--changed]]
aq test [--cli] [--risk] [--portfolio] [--features] [--data-pipeline] [--webui] [--ml] [--retraining] [--notifications] [--storage] [--live] [--audit] [--evaluation] [--formal] [--meta] [--scripts]

Runs pytest, then syncs the doc facts on a full run. The test badge is CI's.

  • --ruff: lint first and fail fast.
  • --coverage: each group in turn under coverage, then the combined report; every tracked module must reach 100%.
  • --coverage --changed: the fast gate before a commit (the pre-commit hook runs it). It runs the tests that name each module changed since HEAD, new files included, and fails on any uncovered line in those modules; a fresh full coverage.json that already shows them covered passes at once.
  • --parallel: xdist. Don't use it on a low-memory machine, because each worker imports torch.
  • --lean, --full: add the real Lean integration test, over an hour.
  • Subsystem flags: run only those test files; they combine.

aq backtest

aq backtest [--image IMAGE]

Runs lean backtest . and refreshes Backtest Statistics. Needs Docker.

  • --image: use another engine image instead of the pinned local build.

aq profile

aq profile [--iterations N] [--sort cumulative] [--batched] [--symbols-per-bar N] [--parallel] [--pool-workers N] [--no-gc] [--bucket-report]
aq profile [--regime] [--topology] [--topology-cached] [--learned-topology] [--liquidity] [--gating] [--analyzer] [--indicators] [--options]

Profiles the per-bar hot path without a backtest: a pstats breakdown plus p50/p95/p99 latency.

  • No subsystem flag: the inference path. --batched profiles the production path, --parallel benchmarks a process pool.
  • Subsystem flags: those pure functions; they combine.

aq report

aq report <backtest-folder> <result-id>

Writes Lean's own HTML report to backtests/<backtest-folder>/report.html.

aq cycle

aq cycle status [--ledger-file F]
aq cycle research {rules|score|placebo|gate|pbo|freeze|hold|report} --round R [--draft D] [--only T...] [--draws N] [--force] [--trial T] [--digest H]
aq cycle daily [--ledger-file F] [--dry-run]
aq cycle decide --generation G --weights W --ledger-file F --session D
aq cycle retrain --host {local,codespace} [--procedure P] [--smoke] [--dry-run] [--if-due]
aq cycle promote --generation G --to {shadow,ramping,active,fading,winding_down,retired,rejected} [--ledger-file F]
aq cycle schedule {show|install} [--platform {windows,linux}] [--host {local,codespace}] [--dry-run]

The research cycle: rounds, generations, decay and retraining.

  • status: what is due today.
  • retrain --host local: refuses under 14 GB of RAM; --smoke proves the plumbing anywhere.
  • promote: follows R-ADMIT1 and never touches a broker setting.

aq api

aq api

Starts the FastAPI monitoring server on port 8001.

aq webui

aq webui
aq webui --docker [--build] [--image IMAGE] [--port 8080] [--data DIR]

Starts the dashboard dev server (port 3002, with aq api on 8001).

  • --docker: runs the dashboard image instead: FastAPI, the built web UI and demo data from aq hello, no database and no engine. It is the published aether-quant-dashboard image, the one-line Docker command in Getting Started.
  • --build: builds the image from this checkout first (the Dockerfile's dashboard stage).
  • --data: serves a real tree (its visualization/ and ml/) read-only instead of the demo.

aq docker

aq docker up [--lean|--all]
aq docker build

up starts Redis and PostgreSQL by default. build rebuilds the app image.

aq config

aq config [get <key>|set <key> <value>|keys [<prefix>]]
aq config preset --list|--show <name>|--apply <name> [--dry-run]

Reads and edits config.json by dotted key. set parses JSON values and keeps a backup; preset applies a named bundle after validating every key.

aq lean

aq lean [get <key>|set <key> <value>|keys [<prefix>]]

The same tool for lean.json.

aq docs

aq docs sync [--check]

Refreshes every marked fact in the docs from its source (docs_facts.py), and the generated blocks it owns, such as the Documentation Site table from mkdocs.yml. --check changes nothing and exits 1 on drift, which is how CI catches stale numbers.

aq verify

aq verify [--list] [--quick] [--record FILE] [--write-doc]

Every way the project is verified, in one table (development/verification.md): --list prints it, --quick runs what a 4 GB machine can (ruff, doc facts, the library gate, the sorry scan, secrets, the guard tests), --record also writes the results as JSON, and --write-doc regenerates the table in the doc.

aq retrain

aq retrain <plan|train|train_topology|train_gating|train_multitask|train_sequence|train_strategy_selector|validate|backtest|commit|promote|rollback|auto-rollback|status> [...]

Runs one stage of the controlled retraining pipeline by hand.

  • train: a candidate in isolation, never the active files.
  • validate, backtest: candidate against active.
  • promote, rollback --to-version-id <id>: switch the active model.
  • auto-rollback --status: a read-only check of whether the active model would roll back.

aq paper-readiness

aq paper-readiness

The check to run before switching to paper: broker config and observation-mode health.

aq trade-lock

aq trade-lock --on|--off|--auto|--status [--account ID]

Overrides the sticky drawdown lock. --off deliberately clears it. --account writes a named account's override (state/accounts/<id>/overrides.json) instead of config.json.

aq kill-switch

aq kill-switch --arm|--disarm|--auto|--status [--account ID]
aq kill-switch --history [--limit N]

Overrides the kill switch through the same file as the trade lock, so the two can't disagree. --history reads past trips from the audit log (needs AETHER_POSTGRES_DSN).

aq clean

aq clean ml [--keep-versions N] [--keep-backups N] [--strip-walk-forward-datasets] [--apply] [--json]

Lists what can be removed from ml/. Active models are never listed, and nothing is deleted without --apply.

aq evaluate

aq evaluate <flag> [--backtest-dir backtests/<run>] [--json] [--account ID]

Offline evaluation and audits. Every Lean-reading flag uses --backtest-dir, else the README pin, else the newest finished run. Each writes ml/evaluation/<name>.json. --account evaluates on one account's tightened limits, through the same apply_risk_overrides main.py runs.

A finished Lean run

Flag What it does
--lean-report Runs every tool below that a run supports, then refreshes the README
--backtest-stats The tables in Backtest Statistics
--alpha-proof [--data-dir DIR] Alpha, Sharpe interval and deflated Sharpe per period
--lean-monte-carlo Block bootstrap of the run's daily returns
--lean-stats [--interest-rate-file F] [--trading-days N] Lean's Sharpe, Sortino and PSR, replicated exactly
--audit-backtest [--period START..END] [--book-run-index N] [--max-open-sessions N] Order-level audit; run it after every backtest
--audit-fills Fills against the data's open: cost or price gap
--attribute-lean [--book-history-file PATH] P&L per asset class and component
--classification-parity Logged probabilities against the offline head
--paper-check [--reference-dir R] [--start D] [--end D] A paper run against a reference run's bands
--forward-ledger [--ledger-branch B] [--ledger-file F] Verifies the forward record's hash chain and judges each rule

The offline book (the retired rank book)

Flag What it does
--rank-book [--model M] [--head H] [--split S] Net and gross Sharpe, turnover, cost drag
--as-live The same book through the live path's decision functions
--all --rank-book, --capacity, --stress, --calibrate-edge, --benchmarks, --monte-carlo, --classification
--capacity · --stress Participation-capped capacity · 1x, 2x, 3x costs
--benchmarks Naive and public baselines on the same split
--monte-carlo [--mc-runs N] [--mc-block-size B] [--mc-seed S] [--mc-method block|iid] Bootstrap of the book's returns
--classification Direction-head accuracy, F1, log-loss
--ablation [--variants a,b,c] Each mechanism switched off in turn
--factor-exposure Loadings on SPY and momentum, residual Sharpe
--preset NAME A config preset in memory only
--walk-forward-summary [--run-id ID] Print a finished walk-forward run

Research and audits

Flag What it does
--pbo [--trial-returns PATH] Probability of backtest overfitting
--factor-spanning --signal CSV What a signal adds over plain factors
--ic-by-class · --audit-gates Within- and between-class IC · the rolling-IC gate's vetoes
--audit-leakage · --overfit-report Label and feature leakage · IC kept out of sample
--audit-features [--permutation] · --audit-heads Feature quality · each head against its gate
--audit-data [--data-root PATH] Every universe zip, plus a hash manifest
--calibrate-sim-lean --calibration-file PATH Simulator-to-Lean gap, by mechanism

Calibration and replay (print a value, write nothing to config)

Flag What it does
--calibrate-edge edge_bps_per_rank_unit for the net-edge gate
--calibrate-book-spread [--book-spread-percentile P] The minimum rank spread
--calibrate-confidence-threshold [--confidence-threshold-percentile P] The minimum confidence
--calibrate-rolling-ic-floor [--rolling-ic-floor-percentile P] The rolling-IC floor
--calibrate-volatility-threshold [--volatility-threshold-percentile P] Per-class elevated volatility
--replay-kill-switch · --replay-rolling-ic-gate Day-by-day offline replays
--simulate-limit-fills [--limit-fill-offset-sweep 0.5,1.0,2.0] How often limit orders would fill
--reconcile-book-history [--book-history-path P] [--replay-hysteresis] [--hysteresis-survives-veto] [--reconcile-run-index N | --reconcile-all-runs] Lean's book against an offline re-derivation
--reconcile-features --symbol TICKER One symbol's live features against the dataset

Shared by the flags above: --dataset PATH, --split S, --json.

aq research

aq research --signal CSV [--dataset PATH] [--horizons 5,20] [--out PATH]

Scores any date,ticker,score CSV: rank IC, t-stats, bootstrap interval, era stability and decay. The same report judges this project's models.

aq prove

aq prove [--module NAME] [--regen-cases] [--check-sorry]

Builds the Lean 4 proofs in formal/ (needs elan and the Mathlib cache).

  • --regen-cases: regenerate the differential cases; run it after any spec edit.
  • --check-sorry: scan for unfinished proofs, no Lean install needed.

aq fetch

aq fetch <crypto|stock> --ticker T --start D --end D [--apply]
aq fetch futures --ticker T --start D --end D --expiry D [--contract-month YYYYMM] [--family-ticker ROOT] [--apply]
aq fetch options --ticker T --start D --end D --expiry D --strike K --right <call|put> [--family-ticker ROOT] [--apply]

Backfills one new ticker and, with --apply, registers it in config.json. Crypto and stocks come from Yahoo Finance, futures and options from Interactive Brokers.

aq backfill

aq backfill <dividends|fred|yfinance> [--apply] [--tickers T ...] [--series S ...] [--quotes]

Refreshes one data source across the whole universe: dividend schedules, FRED series, or thin Lean zips. --quotes derives a missing crypto quote zip. Never touches config.json.

aq ib

aq ib status

Interactive Brokers readiness: disabled, missing credentials, or reachable. Credentials live in lean.json (aq lean set ib-account <ACCOUNT>).

aq assets

aq assets status

Multi-asset readiness at a glance: IB, futures and options flags, margin specs, FRED coverage.

aq render-lean-config

aq render-lean-config [--base lean.json] [--out lean.live.json] [--env-file .env.live] [--account ID]

Renders the gitignored lean.live.json for Lean's --lean-config. Values come from a *_FILE file, a Docker secret, the AETHER_* variables or the keyring. Coinbase's key pair renders too. Prints field names only, never secrets. --account reads AETHER_<ID>_* and writes lean.live.<id>.json.

aq secrets

aq secrets status [--json FILE] [--account ID]
aq secrets set NAME [--account ID]
aq secrets delete NAME [--account ID]

Where each credential comes from: a *_FILE file, a Docker secret, an environment variable or the OS keyring. status shows names and sources, never a value. set stores one in the keyring, prompted and never echoed. See docs/live/secrets.md.

aq accounts

aq accounts list|validate
aq accounts status [--json FILE]

The account registry (accounts.json; template accounts.example.json). Each account is one Lean deployment whose overrides may only tighten the config. status shows each account's secrets (resolved or not) and last state.

aq live

aq live up|down [--account ID] [--dry-run]

Starts or stops one account's Lean live deployment from the compose lean-live service: its own container, AQ_ACCOUNT, its Lean environment and its rendered config. --dry-run prints the commands.

aq users

aq users add NAME [--role viewer|operator|admin] [--accounts a,b]
aq users list
aq users remove NAME

Dashboard and API users. A token is printed once and stored as a salted hash. With any user, every /api route but /api/health needs a bearer token. An operator may lock an account and an admin may unlock it.

aq live-readiness

aq live-readiness [--account ID] [--paper-check FILE] [--markdown] [--json FILE] [--no-write] [--docs]

The paper-to-live scorecard: every condition for live capital, measured, with unknown counting as fail. It writes visualization/grafana/live_readiness.json for the dashboard and exits 1 unless ready. --docs refreshes the table in docs/live/paper-to-live.md.

aq secrets-check

aq secrets-check

Exits non-zero if a secret is about to be committed. Backs .githooks/pre-commit.

aq audit-log

aq audit-log [--event-type order_placement|credential_load|live_mode_transition] [--since YYYY-MM-DD] [--limit N] [--verify]

Queries the tamper-evident audit log (needs AETHER_POSTGRES_DSN). --verify walks the whole hash chain and reports the first broken link.

aq status

aq status

Shows git status.

Release Process

A release happens only on a pushed version tag:

git tag vX.Y.Z
git push origin vX.Y.Z

The tag sets the version through setuptools-scm, then .github/workflows/release.yml:

  • runs the test suite beside the release, for visibility only (a failure does not block it);
  • publishes to PyPI through Trusted Publishing, with no stored token;
  • pushes the engine and dashboard images to ghcr.io/leon1706-lol/aether-quant and aether-quant-dashboard, each with an SBOM and provenance;
  • creates the GitHub release with the wheel, sdist and SBOM, a Sigstore signature per file and SLSA provenance, then refreshes the OpenSSF Scorecard.

A release published without those assets gets them from a dispatch of the same workflow with backfill_tag (RUNBOOK "Releases").

Roadmap

History lives in development/Changelog.md; current objectives are in todo.md.

  • Interactive Brokers and a crypto venue: verify end to end, then run the paper period (aq evaluate --paper-check).
  • Forward records: judge the sleeve and any shadow generation at 60 and 252 sessions (aq cycle status).
  • A candidate that passes selection: the unread holdouts back one frozen candidate, once.
  • Later, HFT: tick data, short-horizon models and low-latency execution would be a second system alongside this one, not a change to it. See development/architecture.md.

Built by Leon Schwarzkopf, leonschwarzkopf08@gmail.com

Metadata

Release files for aether-quant 6.6.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aether-quant 6.6.8
File Size Uploaded Provenance Actions
aether_quant-6.6.8.tar.gz 8.0 MB With provenance Details for aether_quant-6.6.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aether-quant 6.6.8
File Interpreter ABI Platform Actions
aether_quant-6.6.8-py3-none-any.whl Python 3 none any Details for aether_quant-6.6.8-py3-none-any.whl

Total release size: 9.5 MB

Release files / aether_quant-6.6.8.tar.gz

Download URL aether_quant-6.6.8.tar.gz
Size 8.0 MB
Tags Source
SHA-256 checksum
How to use checksums
260b6843c20bf2658870b55e1309574896a2433a8bfb396c8720fdbe8eb7c9d8
BLAKE2b-256 checksum
How to use checksums
4ba970c15683a51f6bf4c669bb0ae758b17258a0574ec9af9700cff1315d3982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / aether_quant-6.6.8-py3-none-any.whl

Download URL aether_quant-6.6.8-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
289d9836e502d1278346d8d4138ab9be0bcd5872282b1142014f31e0634736be
BLAKE2b-256 checksum
How to use checksums
884d47f8ac202a0a95dc56d1df958a3204c9aac9188f76b3c28ca7a30c8103f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for aether-quant 6.6.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aether_quant-6.6.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page