KrakenBackfill

Defined in dccd.daemon.backfill

class KrakenBackfill(obj, sleep, form, max_retries=3, retry_delay=2.0)[source]

Bases: _BackfillBase

Backfill strategy for Kraken using the /Trades endpoint.

Kraken’s OHLC endpoint only returns the last ~720 candles regardless of since. This strategy paginates /Trades with nanosecond cursors, then resamples the raw trades into OHLC candles.

Parameters:
objImportDataCryptoCurrencies

Instantiated FromKraken object.

sleepfloat

Seconds to wait between paginated API calls.

formstr

Output format (accepted for backward compatibility).

run(start_str, dry_run=False, position=0, progress_callback=None, stop_event=None, message_callback=None)

Run the full backfill for this (exchange, pair).

Parameters:
start_strstr

Earliest date to backfill ('YYYY-MM-DD HH:MM:SS'). Interpreted in the timezone stored on the exchange object.

dry_runbool, optional

Print an estimate without making any API calls.

positionint, optional

tqdm bar position (use distinct values for parallel runs).

progress_callbackcallable, optional

Called as progress_callback(windows_done, windows_total) after each window completes. Used by the web UI to report live progress; None (default) keeps CLI behaviour unchanged.

stop_eventthreading.Event, optional

When set, the backfill stops cleanly at the next window boundary. Used by the web UI to cancel a running backfill; None (default) means the run cannot be interrupted.

message_callbackcallable, optional

Called with each human-readable log line as it is written. Used by the web UI to surface backfill logs; None (default) keeps CLI behaviour unchanged.