{"record":{"id":"da34b25d20d30cbb","repo":"nautechsystems/nautilus_trader","slug":"price-match-is-not-supported-for-order-type-order","errorCode":null,"errorMessage":"price_match is not supported for order type {order_type:?}","messagePattern":"price_match is not supported for order type (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":3682,"sourceCode":"                order_type,\n                OrderType::StopMarket | OrderType::MarketIfTouched\n            ),\n            \"`close_position` is not supported for order type {order_type:?} on Binance\"\n        );\n    }\n\n    if let Some(price_match) = cmd\n        .params\n        .as_ref()\n        .and_then(|params| params.get_str(\"price_match\"))\n    {\n        BinancePriceMatch::from_param(price_match)?;\n        let order_type = order.order_type();\n        anyhow::ensure!(\n            !order.is_post_only(),\n            \"price_match cannot be combined with post-only orders\"\n        );\n        anyhow::ensure!(\n            order_type == OrderType::Limit,\n            \"price_match is not supported for order type {order_type:?}\"\n        );\n    }\n\n    let lifetime = determine_futures_order_lifetime(\n        client.product_type,\n        order.order_type(),\n        order.time_in_force(),\n        order.expire_time(),\n        order.is_post_only(),\n        client.config.use_gtd,\n        client.clock.get_time_ns(),\n    )?;\n    let (position_side, venue_position_id) = resolve_order_position_identity(\n        client.is_hedge_mode(),\n        client.config.use_position_ids,\n        order,","sourceCodeStart":3664,"sourceCodeEnd":3700,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L3664-L3700","documentation":"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.","triggerScenarios":"Submitting a `Market`, `StopMarket`, `StopLimit`, `MarketIfTouched`, or `LimitIfTouched` order with `params.price_match` set on a BinanceFuturesExecutionClient.","commonSituations":"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.","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."],"exampleFix":"// before\nlet order = factory.stop_market(...);\nparams.insert(\"price_match\", \"OPPONENT\");\n// after\nlet order = factory.stop_market(...);\n// price_match removed; use TrailingOffsetType::BasisPoints instead","handlingStrategy":"validation","validationCode":"fn check_price_match_type(order: &OrderAny, params: &Option<NautilusParams>) -> Result<(), String> {\n    let pm = params.as_ref().and_then(|p| p.get_str(\"price_match\"));\n    if pm.is_some() && order.order_type() != OrderType::Limit {\n        return Err(format!(\"price_match only valid on Limit, got {:?}\", order.order_type()));\n    }\n    Ok(())\n}","typeGuard":"fn price_match_applies(t: OrderType) -> bool { t == OrderType::Limit }","tryCatchPattern":"match client.submit_order(cmd).await {\n    Err(e) if e.to_string().contains(\"price_match is not supported\") => {\n        // remove price_match from params for non-limit orders\n    }\n    other => other?,\n}","preventionTips":["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."],"tags":["binance","price-match","order-type","order-validation"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}