{"record":{"id":"d78bc460451b7fc6","repo":"nautechsystems/nautilus_trader","slug":"bbo-side-type-and-bbo-level-are-only-supported","errorCode":null,"errorMessage":"`bbo_side_type` and `bbo_level` are only supported for Bybit linear and inverse products","messagePattern":"`bbo_side_type` and `bbo_level` are only supported for Bybit linear and inverse products","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/bybit/src/execution.rs","lineNumber":565,"sourceCode":"\n        match tif {\n            TimeInForce::Gtc => BybitTimeInForce::Gtc,\n            TimeInForce::Ioc => BybitTimeInForce::Ioc,\n            TimeInForce::Fok => BybitTimeInForce::Fok,\n            _ => BybitTimeInForce::Gtc,\n        }\n    }\n\n    fn validate_bbo_params(\n        order: &OrderAny,\n        product_type: BybitProductType,\n        tp_sl: &BybitTpSlParams,\n    ) -> anyhow::Result<()> {\n        if !tp_sl.has_bbo() {\n            return Ok(());\n        }\n\n        anyhow::ensure!(\n            matches!(\n                product_type,\n                BybitProductType::Linear | BybitProductType::Inverse\n            ),\n            \"`bbo_side_type` and `bbo_level` are only supported for Bybit linear and inverse products\"\n        );\n\n        let order_type = order.order_type();\n        anyhow::ensure!(\n            matches!(\n                order_type,\n                OrderType::Limit | OrderType::StopLimit | OrderType::LimitIfTouched\n            ),\n            \"`bbo_side_type` and `bbo_level` are not supported for order type {order_type:?}\"\n        );\n\n        Ok(())\n    }","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bybit/src/execution.rs#L547-L583","documentation":"Bybit's BBO (best-bid-or-offer) order trigger parameters are only defined for derivatives. validate_bbo_params rejects TP/SL params containing bbo_side_type/bbo_level when the instrument's product type is Spot or anything other than Linear/Inverse.","triggerScenarios":"Submitting or validating an order with bbo_side_type+bbo_level set while product_type is Spot (or Option, etc.).","commonSituations":"Reusing a TP/SL params template across spot and futures instruments; misconfigured instrument definition.","solutions":["Remove bbo_side_type/bbo_level for spot instruments","Use the correct instrument with BybitProductType::Linear or Inverse when BBO behavior is required","Check the product type of your instrument definition before attaching BBO params"],"exampleFix":"// before\nvalidate_bbo_params(BybitProductType::Spot, &order, &tp_sl)?; // panics/bails\n// after\nvalidate_bbo_params(BybitProductType::Linear, &order, &tp_sl)?;","handlingStrategy":"validation","validationCode":"if tp_sl.has_bbo() && !matches!(product_type, BybitProductType::Linear | BybitProductType::Inverse) {\n    // strip BBO params or switch instruments before submission\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = validate_bbo_params(product_type, &order, &tp_sl) {\n    tracing::warn!(\"BBO params rejected: {e}; resubmitting without BBO\");\n    tp_sl.bbo_side_type = None;\n    tp_sl.bbo_level = None;\n}","preventionTips":["Track product type per instrument and gate BBO features on it","Share TP/SL params only among instruments of the same product family","Add a pre-submit validation pass in your order pipeline"],"tags":["bybit","validation","orders","unsupported-feature"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}