nautechsystems/nautilus_trader · error · anyhow::Error
Failed to build edit order params: {e}
Error message
Failed to build edit order params: {e} What it means
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.
Source
Thrown at crates/adapters/kraken/src/http/futures/client.rs:2682
if let Some(ref id) = cli_ord_id {
builder.cli_ord_id(id.clone());
}
if let Some(qty) = quantity {
builder.size(qty.to_string());
}
if let Some(p) = price {
builder.limit_price(p.to_string());
}
if let Some(tp) = trigger_price {
builder.stop_price(tp.to_string());
}
builder
.build()
.map_err(|e| anyhow::anyhow!("Failed to build edit order params: {e}"))
}
}
pub(crate) fn is_futures_submit_rejection(status: &str) -> bool {
matches!(
status.parse::<KrakenSendStatus>(),
Ok(KrakenSendStatus::InsufficientAvailableFunds
| KrakenSendStatus::InvalidOrderType
| KrakenSendStatus::InvalidSize
| KrakenSendStatus::WouldCauseLiquidation
| KrakenSendStatus::PostWouldExecute
| KrakenSendStatus::ReduceOnlyWouldIncreasePosition)
)
}
fn is_futures_modify_rejection(status: &str) -> bool {
status.parse::<KrakenSendStatus>().is_ok_and(|status| {
status == KrakenSendStatus::NotFound || is_futures_submit_rejection(status.as_ref())View on GitHub (pinned to 18893faf8b)
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.
Example fix
// before builder.quantity(qty.to_string()).price(px.to_string()).stop_price(tp.to_string()); // stop price on a plain limit order // after builder.quantity(qty.to_string()).price(px.to_string()); // only amend supported fields
Defensive patterns
Strategy: validation
Validate before calling
assert!(px % instrument.price_increment == 0, "edit price off tick"); assert!(qty % instrument.size_step == 0, "edit quantity off step");
Try / catch
let params = build_edit_order_params(...).context("preparing Kraken Futures edit params")?; Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Failed to build order params: {e}
- limit_price is required for batch order type {order_type:?}
- Conditional order type {order_type:?} requires trigger_price
- Failed to get open orders: {error_msg}
- get_open_orders failed: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/3184e19d0f2b9e04.
Report an issue: GitHub.