Skip to content

[Binance] Algo orders API breaking changes #3287

Description

@KaizynX

Bug Report

Confirmation

Before opening a bug report, please confirm:

  • I’ve re-read the relevant sections of the documentation.
  • I’ve searched existing issues and discussions to avoid duplicates.
  • I’ve reviewed or skimmed the source code (or examples) to confirm the behavior is not by design.
  • I’ve tested this issue using a recent development wheel (dev develop or a nightly) and can still reproduce it.

Checking a recent development wheel can save time because the issue may already have been fixed.
You can install a development wheel by running:

pip install -U nautilus_trader --pre --index-url https://packages.nautechsystems.io/simple

See the development-wheels section for more details.

Expected Behavior

When submitting a STOP_MARKET order (or other affected conditional order types) for USDⓈ-M Futures on Binance, the order should be successfully placed.

Actual Behavior

The order submission fails with a Binance API error code -4120. The error message states: 'Order type not supported for this endpoint. Please use the Algo Order API endpoints instead.'

This is a breaking change on the Binance side. As per their change log, effective 2025-12-09 (today), USDⓈ-M Futures have migrated conditional orders to a new Algo Service. The traditional endpoints (POST /fapi/v1/order, POST /fapi/v1/batchOrders) now block requests for the affected order types and return the -4120 error.

https://developers.binance.com/docs/derivatives/change-log#2025-11-06

Steps to Reproduce the Problem

  1. Initialize a live trading node connected to Binance USDⓈ-M Futures.
  2. Submit a STOP_MARKET order (or any of the other affected types) for a perpetual futures instrument.
  3. Observe the order being rejected by the venue with error code -4120

Code Snippets or Logs

2025-12-09T08:43:17.749250915Z [INFO] LIVE-test_enhanced_strategy-1765269784-z8m9.0_test_enhanced_strategy: <--[EVT] OrderInitialized(instrument_id=DOTUSDT-PERP.BINANCE, client_order_id=O-20251209-084317-z8m9-000-1, side=SELL, type=STOP_MARKET, quantity=79.8, time_in_force=GTC, post_only=False, reduce_only=False, quote_quantity=False, options={'trigger_price': '1.960', 'trigger_type': 'DEFAULT', 'expire_time_ns': 0}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)
2025-12-09T08:43:17.749471828Z [INFO] LIVE-test_enhanced_strategy-1765269784-z8m9.TestEnhancedStrategy: [CMD]--> [Risk] SubmitOrder(order=StopMarketOrder(SELL 79.8 DOTUSDT-PERP.BINANCE STOP_MARKET @ 1.960[DEFAULT] GTC, status=INITIALIZED, client_order_id=O-20251209-084317-z8m9-000-1, venue_order_id=None, position_id=None, tags=None), position_id=None)
2025-12-09T08:43:17.749994637Z [INFO] LIVE-test_enhanced_strategy-1765269784-z8m9.ExecClient-BINANCE: Submit StopMarketOrder(SELL 79.8 DOTUSDT-PERP.BINANCE STOP_MARKET @ 1.960[DEFAULT] GTC, status=INITIALIZED, client_order_id=O-20251209-084317-z8m9-000-1, venue_order_id=None, position_id=None, tags=None)
2025-12-09T08:43:17.750915442Z [INFO] LIVE-test_enhanced_strategy-1765269784-z8m9.0_test_enhanced_strategy: <--[EVT] OrderSubmitted(instrument_id=DOTUSDT-PERP.BINANCE, client_order_id=O-20251209-084317-z8m9-000-1, account_id=BINANCE-USDT_FUTURES-master, ts_event=1765269797750320562)
2025-12-09T08:43:17.806654730Z [ERROR] LIVE-test_enhanced_strategy-1765269784-z8m9.ExecClient-BINANCE: Failed on submit_order ClientOrderId('O-20251209-084317-z8m9-000-1'): BinanceClientError({'code': -4120, 'msg': 'Order type not supported for this endpoint. Please use the Algo Order API endpoints instead.'})
2025-12-09T08:43:17.808367638Z [WARN] LIVE-test_enhanced_strategy-1765269784-z8m9.0_test_enhanced_strategy: <--[EVT] OrderRejected(instrument_id=DOTUSDT-PERP.BINANCE, client_order_id=O-20251209-084317-z8m9-000-1, account_id=BINANCE-USDT_FUTURES-master, reason='{'code': -4120, 'msg': 'Order type not supported for this endpoint. Please use the Algo Order API endpoints instead.'}', due_post_only=False, ts_event=1765269797806695281)

Specifications

  • OS platform: Ubuntu 24.04
  • Python version: 3.12
  • nautilus_trader version: 1.221.0 and 1.222.0a20251123

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions