hummingbot icon indicating copy to clipboard operation
hummingbot copied to clipboard

fix: pass interval as int in Kraken REST candle params (#8208)

Open ipezygj opened this issue 5 months ago • 1 comments

Before submitting this PR, please make sure:

  • [x] Your code builds clean without any errors or warnings
  • [x] Tests all pass
  • [x] You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:

Fixes #8208. The Kraken 5m candles REST endpoint only returns 1 candle while other intervals (1m, 15m, 1h, 1d) return up to 720.

Root cause: The interval parameter in _get_rest_candles_params() is passed as a string (e.g. "5") from the INTERVALS bidict, but Kraken's OHLC REST API documents it as integer type. The websocket subscription on line 137 of the same file already correctly uses int(CONSTANTS.INTERVALS[self.interval]).

Fix: Cast INTERVALS[self.interval] to int in the REST params, consistent with the WS implementation.

Files changed:

File Change
hummingbot/data_feed/candles_feed/kraken_spot_candles/kraken_spot_candles.py int() cast on interval in _get_rest_candles_params

Tests performed by the developer:

  • py_compile clean
  • Verified the websocket path already uses int() on the same constant (line 137)

Tips for QA testing:

  1. Request 5m candles from Kraken — should now return up to 720 candles
  2. Verify other intervals (1m, 15m, 1h, 1d) still work correctly

ipezygj avatar Jun 19 '26 12:06 ipezygj

CI failure is unrelated to this PR's changes.

The failing test test_cancel_two_orders_with_cancel_all_and_one_fails is a known flaky test with a timeout race condition. I've submitted #8318 to fix it.

The failure occurs because the test wrapper async_run_with_timeout() defaults to 1s timeout while cancel_all(10) needs 10s to complete, causing random CancelledError → TimeoutError.

This PR's code changes are correct. Once #8318 is merged, a rebase will pull in the fix.

ipezygj avatar Jun 19 '26 16:06 ipezygj