-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
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:
- Throw a clear error and prevent order creation.
- 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
- create controller (v2_with_controller) and script (pmm_simple) configs
- 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