{"record":{"id":"c7dc82faff8bd6a3","repo":"nautechsystems/nautilus_trader","slug":"binance-futures-gtd-cannot-be-post-only","errorCode":null,"errorMessage":"Binance Futures GTD cannot be post-only","messagePattern":"Binance Futures GTD cannot be post-only","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":1179,"sourceCode":"\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\"\n    );\n\n    let minimum_ns = ts_now\n        .as_u64()\n        .checked_add(BINANCE_GTD_MIN_LEAD_SECS * NANOSECONDS_IN_SECOND)\n        .context(\"Binance Futures GTD minimum timestamp overflow\")?;\n    anyhow::ensure!(","sourceCodeStart":1161,"sourceCodeEnd":1197,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/execution.rs#L1161-L1197","documentation":"The Binance futures native GTD path rejects post-only orders: a goodTillDate expiry combined with post_only is not a supported combination on the venue, so the lifetime resolution fails before submission. The guard runs after the order-type check and before the product-type check in the same function, and like the others only applies when manage_gtd_expiry (use_gtd) is enabled on the submitting strategy.","triggerScenarios":"Submitting a Limit order with TimeInForce::Gtd, an expire_time, and post_only=true from a strategy with manage_gtd_expiry enabled — e.g. a market-making strategy that defaulted post_only on all quoting orders while also setting expiries.","commonSituations":"Market-making configs that globally enable post_only; strategies combining expiry management with maker-only quoting for the first time.","solutions":["Disable post_only on GTD orders","Drop the expiry (use plain Gtc post-only) if maker-only behavior matters more than the expiry","Or disable manage_gtd_expiry so GTD downgrades to GTC post-only instead of erroring"],"exampleFix":"// before\nlet order = Order::limit(instrument_id, side, qty, price)\n    .time_in_force(TimeInForce::Gtd).expire_time(expiry).post_only(true);\n\n// after\nlet order = Order::limit(instrument_id, side, qty, price)\n    .time_in_force(TimeInForce::Gtd).expire_time(expiry).post_only(false);","handlingStrategy":"validation","validationCode":"use nautilus_model::enums::TimeInForce;\n\nif order.time_in_force() == TimeInForce::Gtd && strategy.manage_gtd_expiry {\n    anyhow::ensure!(!order.post_only(), \"GTD + post_only rejected by Binance Futures\");\n}","typeGuard":"fn gtd_post_only_ok(order: &OrderAny) -> bool {\n    !(order.time_in_force() == TimeInForce::Gtd && order.post_only())\n}","tryCatchPattern":null,"preventionTips":["Keep quoting (post_only) and expiry (GTD) as separate order templates","Assert TIF/post_only combinations in strategy unit tests before deployment"],"tags":["binance-futures","gtd","post-only","time-in-force","rust"],"backgroundTag":"good-till-date-validation","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}