{"record":{"id":"6f72d3c8aee14ae8","repo":"nautechsystems/nautilus_trader","slug":"binance-futures-does-not-support-gtd-for-order-typ","errorCode":null,"errorMessage":"Binance Futures does not support GTD for order type {order_type:?}","messagePattern":"Binance Futures does not support GTD for order type (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":1494,"sourceCode":") -> anyhow::Result<FuturesOrderLifetime> {\n    if time_in_force != TimeInForce::Gtd {\n        return Ok(FuturesOrderLifetime {\n            time_in_force,\n            good_till_date: None,\n        });\n    }\n\n    if !use_gtd {\n        log::warn!(\n            \"Binance Futures GTD submitted as GTC because use_gtd=false. Enable manage_gtd_expiry on the submitting strategy\"\n        );\n        return Ok(FuturesOrderLifetime {\n            time_in_force: TimeInForce::Gtc,\n            good_till_date: None,\n        });\n    }\n\n    anyhow::ensure!(\n        matches!(\n            order_type,\n            OrderType::Limit | OrderType::StopLimit | OrderType::LimitIfTouched\n        ),\n        \"Binance Futures does not support GTD for order type {order_type:?}\"\n    );\n    anyhow::ensure!(!post_only, \"Binance Futures GTD cannot be post-only\");\n\n    anyhow::ensure!(\n        product_type == BinanceProductType::UsdM,\n        \"Binance {product_type:?} Futures does not support native GTD\"\n    );\n\n    let expire_time = expire_time.context(\"Binance Futures GTD requires an expire_time\")?;\n    let expire_ns = expire_time.as_u64();\n    anyhow::ensure!(\n        expire_ns.is_multiple_of(NANOSECONDS_IN_SECOND),\n        \"Binance Futures goodTillDate requires whole-second precision\"","sourceCodeStart":1476,"sourceCodeEnd":1512,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L1476-L1512","documentation":"determine_futures_order_lifetime maps a GTD order into Binance Futures parameters, but native goodTillDate is only valid for limit-style order types (Limit, StopLimit, LimitIfTouched). Submitting GTD with any other order type (Market, StopMarket, TrailingStopMarket, etc.) is rejected because Binance cannot honor an expiry on those order types.","triggerScenarios":"validate_order or build_futures_order_list_batch called with TimeInForce=Gtd, use_gtd=true, and an order_type outside {Limit, StopLimit, LimitIfTouched} (e.g. a GTD market or stop-market order).","commonSituations":"Strategy configured with GTD defaults applied to all order types; porting equity-style GTD market orders to Binance Futures; automated schedulers tagging every order GTD regardless of type.","solutions":["Change the order type to Limit/StopLimit/LimitIfTouched if an expiry is truly required.","Use TimeInForce Gtc (or Ioc/Fok) for market and stop-market orders instead of GTD.","Enable manage_gtd_expiry on the submitting strategy or set use_gtd=false so GTD is emulated locally (mapped to GTC with local cancel).","Gate the strategy so GTD is only emitted for supported limit-style orders."],"exampleFix":"// before\norder_factory.market(instrument_id, Side::Buy, qty, TimeInForce::Gtd, expire_time);\n// after\norder_factory.limit(instrument_id, Side::Buy, price, qty, TimeInForce::Gtd, Some(expire_time));","handlingStrategy":"validation","validationCode":"const GTD_OK: &[OrderType] = &[OrderType::Limit, OrderType::StopLimit, OrderType::LimitIfTouched];\nif tif == TimeInForce::Gtd && use_gtd && !GTD_OK.contains(&order_type) {\n    // fall back to Gtc or change order type before submit\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only emit GTD for limit-style orders","Use manage_gtd_expiry for locally managed expiries","Configure strategy order templates per order type, not globally"],"tags":["gtd","time-in-force","order-type","binance-futures","unsupported"],"backgroundTag":"unsupported-operation","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"}