{"record":{"id":"95bd4e457d475b59","repo":"nautechsystems/nautilus_trader","slug":"binance-only-supports-trailingoffsettype-basispoi","errorCode":null,"errorMessage":"Binance only supports TrailingOffsetType::BasisPoints, received {offset_type:?}","messagePattern":"Binance only supports TrailingOffsetType::BasisPoints, received (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":2528,"sourceCode":"        self.core.set_disconnected();\n        log::info!(\"Stopped: client_id={}\", self.core.client_id);\n        Ok(())\n    }\n\n    fn submit_order(&self, cmd: SubmitOrder) -> anyhow::Result<()> {\n        let order = self.core.cache().try_order_owned(&cmd.client_order_id)?;\n\n        if order.is_closed() {\n            let client_order_id = order.client_order_id();\n            log::warn!(\"Cannot submit closed order {client_order_id}\");\n            return Ok(());\n        }\n\n        // Validate before submission (Initialized -> Denied is valid,\n        // but Submitted -> Denied is not, so validate before emitting OrderSubmitted)\n        if let Some(offset_type) = order.trailing_offset_type() {\n            if offset_type != TrailingOffsetType::BasisPoints {\n                anyhow::bail!(\n                    \"Binance only supports TrailingOffsetType::BasisPoints, received {offset_type:?}\"\n                );\n            }\n\n            if let Some(offset) = order.trailing_offset() {\n                trailing_offset_to_callback_rate(offset)?;\n            }\n        }\n\n        let close_position = cmd\n            .params\n            .as_ref()\n            .and_then(|p| p.get_bool(\"close_position\"))\n            .unwrap_or(false);\n\n        if close_position {\n            let order_type = order.order_type();\n","sourceCodeStart":2510,"sourceCodeEnd":2546,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/execution.rs#L2510-L2546","documentation":"Binance Futures TRAILING_STOP_MARKET orders express the trailing distance only as a callback rate in basis points (the callbackRate parameter). Before submission the adapter inspects the cached order and rejects it locally if trailing_offset_type is anything other than TrailingOffsetType::BasisPoints (e.g. Price or Percent), so no invalid request reaches the venue.","triggerScenarios":"A strategy submits a trailing stop market (or trailing stop limit) order built with trailing_offset_type = TrailingOffsetType::Price or TrailingOffsetType::Percent to the Binance Futures execution client.","commonSituations":"Strategies ported from venues that support price/percent trailing offsets; order templates reused across adapters; manually specifying TrailingOffsetType when porting strategy code.","solutions":["Build trailing orders with TrailingOffsetType::BasisPoints and a trailing_offset in basis points (e.g. 100 = 1%)","Convert a desired absolute-price or percent offset into basis points before creating the order","If true price-based trailing is required, emulate it strategy-side by moving STOP_MARKET trigger prices instead"],"exampleFix":"// before — trailing offset expressed as an absolute price\n// TrailingStopMarketOrder::new(..., TrailingOffsetType::Price, trailing_offset: dec!(150), ...)\n\n// after — Binance accepts basis-point callback rates only (100 bp = 1%)\n// TrailingStopMarketOrder::new(..., TrailingOffsetType::BasisPoints, trailing_offset: dec!(100), ...)","handlingStrategy":"validation","validationCode":"// Guard before submit_order()\nif matches!(order.order_type(), OrderType::TrailingStopMarket | OrderType::TrailingStopLimit) {\n    if let Some(t) = order.trailing_offset_type() {\n        assert_eq!(t, TrailingOffsetType::BasisPoints, \"Binance supports basis-point trailing only\");\n    }\n}","typeGuard":"fn trailing_supported_on_binance(order: &OrderAny) -> bool {\n    order\n        .trailing_offset_type()\n        .is_none_or(|t| t == TrailingOffsetType::BasisPoints)\n}","tryCatchPattern":"Subscribe to order denied/rejected events: this validation denies the order before submission; log the order's trailing_offset_type and fix the order factory configuration.","preventionTips":["Standardize on BasisPoints trailing offsets in strategy code that trades Binance","Unit-test that Binance-bound trailing orders carry TrailingOffsetType::BasisPoints","Document per-venue trailing offset support next to strategy config"],"tags":["binance","futures","trailing-stop","order-validation","rust"],"backgroundTag":"unsupported-order-parameter","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}