nautechsystems/nautilus_trader · error · anyhow::Error

Failed to build order params: {e}

Error message

Failed to build order params: {e}

What it means

Raised when the KrakenFuturesOrderParams builder's build() fails after assembling order fields from a Nautilus order. It means one or more order attributes (price, quantity, trigger signals, reduce-only flags) produced an invalid parameter combination for Kraken Futures.

Source

Thrown at crates/adapters/kraken/src/http/futures/client.rs:2026

                if let Some(limit) = price {
                    builder.limit_price(limit.to_string());
                }
            }
            _ => {
                if let Some(limit) = price {
                    builder.limit_price(limit.to_string());
                }
            }
        }

        if reduce_only {
            builder.reduce_only(true);
        }

        builder
            .build()
            .map_err(|e| anyhow::anyhow!("Failed to build order params: {e}"))
    }

    /// Submits a new order to the Kraken Futures exchange.
    ///
    /// # Errors
    ///
    /// Returns an error if:
    /// - Credentials are missing.
    /// - The instrument is not found in cache.
    /// - The order type or time in force is not supported.
    /// - The request fails.
    /// - The order is rejected.
    #[expect(clippy::too_many_arguments)]
    pub async fn submit_order(
        &self,
        account_id: AccountId,
        instrument_id: InstrumentId,
        client_order_id: ClientOrderId,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Read the wrapped error to see which parameter failed validation.
  2. Confirm the order's trigger signal type is supported by Kraken Futures (see test_build_send_order_params_maps_supported_trigger_signals).
  3. Verify price/quantity precision matches the instrument's tick/step size.
  4. Check that order type, time-in-force, and contingency fields form a valid combination for Kraken Futures.

Example fix

// before
let order = order_factory.limit( instrument_id, Side::Buy, qty_from_f64(0.123456789), price_from_f64(1234.56789), ...); // precision mismatch
// after
let qty = Quantity::new(0.1, instrument.size_precision);
let price = Price::new(1234.5, instrument.price_precision);
Defensive patterns

Strategy: validation

Validate before calling

assert_eq!(order.quantity.precision, instrument.size_precision);
assert!(supported_trigger_signals().contains(&order.trigger_signal()));

Try / catch

let params = build_send_order_params(&order, &instrument)
    .context("preparing Kraken Futures order params")?; // fail before network call

Prevention

When it happens

Trigger: build_send_order_params is called by submit_order or send_order_batches and the builder validation rejects the assembled params — e.g. an unsupported trigger/contingency signal type on the order, or invalid price/quantity formatting.

Common situations: Submitting order types whose trigger signals Kraken Futures doesn't support (hence the paired tests for supported/unsupported trigger signals); stop/limit orders with missing or malformed prices; orders built with quantity precision Kraken rejects.

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


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/cbf662600cf5a357. Report an issue: GitHub.