{"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":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":2568,"sourceCode":"            ) {\n                anyhow::bail!(\n                    \"`close_position` is not supported for order type {order_type:?} on Binance\"\n                );\n            }\n\n            if order.is_reduce_only() {\n                anyhow::bail!(\"`close_position` cannot be combined with `reduce_only` on Binance\");\n            }\n        }\n\n        if let Some(pm_str) = cmd.params.as_ref().and_then(|p| p.get_str(\"price_match\")) {\n            BinancePriceMatch::from_param(pm_str)?;\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            self.product_type,\n            order.order_type(),\n            order.time_in_force(),\n            order.expire_time(),\n            order.is_post_only(),\n            self.config.use_gtd,\n            self.clock.get_time_ns(),\n        )?;\n\n        log::debug!(\"OrderSubmitted client_order_id={}\", order.client_order_id());\n        self.emitter.emit_order_submitted(&order);\n","sourceCodeStart":2550,"sourceCodeEnd":2586,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/execution.rs#L2550-L2586","documentation":"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.","triggerScenarios":"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.","commonSituations":"Reusing a params template across order factories; strategy code that applies price_match unconditionally to all orders.","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"],"exampleFix":"// before — price_match on a MARKET order\n// order_type = OrderType::Market; params: price_match = \"OPP\"\n\n// after — price_match is LIMIT-only\n// order_type = OrderType::Limit; params: price_match = \"OPP\"","handlingStrategy":"validation","validationCode":"// Before submit_order()\nif params.get_str(\"price_match\").is_some() {\n    assert_eq!(order.order_type(), OrderType::Limit, \"price_match is LIMIT-only\");\n}","typeGuard":"fn price_match_type_ok(has_price_match: bool, order_type: OrderType) -> bool {\n    !has_price_match || order_type == OrderType::Limit\n}","tryCatchPattern":"On this local rejection, resubmit the order as LIMIT or drop the price_match param.","preventionTips":["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"],"tags":["binance","futures","price-match","order-validation","rust"],"backgroundTag":"unsupported-order-parameter","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}