{"record":{"id":"3184e19d0f2b9e04","repo":"nautechsystems/nautilus_trader","slug":"failed-to-build-edit-order-params-e","errorCode":null,"errorMessage":"Failed to build edit order params: {e}","messagePattern":"Failed to build edit order params: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/http/futures/client.rs","lineNumber":2682,"sourceCode":"        if let Some(ref id) = cli_ord_id {\n            builder.cli_ord_id(id.clone());\n        }\n\n        if let Some(qty) = quantity {\n            builder.size(qty.to_string());\n        }\n\n        if let Some(p) = price {\n            builder.limit_price(p.to_string());\n        }\n\n        if let Some(tp) = trigger_price {\n            builder.stop_price(tp.to_string());\n        }\n\n        builder\n            .build()\n            .map_err(|e| anyhow::anyhow!(\"Failed to build edit order params: {e}\"))\n    }\n}\n\npub(crate) fn is_futures_submit_rejection(status: &str) -> bool {\n    matches!(\n        status.parse::<KrakenSendStatus>(),\n        Ok(KrakenSendStatus::InsufficientAvailableFunds\n            | KrakenSendStatus::InvalidOrderType\n            | KrakenSendStatus::InvalidSize\n            | KrakenSendStatus::WouldCauseLiquidation\n            | KrakenSendStatus::PostWouldExecute\n            | KrakenSendStatus::ReduceOnlyWouldIncreasePosition)\n    )\n}\n\nfn is_futures_modify_rejection(status: &str) -> bool {\n    status.parse::<KrakenSendStatus>().is_ok_and(|status| {\n        status == KrakenSendStatus::NotFound || is_futures_submit_rejection(status.as_ref())","sourceCodeStart":2664,"sourceCodeEnd":2700,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/http/futures/client.rs#L2664-L2700","documentation":"Raised when the Kraken Futures edit-order params builder's build() fails after assembling amended fields (price, quantity, trigger/stop price). The requested modification forms an invalid parameter set for the venue.","triggerScenarios":"The edit-order param builder is invoked (via the client's modify/edit order path) and builder.build() rejects the combination — e.g. both price and stop_price updated to invalid values, empty amend with no changeable fields, or malformed Decimal formatting.","commonSituations":"Modifying an order to a price/quantity that violates instrument precision; trying to amend fields not allowed for that order type; passing a trigger price on a non-trigger order.","solutions":["Read the wrapped error for the specific invalid field.","Ensure amended price/quantity respect the instrument's price_increment and size_step.","Only pass the fields you intend to change; avoid setting stop_price on order types without triggers.","If the order type can't be amended, cancel and resubmit instead."],"exampleFix":"// before\nbuilder.quantity(qty.to_string()).price(px.to_string()).stop_price(tp.to_string()); // stop price on a plain limit order\n// after\nbuilder.quantity(qty.to_string()).price(px.to_string()); // only amend supported fields","handlingStrategy":"validation","validationCode":"assert!(px % instrument.price_increment == 0, \"edit price off tick\");\nassert!(qty % instrument.size_step == 0, \"edit quantity off step\");","typeGuard":null,"tryCatchPattern":"let params = build_edit_order_params(...).context(\"preparing Kraken Futures edit params\")?;","preventionTips":["Round amended prices/quantities to instrument precision before editing.","Only amend fields valid for the order type; cancel-and-replace otherwise.","Skip the edit entirely if no fields actually changed."],"tags":["orders","edit","validation","kraken","futures"],"backgroundTag":"invalid-argument-value","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"}