SmartEE Digital Co.
EN|TR
ADR-008Date: 2026-08-24
STATUS: ACCEPTED

Level 2 Orderbook Imbalance (OBI) Streaming & TimescaleDB Continuous Aggregates

Author: Market Microstructure & Data Platform Team
#Market Microstructure#TimescaleDB#Redis Streams#OBI#High-Frequency

1. Context & Problem Statement

OHLCV candle data alone lacks order book depth and immediate buyer/seller pressure dynamics. Calculating continuous orderbook imbalance in real time is critical for high-frequency signal generation and market liquidity modeling.

2. Decision

We implemented real-time Level 2 Orderbook Imbalance (OBI) streaming computing continuous volume-weighted bid/ask depth imbalances and spread metrics, published to Redis stream:market_feed, backed by TimescaleDB hypertables with automated 5m and 1h continuous aggregate refresh policies.

3. Consequences & Trade-Offs

Positive Outcomes

Continuous orderbook pressure barometer available in real-time to AI models and frontend gauges
Sub-millisecond historical candle queries via pre-materialized TimescaleDB continuous aggregate views
Up to 90% disk storage savings using native chunk compression

Negative / Trade-Offs

High-frequency L2 orderbook feeds require sustained Redis memory and network bandwidth

Mitigation Strategies

Configured sliding window buffer eviction and Redis stream trimming (MAXLEN ~10,000)

Need ADR Governance in Your Engineering Org?

We help engineering teams establish versioned ADR repositories, C4 models, and automated CI test gates.

Learn More About Architecture Sprints