From e54612714e66ab25aebfb81a5962b5ffe5af4aa1 Mon Sep 17 00:00:00 2001 From: Benjamin Thomas Schwertfeger Date: Sun, 12 Jan 2025 12:06:58 +0100 Subject: [PATCH] [skip ci] remove some fixmes --- src/kraken_infinity_grid/cli.py | 1 - src/kraken_infinity_grid/gridbot.py | 7 +++---- src/kraken_infinity_grid/order_management.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/kraken_infinity_grid/cli.py b/src/kraken_infinity_grid/cli.py index 294eb02..12ffb41 100644 --- a/src/kraken_infinity_grid/cli.py +++ b/src/kraken_infinity_grid/cli.py @@ -270,7 +270,6 @@ def run(ctx: Context, **kwargs: dict) -> None: ctx.obj |= kwargs if ctx.obj["sqlite_file"]: - # FIXME: Maybe use in_memory for dry-run? db_config = {"sqlite_file": ctx.obj["sqlite_file"]} else: db_config = { diff --git a/src/kraken_infinity_grid/gridbot.py b/src/kraken_infinity_grid/gridbot.py index 68ad106..0e750ae 100644 --- a/src/kraken_infinity_grid/gridbot.py +++ b/src/kraken_infinity_grid/gridbot.py @@ -108,14 +108,14 @@ class KrakenInfinityGridBot(SpotWSClient): New execution message - new order: - - If the init is not done yet, the algorithm ignores the message. FIXME + - If the init is not done yet, the algorithm ignores the message. - The algorithm ties to assign the new order to the orderbook. In some cases this fails, as newly placed orders may not be fetchable via REST API for some time. For this reason, there are some retries implemented. New execution message - filled order: - - If the init is not done yet, the algorithm ignores the message. FIXME + - If the init is not done yet, the algorithm ignores the message. - If the filled order was a buy order (depending on the strategy), the algorithm places a sell order and updates the local orderbook. - If the filled order was a sell order (depending on the strategy), the @@ -123,7 +123,7 @@ class KrakenInfinityGridBot(SpotWSClient): New execution message - cancelled order: - - If the init is not done yet, the algorithm ignores the message. FIXME + - If the init is not done yet, the algorithm ignores the message. - The algorithm removes the order from the local orderbook and ensures that in case of a partly filled order, the remaining volume is saved and placed as sell order somewhen later (if it was a buy order). Sell orders usually @@ -312,7 +312,6 @@ async def on_message( # noqa: C901,PLR0912,PLR0911 ) except Exception as exc: # noqa: BLE001 - # FIXME: this is not a beauty LOG.error(msg="Exception while processing message.", exc_info=exc) self.save_exit(reason=traceback.format_exc()) diff --git a/src/kraken_infinity_grid/order_management.py b/src/kraken_infinity_grid/order_management.py index 9133d26..14a3d63 100644 --- a/src/kraken_infinity_grid/order_management.py +++ b/src/kraken_infinity_grid/order_management.py @@ -261,7 +261,6 @@ def check_price_range(self: OrderManager) -> None: LOG.debug("Check conditions for upgrading the grid...") if self.__check_pending_txids(): - # FIXME: This should not return here, but need to be checked first. LOG.debug("Not checking price range because of pending txids.") return @@ -755,7 +754,8 @@ def cancel_all_open_buy_orders(self: OrderManager) -> None: self.__s.orderbook.remove(filters={"side": "buy"}) except Exception: # noqa: BLE001 - # FIXME: Check if this can still happen. + # FIXME: Check if this can still happen. Can't remember why this + # was added. self.__s.save_exit( str( f"❌ Error in function >cancelAllOpenBuyOrders < \n"