{"record":{"id":"c68371615a96b961","repo":"nautechsystems/nautilus_trader","slug":"unsupported-trigger-price-type-for-derive-other","errorCode":null,"errorMessage":"unsupported trigger price type for Derive: {other:?}; Derive trigger orders support only MarkPrice","messagePattern":"unsupported trigger price type for Derive: (.+?); Derive trigger orders support only MarkPrice","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/derive/src/common/parse.rs","lineNumber":172,"sourceCode":"        ),\n    }\n}\n\n/// Maps Nautilus trigger price source to Derive.\n///\n/// # Errors\n///\n/// Returns an error unless the trigger source maps to mark price, which is the\n/// only source Derive currently accepts for trigger orders.\npub fn trigger_price_type_to_derive(\n    trigger_type: Option<TriggerType>,\n) -> anyhow::Result<DeriveTriggerPriceType> {\n    match trigger_type {\n        Some(TriggerType::Default | TriggerType::MarkPrice) => Ok(DeriveTriggerPriceType::Mark),\n        Some(TriggerType::IndexPrice) => anyhow::bail!(\n            \"unsupported trigger price type for Derive: IndexPrice; Derive currently accepts only MarkPrice for trigger orders\"\n        ),\n        Some(other) => anyhow::bail!(\n            \"unsupported trigger price type for Derive: {other:?}; Derive trigger orders support only MarkPrice\"\n        ),\n        None => anyhow::bail!(\n            \"missing trigger price type for Derive trigger order; Derive trigger orders support only MarkPrice\"\n        ),\n    }\n}\n\n/// Maps a Nautilus time-in-force flag to the Derive TIF.\n///\n/// # Errors\n///\n/// Returns an error for time-in-force flags Derive does not accept.\npub fn time_in_force_to_derive(\n    tif: TimeInForce,\n    post_only: bool,\n) -> anyhow::Result<DeriveTimeInForce> {\n    match tif {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/derive/src/common/parse.rs#L154-L190","documentation":"Derive trigger orders support only the Mark price as trigger source. This is the catch-all arm of `trigger_price_type_to_derive`: any `TriggerType` other than Default/MarkPrice/IndexPrice is rejected with this message naming the offending value.","triggerScenarios":"Passing an exotic TriggerType variant (e.g. LastPrice, BidAskPrice-type variants) into `trigger_price_type_to_derive` via `DeriveTriggerFields` or `validate_trigger_order_support` when building a Derive trigger order.","commonSituations":"Strategies using venue-specific trigger sources like last-trade price that have no Derive equivalent; newly added Nautilus TriggerType variants not yet handled by the Derive adapter.","solutions":["Use `TriggerType::MarkPrice` (or Default) for Derive trigger orders","Pre-validate with `validate_trigger_order_support` and route orders with other trigger types to a different venue or plain-order logic","Update the adapter if a new TriggerType variant should map to Mark price"],"exampleFix":"// before\nTriggerType::LastPrice // rejected\n// after\nTriggerType::MarkPrice // accepted for Derive triggers","handlingStrategy":"validation","validationCode":"fn is_derive_trigger_price(t: TriggerType) -> bool { matches!(t, TriggerType::Default | TriggerType::MarkPrice) }","typeGuard":"fn is_derive_trigger_price(t: TriggerType) -> bool { matches!(t, TriggerType::Default | TriggerType::MarkPrice) }","tryCatchPattern":"match trigger_price_type_to_derive(order.trigger_type()) {\n    Ok(_) => { /* proceed */ }\n    Err(e) => tracing::warn!(%e, \"trigger source not mappable to Derive\"),\n}","preventionTips":["Constrain trigger sources to MarkPrice for Derive","Catch new TriggerType variants in adapter updates","Validate trigger type before payload construction"],"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"}