#8482·hummingbot

dYdX v4 - Setting ONEWAY position mode repeatedly floods the logs with errors

Author: rapcmiaCreated Sep 25, 2026Updated Sep 25, 2026
Labelsbug

Describe the bug

While testing PR #8477 with a V2 controller using dydx_v4_perpetual, the strategy started successfully and no longer showed the original Mnemonic words count is not valid (0) error. Immediately after startup, however, the bot repeatedly tried to set ONEWAY position mode and logged TypeError: cannot unpack non-iterable NoneType object. The same error appeared 2,362 times in about 30 seconds, making the logs difficult to use and potentially affecting the bot's stability and performance.

2026-09-24 13:00:41,734 - 802401 - hummingbot.connector.derivative.dydx_v4_perpetual.dydx_v4_perpetual_derivative.DydxV4PerpetualDerivative - INFO - Setting position mode: requested=PositionMode.ONEWAY, current_exchange=None
2026-09-24 13:00:41,735 - 802401 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: cannot unpack non-iterable NoneType object
Traceback (most recent call last):
  File "/home/eddga/hummingbot/hummingbot/8477/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
           ^^^^^^^
  File "/home/eddga/hummingbot/hummingbot/8477/hummingbot/connector/perpetual_derivative_py_base.py", line 359, in _execute_set_position_mode
    success, msg = await self._trading_pair_position_mode_set(mode, self.trading_pairs[0])
    ^^^^^^^^^^^^
TypeError: cannot unpack non-iterable NoneType object

This appears to be a separate issue from the PR. A code comparison against development at commit d74d286222375b54025b646e83844ac5006ce21b shows the same position-mode implementation, while the PR does not change this method. The method is expected to return a success result and message, but it returns no value. It also calls the base position-mode setter again, which appears to schedule the same operation repeatedly.

Steps to reproduce

  1. Configure a V2 controller that uses dydx_v4_perpetual with position_mode: ONEWAY
  2. Start the v2_with_controllers strategy
  3. Wait for the strategy startup message
  4. Check the logs for repeated Setting position mode messages followed by TypeError: cannot unpack non-iterable NoneType object

Release version

v2.17

Type of installation

Source

Attach required files

n/a