OctoBot icon indicating copy to clipboard operation
OctoBot copied to clipboard

Exception when calling callback on ExchangeChannelConsumer

Open Tiago-FM opened this issue 10 months ago • 1 comments

Step 1: Have you search for this issue before posting it?

Yes. Looks similar to issue #1993 but not quite the same.

Step 2: Describe your environment

  • OS : Ubuntu 22.04.4 LTS
  • Python Version: 3.10.12 (python -V)
  • Installed via pip

Step 3: Describe the problem:

In certain operations with SOL/USDT (haven't seen them in other pairs so far) the logs get several messages of the following: image

Expected behavior No errors shown

Relevant code exceptions or logs:

2024-04-04 04:18:16 ERROR  ExchangeChannelConsumer logging_util.py:239      unsupported operand type(s) for /: 'decimal.Decimal' and 'float'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/async_channel/consumer.py", line 68, in consume
    await self.perform(await self.queue.get())
  File "/usr/local/lib/python3.10/dist-packages/async_channel/consumer.py", line 85, in perform
    await self.callback(**kwargs)
  File "/usr/local/lib/python3.10/dist-packages/octobot_services/notifier/abstract_notifier.py", line 99, in _order_notification_callback
    await self._handle_order_notification(order, linked_notification, order_identifier,
  File "/usr/local/lib/python3.10/dist-packages/octobot_services/notifier/abstract_notifier.py", line 122, in _handle_order_notification
    order_profitability = trading_api.get_order_profitability(
  File "/usr/local/lib/python3.10/dist-packages/octobot_trading/api/orders.py", line 79, in get_order_profitability
    return exchange_manager.exchange_personal_data.orders_manager.get_order(order_id).get_profitability()
  File "/usr/local/lib/python3.10/dist-packages/octobot_trading/personal_data/orders/order.py", line 566, in get_profitability
    self.order_profitability = 1 - self.filled_price / self.created_last_price
TypeError: unsupported operand type(s) for /: 'decimal.Decimal' and 'float'
2024-04-04 04:18:16 ERROR  ExchangeChannelConsumer logging_util.py:210      Exception when calling callback on ExchangeChannelConsumer with callback: _order_notification_callback: unsupported operand type(s) for /: 'decimal.Decimal' and 'float' (error: TypeError)

Tiago-FM avatar Apr 04 '24 08:04 Tiago-FM

Hi,

Thanks for reporting. Could you retry with the latest OctoBot version please?

Herklos avatar Aug 04 '24 07:08 Herklos