{"record":{"id":"464bade174f88f0e","repo":"nautechsystems/nautilus_trader","slug":"failed-e-464bad","errorCode":null,"errorMessage":"{FAILED}: {e}","messagePattern":"\\{FAILED\\}: \\{e\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/model/src/orders/trailing_stop_market.rs","lineNumber":234,"sourceCode":"            time_in_force,\n            expire_time,\n            reduce_only,\n            quote_quantity,\n            display_qty,\n            emulation_trigger,\n            trigger_instrument_id,\n            contingency_type,\n            order_list_id,\n            linked_order_ids,\n            parent_order_id,\n            exec_algorithm_id,\n            exec_algorithm_params,\n            exec_spawn_id,\n            tags,\n            init_id,\n            ts_init,\n        )\n        .unwrap_or_else(|e| panic!(\"{FAILED}: {e}\"))\n    }\n\n    #[must_use]\n    pub fn has_activation_price(&self) -> bool {\n        self.activation_price.is_some()\n    }\n\n    pub fn set_activated(&mut self) {\n        debug_assert!(!self.is_activated, \"double activation\");\n        self.is_activated = true;\n    }\n}\n\nimpl PartialEq for TrailingStopMarketOrder {\n    fn eq(&self, other: &Self) -> bool {\n        self.client_order_id == other.client_order_id\n    }\n}","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/model/src/orders/trailing_stop_market.rs#L216-L252","documentation":"This panic occurs in the constructor of a trailing stop market order (new) when the inner builder/constructor function returns an Err. The message wraps the underlying validation error text, prefixed with FAILED. It means the order parameters (prices, quantities, IDs, timestamps, etc.) failed domain validation, so the constructor aborts the process with a panic rather than returning a Result.","triggerScenarios":"Calling TrailingStopMarketOrder::new (or its Python binding) with invalid parameters such as a non-positive quantity, malformed price strings, mismatched instrument/venue IDs, activation_price with no trailing offset, or any rule-violating field that makes the internal from_parts-style constructor return Err.","commonSituations":"Feeding unvalidated user or exchange data into order construction; passing strings with wrong precision for prices; supplying an init_id/ts_init of zero or invalid instrument_id; building orders from deserialized JSON with missing or malformed fields.","solutions":["Inspect the wrapped {e} message to see which domain validation failed","Validate the price, quantity, instrument_id, activation_price and trailing offset against the instrument's precision/size rules before calling new","Ensure all identifier fields (trader_id, strategy_id, instrument_id, client_order_id) are valid and non-default","If constructing from external input, parse into Price/Quantity/Money types first so precision errors surface before order creation"],"exampleFix":"// before\nlet order = TrailingStopMarketOrder::new(/* unchecked raw values */).expect(\"valid\");\n// after\nlet quantity = Quantity::new(qty, instrument.size_precision())?;\nlet price = Price::new(trigger_px, instrument.price_precision())?;\nlet order = TrailingStopMarketOrder::new(/* validated Price/Quantity and IDs */)\n    .unwrap_or_else(|e| log::error!(\"order creation failed: {e}\"));","handlingStrategy":"validation","validationCode":"fn is_valid_order_input(instrument: &InstrumentAny, qty: f64, price: f64, activation: Option<f64>) -> bool {\n    qty > 0.0\n        && qty >= instrument.size_increment().as_f64()\n        && (activation.is_none() || activation.unwrap() > 0.0)\n        && price > 0.0\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Parse raw values into Price/Quantity/Money domain types before constructing the order","Validate activation price and trailing offset rules for the instrument","Check instrument precision and size increment compliance before calling new","Log and reject invalid order input at the strategy layer before reaching the constructor"],"tags":["rust","order-validation","panic","trading"],"backgroundTag":"invalid-constructor-argument","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"}