Bitfinex

Capabilities

  • Backfill: OHLC, trades, order-book snapshot — up to 10 000 items per request (the largest limit of any adapter).

  • Stream: OHLC (candles), trades. Order-book streaming is not implemented and not declared.

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

Note

Bitfinex labels Tether UST, so BTC/USDT is rendered tBTCUST (tBTCUSDT returns an empty list). Symbols with a part longer than three characters use the tBASE:QUOTE form.

Symbols

tBTCUSD / tBTCUST — leading t for trading pairs; USDT → UST.

Example

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

API

class BitfinexSource(http=None)[source]

Bitfinex source adapter.

  • Backfill: OHLC, trades, order-book snapshot — up to 10 000 items per request (the largest limit of any adapter).

  • Stream: OHLC (candles), trades. Order-book streaming is not implemented and not declared.

See also

dccd.Client

the public facade.

Notes

Bitfinex labels Tether UST, so BTC/USDT is rendered as tBTCUST (tBTCUSDT returns an empty list). Symbols with a part longer than three characters use the tBASE:QUOTE form.

Examples

>>> from dccd.sources.bitfinex import _bfx_symbol
>>> _bfx_symbol(Symbol(base='BTC', quote='USDT'))
'tBTCUST'
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.

async fetch_trades_page(symbol, start_ns, end_ns, limit, cursor=None)[source]

Fetch one page of trades (cursor = start ts in ms, forward).

Bitfinex returns up to 10 000 trades ascending in [start, end]. When a full page comes back the window held more than one page, so we advance the cursor to the last timestamp + 1 ms and continue.

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.