nautechsystems/nautilus_trader · error
Leverage {n}:1 not supported for {raw_symbol} on {side_label
Error message
Leverage {n}:1 not supported for {raw_symbol} on {side_label} side (valid: {valid_tiers:?}) What it means
When Kraken does offer leverage tiers for the symbol/side, they form a discrete set of allowed levels (e.g. [2, 3, 4, 5]). The adapter validates the requested leverage against these valid tiers and rejects levels not in the set, including the exact supported values in the message.
Source
Thrown at crates/adapters/kraken/src/http/spot/client.rs:3165
anyhow::anyhow!(
"Leverage tiers not loaded for {raw_symbol}; cannot validate leverage {n}:1 (instruments must be initialized before submitting margin orders)"
)
})?;
let valid_tiers = match order_side {
OrderSide::Buy => buy_tiers,
_ => sell_tiers,
};
let side_label = match order_side {
OrderSide::Buy => "buy",
_ => "sell",
};
if valid_tiers.is_empty() {
anyhow::bail!("Leverage not supported for {raw_symbol} on {side_label} side");
}
if !valid_tiers.contains(&(n as i32)) {
anyhow::bail!(
"Leverage {n}:1 not supported for {raw_symbol} on {side_label} side (valid: {valid_tiers:?})"
);
}
builder.leverage(format!("{n}:1"));
}
if reduce_only {
if account_type != AccountType::Margin {
anyhow::bail!("reduce_only requires spot_account_type=Margin (current: Cash)");
}
builder.reduce_only(true);
}
builder
.build()
.map_err(|e| anyhow::anyhow!("Failed to build order params: {e}"))
}
}View on GitHub (pinned to 18893faf8b)
Solutions
- Read the valid tiers from the error message and set leverage to one of the listed values.
- Query Kraken's current leverage tier data for the instrument before sizing leverage.
- Clamp/snap the strategy's desired leverage down to the nearest supported tier in order-construction logic.
Example fix
// before leverage: Some(10) // valid tiers: [2, 3, 5] // after leverage: Some(5)
Defensive patterns
Strategy: validation
Validate before calling
let valid: Vec<i32> = tiers_for(symbol, side);
let n = desired_leverage as i32;
if !valid.contains(&n) {
desired_leverage = *valid.iter().filter(|&&v| v <= n).max().unwrap_or(&1);
} Try / catch
match submit_result {
Err(e) if e.to_string().contains("not supported") && e.to_string().contains("valid:") => {
// parse valid tiers from the message and resubmit with a supported level
}
r => r?,
} Prevention
- Snap requested leverage to the nearest published Kraken tier before submitting.
- Never assume leverage levels are continuous across venues.
- Re-verify tiers after Kraken announcements of margin changes.
When it happens
Trigger: Submitting a Kraken Spot margin order with leverage Some(n) where n (as i32) is not contained in valid_tiers for the symbol and order side — e.g. requesting 10:1 when the instrument only allows up to 5:1 with steps of 2 and 3.
Common situations: Hard-coding a max leverage from another venue; assuming continuous leverage levels instead of Kraken's discrete tiers; a config upgrade after Kraken changed tier offerings.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- Leverage not supported for {raw_symbol} on {side_label} side
- leverage requires spot_account_type=Margin (current: Cash)
- Conditional orders require a trigger price
- Binance Spot order-book depth must be between 1 and 5000
- limit_price is required for batch order type {order_type:?}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/ad15e2322ec20de2.
Report an issue: GitHub.