diff --git a/fin_depo/defi_kucoin.py b/fin_depo/defi_kucoin.py index 32c627b..9db273d 100644 --- a/fin_depo/defi_kucoin.py +++ b/fin_depo/defi_kucoin.py @@ -242,9 +242,16 @@ class KucoinDepoFetcher(DepoFetcher): for _weeks_back in range(20): end_time = end_time - datetime.timedelta(days=7) timestamp = int(end_time.timestamp() * 1000) - raw_details = self.kucoin_client.get_orders(end=timestamp) - yield from (order_from_json(item) for item in raw_details['items']) - del _weeks_back, raw_details + page_index = 1 + while True: + raw_details = self.kucoin_client.get_orders(end=timestamp, page=page_index) + yield from (order_from_json(item) for item in raw_details['items']) + + page_index = raw_details['currentPage'] + 1 + if page_index > raw_details['totalPage']: + break + del raw_details + del _weeks_back def _get_double_registers(self) -> list[DoubleRegister]: double_registers: list[DoubleRegister] = []