nautechsystems/nautilus_trader · error
price_match is not supported for order type
Error message
price_match is not supported for order type {order_type:?} What it means
Binance's `priceMatch` parameter is only accepted on `Limit` orders. `validate_order` ensures that whenever a `price_match` param is supplied (and parsed by `BinancePriceMatch::from_param`), the order type is exactly `OrderType::Limit`; any other order type is rejected before submission.
Solutions
- Only attach the `price_match` param to `OrderType::Limit` orders.
- Remove `price_match` from params for other order types.
- Use native trailing-stop order types (with basis-point offsets) instead of price_match for non-limit orders.
Example fix
// before
let order = factory.stop_market(...);
params.insert("price_match", "OPPONENT");
// after
let order = factory.stop_market(...);
// price_match removed; use TrailingOffsetType::BasisPoints instead Defensive patterns
Strategy: validation
Validate before calling
fn check_price_match_type(order: &OrderAny, params: &Option<NautilusParams>) -> Result<(), String> {
let pm = params.as_ref().and_then(|p| p.get_str("price_match"));
if pm.is_some() && order.order_type() != OrderType::Limit {
return Err(format!("price_match only valid on Limit, got {:?}", order.order_type()));
}
Ok(())
} Type guard
fn price_match_applies(t: OrderType) -> bool { t == OrderType::Limit } Try / catch
match client.submit_order(cmd).await {
Err(e) if e.to_string().contains("price_match is not supported") => {
// remove price_match from params for non-limit orders
}
other => other?,
} Prevention
- Attach price_match only to Limit orders.
- Strip venue-specific params when changing an order's type.
- Use native trailing-stop orders (basis-point offsets) for non-limit trailing behavior.
When it happens
Trigger: Submitting a `Market`, `StopMarket`, `StopLimit`, `MarketIfTouched`, or `LimitIfTouched` order with `params.price_match` set on a BinanceFuturesExecutionClient.
Common situations: Copy-pasting a params map containing `price_match` onto non-limit orders; a generic strategy layer that adds price_match for trailing behavior regardless of order type; changing an order from Limit to StopLimit while keeping params.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- `close_position` is not supported for order type
- price_match cannot be combined with post-only orders
- Algo order type requires a trigger price
- Binance only supports TrailingOffsetType::BasisPoints…
- `close_position` cannot be combined with `reduce_only` on…
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/da34b25d20d30cbb.
Report an issue: GitHub.
Appendix: source
Thrown at crates/adapters/binance/src/futures/execution.rs:3682
order_type,
OrderType::StopMarket | OrderType::MarketIfTouched
),
"`close_position` is not supported for order type {order_type:?} on Binance"
);
}
if let Some(price_match) = cmd
.params
.as_ref()
.and_then(|params| params.get_str("price_match"))
{
BinancePriceMatch::from_param(price_match)?;
let order_type = order.order_type();
anyhow::ensure!(
!order.is_post_only(),
"price_match cannot be combined with post-only orders"
);
anyhow::ensure!(
order_type == OrderType::Limit,
"price_match is not supported for order type {order_type:?}"
);
}
let lifetime = determine_futures_order_lifetime(
client.product_type,
order.order_type(),
order.time_in_force(),
order.expire_time(),
order.is_post_only(),
client.config.use_gtd,
client.clock.get_time_ns(),
)?;
let (position_side, venue_position_id) = resolve_order_position_identity(
client.is_hedge_mode(),
client.config.use_position_ids,
order,View on GitHub (pinned to 18893faf8b)