Bybit

Capabilities

  • Backfill: OHLC (full), order-book snapshot. No trades.

  • Stream: OHLC, trades, order book.

  • OHLC fidelity: quote_volume ✅ native · trades — null.

Note

Bybit spot exposes only the ~60 most recent trades and no history, so trades backfill raises NoCapability rather than returning a misleading recent slice. Live trades are available via the stream.

Symbols

BTCUSDT (no separator), spot category.

Example

async with Client() as c:
    await c.backfill("bybit", "BTC/USDT", "ohlc", span=3600, start="2024-01-01")

API

class BybitSource(http=None)[source]

Bybit source adapter (spot).

  • Backfill: OHLC (full), order-book snapshot. No trades (see Notes).

  • Stream: OHLC, trades, order book.

See also

dccd.Client

the public facade.

Notes

Bybit spot exposes only the ~60 most recent trades and no history, so TradesHistory is deliberately not implemented — a trades backfill raises NoCapability rather than returning a misleading recent slice. Live trades are still available via the stream.

Examples

>>> from dccd.sources.bybit import BybitSource
>>> BybitSource().capability_for(DataType.TRADES, 'rest', 'historical') is None
True
capabilities()[source]

Declared capabilities, one per (data type × transport × mode).

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.

render_symbol(s)[source]

Render a canonical Symbol to this exchange’s string.

stream_ohlc(symbol, span)[source]

Stream live OHLC bars over WebSocket.

stream_orderbook(symbol, depth)[source]

Stream live order-book snapshots/deltas over WebSocket.

stream_trades(symbol)[source]

Stream live trades over WebSocket.