The warehouse is the backtest engine.
Instead of pulling prices into a Python loop, every stage of the backtest is a versioned, tested, set-based dbt model that runs next to the data.
- Fourteen models chain adjusted prices → indicators → signals → round-trip trades → per-position daily P&L → a dense daily equity curve and scorecard (return, Sharpe, max drawdown, turnover, cost drag, and a hindsight-optimal benchmark). Strategies are config: adding one is a one-line edit, not new code.
- Limits measured, not assumed: a single-query simulator hit ClickHouse's 50,000-element AST ceiling at 18 iterations, so Kanav re-architected it as three chained, materialized batches of at most ten round trips each, with a 30-per-year cap that fails the build loudly instead of silently truncating.
- Default run: the 50 most dollar-liquid US equities with complete 2015–2025 history (2,766 trading days each), 3 strategies, 414,900 signal rows and 7,184 trades; the simulator chain builds in about 18 seconds, and date filters prune a ~295M-row source read to ~16M rows for a one-year window.