{"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":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":3640,"sourceCode":"                        }\n                    }\n                }\n            }\n\n            Ok(())\n        });\n\n        Ok(())\n    }\n}\n\nfn validate_order(\n    client: &BinanceFuturesExecutionClient,\n    cmd: &SubmitOrder,\n    order: &OrderAny,\n) -> anyhow::Result<ValidatedOrder> {\n    if let Some(offset_type) = order.trailing_offset_type() {\n        anyhow::ensure!(\n            offset_type == TrailingOffsetType::BasisPoints,\n            \"Binance only supports TrailingOffsetType::BasisPoints, received {offset_type:?}\"\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(|params| params.get_bool(PARAMS_CLOSE_POSITION))\n        .unwrap_or(false);\n\n    if close_position {\n        let order_type = order.order_type();\n        anyhow::ensure!(","sourceCodeStart":3622,"sourceCodeEnd":3658,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L3622-L3658","documentation":"Binance USDT-M futures trailing-stop orders only support callback rates expressed in basis points. During order validation in `validate_order`, if the Nautilus order carries a `trailing_offset_type` other than `TrailingOffsetType::BasisPoints`, the adapter rejects the submission with `anyhow::ensure!`. The offset must also be convertible to a valid Binance callback rate via `trailing_offset_to_callback_rate`.","triggerScenarios":"Submitting a `SubmitOrder` command for a trailing-stop/trailing-stop-market order to a BinanceFuturesExecutionClient where `order.trailing_offset_type()` is `Price`, `BasisPoints` is not set, or any variant other than `BasisPoints` (e.g. a trailing order built with a price-based offset for another venue and reused for Binance).","commonSituations":"Reusing a trailing-stop order definition written for a venue that supports price-based trailing offsets (e.g. Bybit/FTX-style absolute offsets) on Binance; routing a multi-venue strategy without per-venue offset configuration; mistakenly passing `trailing_offset_type=TrailingOffsetType::Price` with an absolute offset value.","solutions":["Change the order's trailing offset type to `TrailingOffsetType::BasisPoints` and express the offset in basis points (e.g. 50 bps = 0.5%).","Build trailing-stop orders per venue instead of reusing one order definition across venues.","Convert a price-based offset to basis points relative to the trigger/current price before submitting to Binance.","Verify with `trailing_offset_to_callback_rate` semantics that the basis-point offset falls within Binance's allowed callback-rate range."],"exampleFix":"// before\nlet order = OrderFactory::trailing_stop_market(...,\n    TrailingOffset::Price(Price::from(\"100.0\")),\n    TrailingOffsetType::Price);\n// after\nlet order = OrderFactory::trailing_stop_market(...,\n    TrailingOffset::BasisPoints(50),\n    TrailingOffsetType::BasisPoints);","handlingStrategy":"validation","validationCode":"fn can_submit_trailing(order: &OrderAny) -> Result<(), String> {\n    match order.trailing_offset_type() {\n        Some(t) if t == TrailingOffsetType::BasisPoints => Ok(()),\n        Some(t) => Err(format!(\"Binance needs BasisPoints trailing offset, got {t:?}\")),\n        None => Ok(()), // not a trailing order\n    }\n}","typeGuard":"fn is_binance_trailing(order: &OrderAny) -> bool {\n    matches!(order.trailing_offset_type(), Some(TrailingOffsetType::BasisPoints) | None)\n}","tryCatchPattern":"match client.submit_order(cmd).await {\n    Err(e) if e.to_string().contains(\"TrailingOffsetType\") => {\n        // reconfigure order to BasisPoints and resubmit\n    }\n    other => other?,\n}","preventionTips":["Configure trailing offsets per venue; Binance futures only accepts basis points.","Centralize order construction so offset type is set from venue capability config.","Unit-test adapter validation with a fake SubmitOrder before live routing."],"tags":["binance","trailing-stop","order-validation","unsupported-value"],"backgroundTag":"invalid-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"}