# OpenDepth Raw-Data Pipeline & Aligned Backtest Methodology

> Canonical URL: https://opendepth.io/docs/methodology

## 01 · Raw Trade Aggregation (Never Copied from Exchange Candles)
Every 1-minute bar across Binance, OKX, Bybit, Bitget, Hyperliquid, Aster, and newly integrated CEXs & Perp DEXs is built directly from raw execution fills on strict UTC minute boundaries and published across 1m–1w timeframes within 6–9 seconds past minute close.

## 02 · 1-Second Time-Weighted Order Books & `book_complete_bps` Guard
Raw L2 books are sampled every second and weighted by dwell time across ±20, ±100, ±200, and ±500 bps, generating passive absorption (`absorb_60`), refill latency (`refill_min`), Kyle's lambda, and T1 sweep slippage. Shallow feeds fail safely to `null` when `book_complete_bps` is below the required band.

## 03 · Zero Look-Ahead Deterministic Backtest & Live Engine
Signals evaluate strictly on settled closed bars; fills occur at next-bar open with automatic indicator warmup, 1-minute intrabar SL/TP disambiguation, `book_spread`/`book_impact` slippage, and real historical funding settlements.

## 04 · Survivorship-Bias-Free Delisted Contract Retention
Delisted perpetual and spot contracts remain preserved with `delisted`, `lifecycle`, `delistedAt`, and `lastTradeAt` metadata across charts, REST API, and whole-market backtests.

## Frequently Asked Questions

### Why does OpenDepth use 1-second time-weighted depth instead of bar-close snapshots?

Single-point bar-close snapshots are easily distorted by transient spoofing walls. Weighting 1Hz orderbook snapshots by dwell time across each minute reduces transient quote noise by up to 60x.

### What does `book_complete_bps` do in strategy evaluation?

It records the maximum basis-point radius covered by an exchange's orderbook feed for each bar. Conditions referencing deeper bands evaluate to `null` when `book_complete_bps` is smaller than the requested band, preventing false signals.
