{"record":{"id":"074d6ec5661ad08b","repo":"nautechsystems/nautilus_trader","slug":"unsupported-order-type-for-binance-futures-order","errorCode":null,"errorMessage":"Unsupported order type for Binance Futures: {order_type:?}","messagePattern":"Unsupported order type for Binance Futures: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":3453,"sourceCode":"            | OrderType::MarketIfTouched\n            | OrderType::LimitIfTouched\n            | OrderType::TrailingStopMarket\n    )\n}\n\n/// Converts a Nautilus order type to a Binance Futures order type.\npub(crate) fn order_type_to_binance_futures(\n    order_type: OrderType,\n) -> anyhow::Result<BinanceFuturesOrderType> {\n    match order_type {\n        OrderType::Market => Ok(BinanceFuturesOrderType::Market),\n        OrderType::Limit => Ok(BinanceFuturesOrderType::Limit),\n        OrderType::StopMarket => Ok(BinanceFuturesOrderType::StopMarket),\n        OrderType::StopLimit => Ok(BinanceFuturesOrderType::Stop),\n        OrderType::MarketIfTouched => Ok(BinanceFuturesOrderType::TakeProfitMarket),\n        OrderType::LimitIfTouched => Ok(BinanceFuturesOrderType::TakeProfit),\n        OrderType::TrailingStopMarket => Ok(BinanceFuturesOrderType::TrailingStopMarket),\n        _ => anyhow::bail!(\"Unsupported order type for Binance Futures: {order_type:?}\"),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use nautilus_core::time::get_atomic_clock_realtime;\n    use nautilus_network::http::{HttpStatus, StatusCode};\n    use rstest::rstest;\n    use tokio_util::bytes::Bytes;\n\n    use super::*;\n    use crate::common::enums::BinanceTradingStatus;\n\n    #[rstest]\n    fn test_rate_limit_config_usdm_has_request_weight_and_orders() {\n        let config = BinanceRawFuturesHttpClient::rate_limit_config(BinanceProductType::UsdM);\n\n        assert_eq!(config.request_quota.burst_size().get(), 2_400);","sourceCodeStart":3435,"sourceCodeEnd":3471,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/http/client.rs#L3435-L3471","documentation":"When building a Binance Futures order submission, the adapter maps nautilus OrderType variants to BinanceFuturesOrderType. The wildcard arm rejects any order type Binance Futures does not support natively (e.g. MarketToLimit, MarketToLimit variants, or futures-unsupported spot types).","triggerScenarios":"Submitting an order (e.g. via generate_order_submission commands or the HTTP client) whose OrderType falls through the explicit match arms — any variant other than Limit, StopMarket, StopLimit, MarketIfTouched, LimitIfTouched, TrailingStopMarket, and the other explicitly handled variants (Market, TrailingStopLimit if mapped).","commonSituations":"A strategy configured with avenue order types like MARKET_TO_LIMIT; an order-execution engine routing to Binance Futures with order types valid only on spot or other venues; a config typo or default producing an unmapped order type.","solutions":["Use a supported order type: Limit, Market, StopMarket, StopLimit, MarketIfTouched, LimitIfTouched, TrailingStopMarket.","If market-to-limit semantics are needed, emulate them in the strategy or use a different venue.","Check the strategy/config that constructs orders and restrict allowed order types for this venue."],"exampleFix":"// before\ninstrument_provider.orders.push(Order::limit_if_touched(...)) // unsupported on futures\n// after\ninstrument_provider.orders.push(Order::limit(...)) // or stop_limit with trigger","handlingStrategy":"validation","validationCode":"const FUTURES_SUPPORTED: &[OrderType] = &[\n    OrderType::Market, OrderType::Limit, OrderType::StopMarket, OrderType::StopLimit,\n    OrderType::MarketIfTouched, OrderType::LimitIfTouched, OrderType::TrailingStopMarket,\n];\nassert!(FUTURES_SUPPORTED.contains(&order.order_type()), \"unsupported: {:?}\", order.order_type());","typeGuard":null,"tryCatchPattern":"match client.submit_order(order).await {\n    Err(e) if e.to_string().contains(\"Unsupported order type\") => {\n        tracing::warn!(\"order type {:?} not supported on Binance Futures, skipping\", order.order_type());\n    }\n    r => r?,\n}","preventionTips":["Restrict strategy configs to venue-supported order types.","Validate order types at strategy startup, not at submission time.","Keep an allowlist of order types per venue in your config loader."],"tags":["order-type","unsupported","binance-futures","orders"],"backgroundTag":"unsupported-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}