API Reference

dccd v3 is a hexagonal architecture: a pure, synchronous domain with no I/O, an async transport layer, exchange sources, storage, an application layer of operations, and thin interfaces (CLI · HTTP API · UI · Python Client). See Architecture for the big picture.

Each object below links to its own page with the full signature, parameters and examples.

Client

The one-stop async facade — most users only need this.

Client

Async context manager facade for dccd v3.

Domain

Pure, synchronous value objects and helpers — no I/O. All timestamps are nanoseconds UTC (int64).

symbol.Symbol

Canonical trading pair (base/quote, spot by default).

types.DataType

Core data types supported by dccd v3.

records.OHLCBar

One OHLCV candle bar.

records.Trade

Single trade (tick).

records.OrderBookSnapshot

A complete (or delta) order book state at a point in time.

records.OrderBookLevel

One price level in an order book.

capability.Capability

Declares one atomic capability of a source adapter.

dataset.DatasetId

Unique identifier for a dataset (exchange × symbol × type × span).

dataset.Provenance

Dataset-level lineage metadata (stored in Parquet metadata, not per-row).

Pure transforms and time helpers:

transforms.aggregate_ohlc

Aggregate trades into OHLC bars of span seconds.

Sources

One adapter per exchange, implementing the fine-grained Source protocols, resolved through a registry. See Exchanges for capabilities and fidelity.

registry.SourceRegistry

Maps exchange names to source adapter instances.

binance.BinanceSource

Binance adapter for OHLC, trades and order book.

coinbase.CoinbaseSource

Coinbase adapter.

kraken.KrakenSource

Kraken source adapter.

bybit.BybitSource

Bybit adapter.

okx.OKXSource

OKX adapter — uses history-candles for deep OHLC, history-trades for deep trades.

bitfinex.BitfinexSource

Bitfinex adapter — 10000 bars/trades per request (largest limit).

bitmex.BitMEXSource

BitMEX adapter — bucketed (1m/5m/1h/1d) OHLC, full trades history.

Transport

Async I/O building blocks shared by every adapter.

http.AsyncHTTPClient

Thin wrapper around httpx.AsyncClient with retry/backoff.

ws.WebSocketBase

Base async WebSocket client with exponential reconnect.

ratelimit.RateLimiter

Global per-exchange rate limiter.

paginate.paginate_ohlc

Paginate OHLC bars forward using declared Capability.

paginate.paginate_trades

Paginate trades by cursor, draining the [start_ns, end_ns] window.

Storage

Parquet datasets (ns timestamps, provenance, per-type dedup) and the run history.

parquet.ParquetStore

Read/write interface for a single DatasetId.

runs_sqlite.RunsStore

Append-only SQLite store for JobRun records.

migrate.migrate_parquet_to_ns

Migrate all Parquet files under data_path to the canonical v3 schema.

Application

The operations and orchestration that wire domain, sources and storage together.

operations.backfill

Backfill historical data from a source to the Parquet store.

operations.stream

Stream live data continuously until stop_event is set.

operations.read

Read stored data for target in the given nanosecond range.

operations.inventory

Return a list of dataset descriptors for all stored data.

scheduler.Scheduler

Orchestrates JobSpecs (intervals → backfill; supervised → streams).

config.AppConfig

config.JobConfig

YAML job definition — more human-friendly than JobSpec.

jobs.JobSpec

Declarative job definition.

events.EventBus

Simple pub-sub event bus for operation progress/log/status events.

Interfaces

api.app.create_app

Create and return the FastAPI application.