这是indexloc提供的服务,不要输入任何密码
Skip to content

Strategy sends MARKET order when calculated price is NaN #v2_with_controllers #pmm_simple #binance #7823

@alrog2000

Description

@alrog2000

Describe the bug

the issue created with the help of GitHub Copilot chat Gemini 2.5 Pro

Description:

There is a critical issue where a strategy (in my case, a V2 script using a pmm_simple controller) sends a MARKET order when it fails to calculate a valid price, resulting in a NaN value. This happens during initial ticks before the market data provider is fully ready.

Instead of failing safely, the system appears to default to a market order, which is extremely dangerous and can lead to immediate, unintended fills at unfavorable prices.

Log Evidence:

As seen in the log at 19:10:11, a MARKET order was created with a NaN price, which was subsequently filled.

19:10:11 - client_order_tracker - Created MARKET buy order for 0.00005000 BTC-USDT at NaN.
...
19:10:12 - client_order_tracker - The buy order x-MG43PCSNBBCUT6421488336f6caab2 has been filled at 113554.17000000 USDT.

Expected Behavior:

The system should never create an order if the price is NaN or invalid. It should either:

  1. Throw a clear error and prevent order creation.
  2. Safely skip the tick until a valid price is available.

Impact:

This bug exposes users to significant financial risk from unintended market orders. It undermines the safety and predictability of the bot's operation.

Steps to reproduce

  1. create controller (v2_with_controller) and script (pmm_simple) configs
  2. start the strategy

Release version

v2.9.0

Type of installation

Docker

Attach required files

conf_market_making.pmm_simple_20251025.yml

conf_v2_with_controllers_20251025-3.yml

Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions