Skip to content
EzraDB

QUANT & CAPITAL MARKETS

Query the past. Join across time. Backtest in SQL.

A quant engine inside your database. Native ASOF joins, time-travel, candlestick/VWAP, and streaming ingest — plus a deterministic BACKTEST engine with walk-forward folds and built-in Sharpe, Sortino, Calmar, and max-drawdown. Same seed, bit-identical P&L.

ASOF JOINAS OF SYSTEM TIMEcandlestick / VWAPDeterministic BACKTEST

THE STATUS QUO

Three systems for one strategy — and results you can't reproduce.

Reference data in Postgres, ticks in kdb+ or QuestDB, and a bolt-on Python backtester stitching it together. Every hand-off is a place for point-in-time leakage to creep in — and when a run can't be reproduced byte-for-byte, you can't trust the P&L.

Postgresreference data
glue
kdb+ / QuestDBtick store
glue
Python backtesterbolt-on P&L

Three engines, two copies of the ticks, and a P&L nobody can replay.

BUILT FOR TIME-SERIES

The quant primitives, in plain SQL.

One PostgreSQL-18 wire, one copy of your data. The joins-across-time, aggregates, and ingest a strategy needs are native — and every snippet below is copy-pasteable and SLT-verified.

ASOF joins

Join across time — the most recent fill at or after each quote, in one clause. No window-function gymnastics.

ASOF joins · SQL
SELECT q.ticker, q.ts, t.price
FROM quotes q
ASOF JOIN fills t
  ON t.ticker = q.ticker AND t.ts >= q.ts   -- most recent fill at/after each quote
ORDER BY q.ts;

Time-travel

Query the table as it stood at any point in the past with AS OF SYSTEM TIME — reproduce a signal exactly as it looked.

Time-travel · SQL
SELECT price FROM tt_prices AS OF SYSTEM TIME '-9m'
WHERE sym = 'AAPL' ORDER BY ts LIMIT 1;
-- column/hybrid tables raise 0A000 until v0.2

Row engine only in v0.1 — column/hybrid tables raise 0A000 until v0.2.

Candlestick & VWAP

OHLC and volume-weighted average price as deterministic NUMERIC aggregates, computed at the source.

Candlestick & VWAP · SQL
SELECT open(c), high(c), low(c), close(c), vwap(c)
FROM (SELECT candlestick_agg(ts, px, vol) AS c FROM ticks) s;

Streaming ingest

Land ticks straight from Kafka, Kinesis, or NATS with dedup keys — no separate ingestion tier to babysit.

Streaming ingest · SQL
CREATE STREAMING PIPELINE tick_pipeline
  SOURCE KAFKA (brokers='localhost:9092', topic='ticks', group_id='ezradb')
  INTO si_ticks FORMAT JSON DEDUP KEY (sym, ts);

THE DETERMINISM HOOK

Same seed, bit-identical P&L.

Backtest inside the database with walk-forward folds, slippage, and commission. Fix the SEED and the run is reproducible byte-for-byte — the same strategy over the same window yields the same curve, every time. Reproducibility is the feature.

Deterministic BACKTEST · walk-forward
BACKTEST sma_crossover
  ON bt_prices
  FROM '2020-01-02' TO '2020-06-30'
  CAPITAL 1000000 SLIPPAGE 0.001 COMMISSION 0.0005 SEED 42
  WALK_FORWARD (TRAIN '60d', TEST '30d', STEP '30d')
  INTO bt_results;
-- bt_results: sharpe_ratio, sortino_ratio, calmar_ratio, max_drawdown, win_rate, cagr …
SEED 42
Run Awalk-forward
bit-identical P&L
Run Bwalk-forward
Built-in metrics per run
sharpe_ratiosortino_ratiocalmar_ratiomax_drawdownwin_ratecagr

Put the quant engine inside your database.

ASOF joins, time-travel, candlestick/VWAP, and deterministic backtesting on one copy of your data — pre-1.0 and heads-down. Explore the engine and watch the roadmap.

v0.1 · pre-release