Sources¶
One adapter per exchange, each implementing the fine-grained Source
protocols and declaring its Capability set. The
engine resolves an adapter from the registry; you drive them through
dccd.Client.
For each exchange’s capabilities, quirks and adapter class, see the per-exchange pages.
Adding an exchange¶
Implement the relevant protocol mixins below and a capabilities() method,
then register the adapter in
build_registry.
Registry¶
- class SourceRegistry[source]¶
Maps exchange names to source adapter instances.
Examples
>>> reg = SourceRegistry() >>> # reg.register('binance', BinanceSource()) >>> # src = reg.get_ohlc_history('binance')
- property exchanges¶
Names of all registered exchanges.
- get_ohlc_history(exchange)[source]¶
Return name as an
OHLCHistoryor raise NoCapability.
- get_orderbook_live(exchange)[source]¶
Return name as an
OrderBookLiveor raise NoCapability.
- get_orderbook_snapshot(exchange)[source]¶
Return name as an
OrderBookSnapshotRESTor raise NoCapability.
- get_trades_history(exchange)[source]¶
Return name as a
TradesHistoryor raise NoCapability.
- get_trades_live(exchange)[source]¶
Return name as a
TradesLiveor raise NoCapability.
Source protocols¶
Source protocols — fine-grained per (data_type × mode).
- class OrderBookLive[source]¶
Bases:
SourceProtocol: can stream live order book snapshots/deltas via WebSocket.
- class OrderBookSnapshotREST[source]¶
Bases:
SourceProtocol: can fetch an order book snapshot via REST.
- class Source[source]¶
Bases:
objectBase mixin for all source adapters.
Adapters inherit from
Sourceand one or more capability protocols. They declare capabilities and render exchange-specific symbol strings.
- class TradesHistory[source]¶
Bases:
SourceProtocol: can fetch historical trade pages via REST.
Cursor contract:
fetch_trades_pagereturns(trades, next_cursor). The cursor is an opaque, adapter-defined string used to continue inside the[start_ns, end_ns)window:cursor=Noneon the first call — anchor onstart_ns(orend_nsfor adapters that page backward).next_cursorisNonewhen the window is exhausted (the adapter returned a short/last page, or the next item would fall outside the window). Returning a non-Nonecursor tells the paginator to call again.
This lets the generic paginator drain a window completely — fixing the capped-single-page data loss that affected every liquid pair — without per-exchange chunking in the application layer.