SDK package/version
binance-sdk-derivatives-trading-usds-futures==11.0.0 (latest on PyPI at the time of checking)
binance-common==4.0.0
- Python 3.11
Problem
DerivativesTradingUsdsFutures.rest_api.new_order() does not expose typed parameters for conditional/close-all order fields such as stop_price, close_position, activation_price, callback_rate, working_type, and price_protect.
This is inconsistent with test_order(), which does expose those parameters, and it is easy for users to assume a validated test_order() call can be promoted to new_order() with the same keyword arguments.
In addition, the USD-M Futures docs now say conditional orders are migrated to Algo Service. The SDK does expose new_algo_order() with trigger_price, close_position, and client_algo_id, so perhaps the intended behavior is to route users to new_algo_order() instead of new_order() for STOP_MARKET / TAKE_PROFIT_MARKET. If so, it would be helpful for the typed SDK surface or docs to make that explicit.
Reproduction
import inspect
import importlib.metadata as md
from binance_common.configuration import ConfigurationRestAPI
from binance_sdk_derivatives_trading_usds_futures.derivatives_trading_usds_futures import DerivativesTradingUsdsFutures
client = DerivativesTradingUsdsFutures(
config_rest_api=ConfigurationRestAPI(api_key="k", api_secret="s")
)
print(md.version("binance-sdk-derivatives-trading-usds-futures"))
print(md.version("binance-common"))
print(inspect.signature(client.rest_api.new_order))
print(inspect.signature(client.rest_api.test_order))
print(inspect.signature(client.rest_api.new_algo_order))
Observed with SDK 11.0.0:
new_order(symbol, side, type, position_side=None, time_in_force=None, quantity=None,
reduce_only=None, price=None, new_client_order_id=None,
new_order_resp_type=None, price_match=None,
self_trade_prevention_mode=None, good_till_date=None, recv_window=None)
# no stop_price / close_position / activation_price / callback_rate / working_type / price_protect
test_order(..., stop_price=None, close_position=None, activation_price=None,
callback_rate=None, working_type=None, price_protect=None, ...)
new_algo_order(..., trigger_price=None, close_position=None, price_protect=None,
client_algo_id=None, ...)
Why this matters
For risk-management orders on USD-M Futures, users commonly need close-all stop loss / take profit orders (STOP_MARKET or TAKE_PROFIT_MARKET with close-position semantics). With the current typed new_order() method, these fields cannot be passed directly even though test_order() accepts them.
After the conditional-order migration, using /fapi/v1/order for these order types may return -4120 STOP_ORDER_SWITCH_ALGO, and the working implementation is to use new_algo_order(algo_type="CONDITIONAL", type="STOP_MARKET"/"TAKE_PROFIT_MARKET", trigger_price=..., close_position="true", client_algo_id=...).
Relevant official docs
Suggested fix / clarification
One of the following would remove the ambiguity:
- Add the missing typed parameters to
new_order() if /fapi/v1/order is still intended to support any of these fields.
- If conditional orders must use Algo Service now, document this clearly in the SDK docs / generated method docs and possibly raise a clearer client-side error or warning for affected
new_order(type=...) values.
- Keep
test_order() and new_order() parameter surfaces consistent, or explicitly explain why test_order() accepts fields that new_order() intentionally does not.
SDK package/version
binance-sdk-derivatives-trading-usds-futures==11.0.0(latest on PyPI at the time of checking)binance-common==4.0.0Problem
DerivativesTradingUsdsFutures.rest_api.new_order()does not expose typed parameters for conditional/close-all order fields such asstop_price,close_position,activation_price,callback_rate,working_type, andprice_protect.This is inconsistent with
test_order(), which does expose those parameters, and it is easy for users to assume a validatedtest_order()call can be promoted tonew_order()with the same keyword arguments.In addition, the USD-M Futures docs now say conditional orders are migrated to Algo Service. The SDK does expose
new_algo_order()withtrigger_price,close_position, andclient_algo_id, so perhaps the intended behavior is to route users tonew_algo_order()instead ofnew_order()forSTOP_MARKET/TAKE_PROFIT_MARKET. If so, it would be helpful for the typed SDK surface or docs to make that explicit.Reproduction
Observed with SDK 11.0.0:
Why this matters
For risk-management orders on USD-M Futures, users commonly need close-all stop loss / take profit orders (
STOP_MARKETorTAKE_PROFIT_MARKETwith close-position semantics). With the current typednew_order()method, these fields cannot be passed directly even thoughtest_order()accepts them.After the conditional-order migration, using
/fapi/v1/orderfor these order types may return-4120 STOP_ORDER_SWITCH_ALGO, and the working implementation is to usenew_algo_order(algo_type="CONDITIONAL", type="STOP_MARKET"/"TAKE_PROFIT_MARKET", trigger_price=..., close_position="true", client_algo_id=...).Relevant official docs
stopPrice,closePosition,activationPrice,callbackRate,workingType, andpriceProtect: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-TesttriggerPriceandclosePosition: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order/fapi/v1/order//fapi/v1/batchOrderswill block affected order types with-4120 STOP_ORDER_SWITCH_ALGO: https://developers.binance.com/docs/derivatives/change-log#2025-11-06stopPriceandclosePosition: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-apiSuggested fix / clarification
One of the following would remove the ambiguity:
new_order()if/fapi/v1/orderis still intended to support any of these fields.new_order(type=...)values.test_order()andnew_order()parameter surfaces consistent, or explicitly explain whytest_order()accepts fields thatnew_order()intentionally does not.