nautechsystems/nautilus_trader · error · anyhow::Error
price_match is not supported for order type {order_type:?}
Error message
price_match is not supported for order type {order_type:?} What it means
The priceMatch feature only applies to LIMIT orders on Binance Futures. When a price_match param is present on any other order type (MARKET, STOP_MARKET, ...), the adapter rejects the order locally before submission — no venue request is made.
Source
Thrown at crates/adapters/binance/src/futures/execution.rs:2568
) {
anyhow::bail!(
"`close_position` is not supported for order type {order_type:?} on Binance"
);
}
if order.is_reduce_only() {
anyhow::bail!("`close_position` cannot be combined with `reduce_only` on Binance");
}
}
if let Some(pm_str) = cmd.params.as_ref().and_then(|p| p.get_str("price_match")) {
BinancePriceMatch::from_param(pm_str)?;
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(
self.product_type,
order.order_type(),
order.time_in_force(),
order.expire_time(),
order.is_post_only(),
self.config.use_gtd,
self.clock.get_time_ns(),
)?;
log::debug!("OrderSubmitted client_order_id={}", order.client_order_id());
self.emitter.emit_order_submitted(&order);
View on GitHub (pinned to a4b06ed870)
Solutions
- Only set price_match on LIMIT orders
- Switch the order to LIMIT if opposite-side best-price matching is required
- Remove the price_match param for MARKET and stop-style orders
Example fix
// before — price_match on a MARKET order // order_type = OrderType::Market; params: price_match = "OPP" // after — price_match is LIMIT-only // order_type = OrderType::Limit; params: price_match = "OPP"
Defensive patterns
Strategy: validation
Validate before calling
// Before submit_order()
if params.get_str("price_match").is_some() {
assert_eq!(order.order_type(), OrderType::Limit, "price_match is LIMIT-only");
} Type guard
fn price_match_type_ok(has_price_match: bool, order_type: OrderType) -> bool {
!has_price_match || order_type == OrderType::Limit
} Try / catch
On this local rejection, resubmit the order as LIMIT or drop the price_match param.
Prevention
- Apply price_match only in LIMIT order factories
- Validate shared params templates against the order type before submission
- Add unit tests covering param/order-type matrices
When it happens
Trigger: SubmitOrder with params containing price_match on a non-LIMIT order type; the adapter checks the parsed BinancePriceMatch value against the order type before building the request.
Common situations: Reusing a params template across order factories; strategy code that applies price_match unconditionally to all orders.
Related errors
- price_match cannot be combined with post-only orders
- Binance only supports TrailingOffsetType::BasisPoints, recei
- `close_position` is not supported for order type {order_type
- `close_position` cannot be combined with `reduce_only` on Bi
- Order type {order_type:?} requires a trigger price
AI-assisted analysis of nautechsystems/nautilus_trader@a4b06ed870 (2026-08-16).
Data as JSON: /api/errors/da34b25d20d30cbb.
Report an issue: GitHub.