{"record":{"id":"1abe3532c542da6a","repo":"nautechsystems/nautilus_trader","slug":"unsupported-trigger-price-type-for-derive-indexpr","errorCode":null,"errorMessage":"unsupported trigger price type for Derive: IndexPrice; Derive currently accepts only MarkPrice for trigger orders","messagePattern":"unsupported trigger price type for Derive: IndexPrice; Derive currently accepts only MarkPrice for trigger orders","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/derive/src/common/parse.rs","lineNumber":169,"sourceCode":"        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    }\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,","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/derive/src/common/parse.rs#L151-L187","documentation":"Derive trigger orders can only reference the Mark price as the trigger source. `trigger_price_type_to_derive` accepts `TriggerType::Default` or `TriggerType::MarkPrice` (both mapped to Derive's Mark) and explicitly rejects `TriggerType::IndexPrice` with this dedicated message, because the venue has no equivalent.","triggerScenarios":"Submitting a Derive trigger order whose Nautilus order specifies `trigger_type = TriggerType::IndexPrice` — e.g. a stop that the strategy configured to fire on the index price rather than the mark price.","commonSituations":"Strategies written for venues that support index-price triggers being reused against Derive; config files copied from another venue adapter that set IndexPrice as the trigger source.","solutions":["Change the order's trigger type to `TriggerType::MarkPrice` (or leave Default, which maps to Mark)","Add `validate_trigger_order_support` to pre-submission checks so the mismatch is caught before the venue call","Rework the strategy trigger condition to evaluate index-price logic locally and send plain orders when the condition hits"],"exampleFix":"// before\nTriggerType::IndexPrice // rejected by Derive\n// after\nTriggerType::MarkPrice // accepted, maps to DeriveTriggerPriceType::Mark","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(pt) => { /* build payload */ }\n    Err(e) => tracing::warn!(%e, \"trigger price source unsupported on Derive\"),\n}","preventionTips":["Default Derive trigger orders to TriggerType::MarkPrice","Pre-validate trigger type with validate_trigger_order_support","Keep IndexPrice-triggered logic in the strategy layer"],"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"}