Coinbase¶
Capabilities¶
Backfill: OHLC (300 candles/req, windowed automatically), order-book snapshot (level 2), trades (recent only).
Stream: trades.
OHLC fidelity:
quote_volume— null ·trades— null.
Note
Coinbase paginates trades through CB-AFTER response headers, which the
JSON-only transport does not expose — a trades backfill returns a single
recent page (declared history="recent"). Live OHLC / order book are not
implemented and not declared.
Symbols¶
BTC-USD (dash). Coinbase quotes in USD, not USDT.
Example¶
async with Client() as c:
await c.backfill("coinbase", "BTC/USD", "ohlc", span=3600, start="2024-01-01")
API¶
- class CoinbaseSource(http=None)[source]¶
Coinbase source adapter.
Backfill: OHLC (full, 300 candles/req — windowed automatically), trades (recent only — see Notes), order-book snapshot (level 2).
Stream: trades only.
See also
dccd.Clientthe public facade.
Notes
Coinbase paginates trades through
CB-AFTERresponse headers, which the JSON-only transport does not expose, so trades backfill returns a single recent page (declaredhistory="recent"). Live OHLC / order book are not implemented and are not declared as capabilities.Examples
>>> from dccd.sources.coinbase import CoinbaseSource >>> CoinbaseSource().capability_for(DataType.OHLC, 'rest', 'historical').max_per_request 300
- async fetch_ohlc_page(symbol, span, start_ns, end_ns, limit)[source]¶
Fetch one page of OHLC bars (see
fetch_ohlc_page).
- async fetch_orderbook(symbol, depth)[source]¶
Fetch a current order-book snapshot up to depth levels.
- async fetch_trades_page(symbol, start_ns, end_ns, limit, cursor=None)[source]¶
Fetch the most recent trades (
history="recent").Coinbase Exchange paginates trades through
CB-AFTER/CB-BEFOREresponse headers, which the current JSON-only transport does not expose. We therefore return a single recent page and never a cursor — deep history is genuinely unavailable here (declared via thehistory="recent"capability, enforced by the backfill engine).