{"record":{"id":"f3498ccb5ef8ed16","repo":"nautechsystems/nautilus_trader","slug":"unsupported-trigger-order-type-for-derive-other","errorCode":null,"errorMessage":"unsupported trigger order type for Derive: {other:?}; supported types are StopMarket, StopLimit, MarketIfTouched, and LimitIfTouched","messagePattern":"unsupported trigger order type for Derive: (.+?); supported types are StopMarket, StopLimit, MarketIfTouched, and LimitIfTouched","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/derive/src/common/parse.rs","lineNumber":137,"sourceCode":"/// Returns an error for order types Derive does not accept.\npub fn order_type_to_derive(order_type: OrderType) -> anyhow::Result<DeriveOrderType> {\n    match order_type {\n        OrderType::Limit => Ok(DeriveOrderType::Limit),\n        OrderType::Market => Ok(DeriveOrderType::Market),\n        other => anyhow::bail!(\"unsupported order type for Derive: {other:?}\"),\n    }\n}\n\n/// Maps a supported Nautilus trigger order type to the child Derive order type.\n///\n/// # Errors\n///\n/// Returns an error for order types not supported by Derive trigger orders.\npub fn trigger_order_type_to_derive(order_type: OrderType) -> anyhow::Result<DeriveOrderType> {\n    match order_type {\n        OrderType::StopMarket | OrderType::MarketIfTouched => Ok(DeriveOrderType::Market),\n        OrderType::StopLimit | OrderType::LimitIfTouched => Ok(DeriveOrderType::Limit),\n        other => anyhow::bail!(\n            \"unsupported trigger order type for Derive: {other:?}; supported types are StopMarket, StopLimit, MarketIfTouched, and LimitIfTouched\"\n        ),\n    }\n}\n\n/// Maps a Nautilus trigger order type to Derive's stop-loss/take-profit flag.\n///\n/// # Errors\n///\n/// Returns an error for order types not supported by Derive trigger orders.\npub fn trigger_type_to_derive(order_type: OrderType) -> anyhow::Result<DeriveTriggerType> {\n    match order_type {\n        OrderType::StopMarket | OrderType::StopLimit => Ok(DeriveTriggerType::Stoploss),\n        OrderType::MarketIfTouched | OrderType::LimitIfTouched => Ok(DeriveTriggerType::Takeprofit),\n        other => anyhow::bail!(\n            \"unsupported trigger order type for Derive: {other:?}; supported types are StopMarket, StopLimit, MarketIfTouched, and LimitIfTouched\"\n        ),\n    }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/derive/src/common/parse.rs#L119-L155","documentation":"Derive trigger orders only support four Nautilus order types: StopMarket, StopLimit, MarketIfTouched, and LimitIfTouched (mapped to Derive Market or Limit child orders). `trigger_order_type_to_derive` rejects any other OrderType passed as a trigger order.","triggerScenarios":"Building a Derive trigger payload (`trigger_order_to_derive_payload`) or validating trigger support (`validate_trigger_order_support`) with a Nautilus order type outside the supported four — e.g. a TrailingStopMarket or a plain Limit passed to the trigger path.","commonSituations":"Strategies that use trailing stops or exotic conditional orders being routed to Derive; generic order-construction helpers that pass arbitrary order types into the trigger conversion; misunderstanding that only stop/touch orders qualify as Derive triggers.","solutions":["Restrict Derive trigger orders to StopMarket, StopLimit, MarketIfTouched, or LimitIfTouched","Call `validate_trigger_order_support` before submission to fail fast with a clear message","Use `order_type_to_derive` + plain payload path for non-trigger Limit/Market orders instead"],"exampleFix":"// before\nlet t = trigger_order_type_to_derive(OrderType::TrailingStopMarket)?; // errors\n// after\nlet t = trigger_order_type_to_derive(OrderType::StopMarket)?; // supported","handlingStrategy":"validation","validationCode":"fn is_derive_trigger_type(t: OrderType) -> bool {\n    matches!(t, OrderType::StopMarket | OrderType::StopLimit | OrderType::MarketIfTouched | OrderType::LimitIfTouched)\n}","typeGuard":"fn is_derive_trigger_type(t: OrderType) -> bool {\n    matches!(t, OrderType::StopMarket | OrderType::StopLimit | OrderType::MarketIfTouched | OrderType::LimitIfTouched)\n}","tryCatchPattern":"match trigger_order_type_to_derive(order.order_type()) {\n    Ok(t) => { /* build trigger payload */ }\n    Err(e) => tracing::warn!(%e, \"order type not eligible as Derive trigger\"),\n}","preventionTips":["Restrict Derive trigger orders to the four supported types","Run validate_trigger_order_support in the pre-trade path","Use plain Limit/Market orders (order_type_to_derive) for non-trigger types"],"tags":["rust","derive","orders","triggers","unsupported"],"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"}