From 569df45d1847cbb01f4baaf6c0cdfeef5d128cc5 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 1 Mar 2023 17:34:38 -0500 Subject: [PATCH] `kraken.`: drop trade history query limit --- piker/brokers/kraken/api.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/piker/brokers/kraken/api.py b/piker/brokers/kraken/api.py index 802fb699..d590148f 100644 --- a/piker/brokers/kraken/api.py +++ b/piker/brokers/kraken/api.py @@ -221,7 +221,7 @@ class Client: async def get_trades( self, - fetch_limit: int = 10, + fetch_limit: int | None = None, ) -> dict[str, Any]: ''' @@ -233,7 +233,10 @@ class Client: trades_by_id: dict[str, Any] = {} for i in itertools.count(): - if i >= fetch_limit: + if ( + fetch_limit + and i >= fetch_limit + ): break # increment 'ofs' pagination offset @@ -246,7 +249,8 @@ class Client: by_id = resp['result']['trades'] trades_by_id.update(by_id) - # we can get up to 50 results per query + # can get up to 50 results per query, see: + # https://docs.kraken.com/rest/#tag/User-Data/operation/getTradeHistory if ( len(by_id) < 50 ):