Skip to main content

Overview

ClyptQ’s data system handles everything from historical Parquet files to live WebSocket streams, with automatic environment-based routing and warmup computation. Data is declared in TradingDataSpec and consumed as FIELD inputs in the graph.

Data Flow

ObservationSpec

Data sources are defined with ObservationSpec objects:

Available fields

An OHLCVSpec provides these FIELD inputs to the graph:

Multi-exchange observations

Or use the list shorthand:
Bybit uses "linear" as its futures market type, not "futures". If you pass market_type="futures" for Bybit, it is auto-normalized to "linear" internally, but using "linear" explicitly is recommended for clarity. Binance and Gate.io use "futures" as expected.

Supported timeframes

Most exchanges support: 1m, 5m, 15m, 30m, 1h, 4h, 1d
Coinbase does not support 4h. It supports 2h and 6h instead. Check Supported Exchanges for the full per-exchange timeframe matrix.

TradingDataSpec

The data spec defines what data to load and for what period:
Paper/live modes: Omit start/end. The driver automatically handles warmup from historical data and then switches to live WebSocket feeds.

SymbolSourceMap

Maps symbols to exchange-market pairs for data routing and execution:
axis_keys are the canonical identifiers for each symbol on each venue. They’re used by:
  • EquityCalculator — to align prices with positions
  • FuturesTargetPositionIntention — to route orders to the correct exchange
  • TaggedArray columns — each column maps to an axis_key

Storage Architecture

Environment-based routing

The storage backend is selected automatically based on CLYPTQ_ENV. The same code works across all environments — only the data path changes.

Parquet format

Data is stored as Parquet files, organized by:
Benefits: Columnar compression, fast reads, efficient date range filtering.

Data discovery

Use Helper.data_catalog() to check what’s available locally:

Data Pipeline Per Mode

Backtest mode

All data is loaded upfront. The driver iterates through bars sequentially.

Paper/Live mode

The warmup_info property tracks how data was sourced:

Data Quality

Forward-fill (FFill)

Missing bars are automatically forward-filled. This is tracked in TaggedArray:
The updated=False flag tells operators “this is a stale value” — useful for strategies that need fresh data only.

Validation

Data loading includes automatic validation:

Live Data

WebSocket feeds

Disconnections are handled automatically with exponential backoff and gap-fill on reconnection.

Warmup computation

The driver automatically computes the minimum warmup ticks needed:
  1. Trace the graph backward from leaf nodes
  2. At each node, accumulate the lookback requirement
  3. Convert between timeframes if needed (e.g., 1h lookback=20 on a 1m graph = 1200 1m bars)
  4. Add 5% safety buffer
The graph’s Input declarations drive this computation — no manual warmup_ticks parameter needed.

FIELD Data Principle

How FIELD inputs work in the graph

Lookback Buffers

RollingBuffer and warmup computation

Supported Exchanges

Exchange matrix with data availability

TaggedArray

The 4-field data structure (value, exists, valid, updated)