{"record":{"id":"9aa5d9bc17b82fe7","repo":"nautechsystems/nautilus_trader","slug":"unsupported-order-type-other-for-deribit","errorCode":null,"errorMessage":"Unsupported order type {other:?} for Deribit","messagePattern":"Unsupported order type (.+?) for Deribit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/deribit/src/execution.rs","lineNumber":250,"sourceCode":"\n        if errors.is_empty() {\n            Ok(())\n        } else {\n            anyhow::bail!(errors.join(\"; \"))\n        }\n    }\n\n    // Rejects unsupported order types and time-in-force values\n    fn build_order_params(order: &dyn Order) -> anyhow::Result<DeribitOrderParams> {\n        let order_type = match order.order_type() {\n            OrderType::Limit => \"limit\",\n            OrderType::Market => \"market\",\n            OrderType::StopLimit => \"stop_limit\",\n            OrderType::StopMarket => \"stop_market\",\n            OrderType::LimitIfTouched => \"take_limit\",\n            OrderType::MarketIfTouched => \"take_market\",\n            other => {\n                anyhow::bail!(\"Unsupported order type {other:?} for Deribit\");\n            }\n        }\n        .to_string();\n\n        let time_in_force = if matches!(\n            order.order_type(),\n            OrderType::Market | OrderType::StopMarket | OrderType::MarketIfTouched\n        ) {\n            // Deribit rejects `time_in_force` on market-style order types\n            None\n        } else {\n            Some(\n                match order.time_in_force() {\n                    TimeInForce::Gtc => \"good_til_cancelled\",\n                    TimeInForce::Ioc => \"immediate_or_cancel\",\n                    TimeInForce::Fok => \"fill_or_kill\",\n                    TimeInForce::Gtd => {\n                        if order.expire_time().is_some() {","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/deribit/src/execution.rs#L232-L268","documentation":"build_order_params maps Nautilus OrderType values to Deribit order types. Only Market, Limit, StopLimit, StopMarket, LimitIfTouched, and MarketIfTouched are supported; any other OrderType (e.g. trailing variants) hits the catch-all arm and bails.","triggerScenarios":"Submitting an order whose order_type() is not one of Market/StopLimit/StopMarket/LimitIfTouched/MarketIfTouched/Limit — for example OrderType::LimitThatCatchesUp or trailing-stop types — via submit_order on the Deribit execution client.","commonSituations":"Strategy code written venue-agnostically issuing trailing-stop orders; portfolio-level order factories defaulting to an exotic order type; migration from another venue whose adapter maps more types.","solutions":["Use a supported OrderType: Market, Limit, StopMarket, StopLimit, MarketIfTouched, or LimitIfTouched","Emulate unsupported types (e.g. trailing stops) in strategy code or with Nautilus order emulation","Guard order submission with a match on order_type() before sending to Deribit"],"exampleFix":"// before\nlet order = factory.trailing_stop(...);\nexec_client.submit_order(&order)?;\n// after\nlet order = factory.stop_limit(...); // Deribit-supported type\nexec_client.submit_order(&order)?;","handlingStrategy":"type-guard","validationCode":"const SUPPORTED: &[OrderType] = &[\n    OrderType::Market, OrderType::Limit, OrderType::StopLimit,\n    OrderType::StopMarket, OrderType::LimitIfTouched, OrderType::MarketIfTouched,\n];\nif !SUPPORTED.contains(&order.order_type()) {\n    return Err(anyhow::anyhow!(\"{:#?} unsupported on Deribit\", order.order_type()));\n}","typeGuard":"fn deribit_supported(t: OrderType) -> bool {\n    matches!(t, OrderType::Market | OrderType::Limit | OrderType::StopLimit\n        | OrderType::StopMarket | OrderType::LimitIfTouched | OrderType::MarketIfTouched)\n}","tryCatchPattern":"match exec_client.submit_order(&order) {\n    Err(e) if e.to_string().contains(\"Unsupported order type\") => emulate_or_convert_order(&order),\n    other => other,\n}","preventionTips":["Restrict strategy order factories to Deribit-supported OrderTypes","Use Nautilus order emulation for trailing-stop style orders on Deribit","Add a startup-time config check rejecting unsupported order types per venue"],"tags":["order-type","execution","unsupported","rust","deribit"],"backgroundTag":"unsupported-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}