{"record":{"id":"f4f4f50b666c1c75","repo":"nautechsystems/nautilus_trader","slug":"price-match-cannot-be-combined-with-post-only-orde","errorCode":null,"errorMessage":"price_match cannot be combined with post-only orders","messagePattern":"price_match cannot be combined with post-only orders","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":3678,"sourceCode":"            \"`close_position` requires `reduce_only=true` on the Nautilus order\"\n        );\n        anyhow::ensure!(\n            matches!(\n                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    )?;","sourceCodeStart":3660,"sourceCodeEnd":3696,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L3660-L3696","documentation":"Binance's `priceMatch` feature (activation by trailing price distance) is incompatible with post-only (GTX) orders, because a price-matched order can cross the book. If the `price_match` param is present and the Nautilus order is post-only, `validate_order` rejects the submission.","triggerScenarios":"Submitting a limit order to Binance futures with `params.price_match = \"...\"` (e.g. \"OPPONENT\" or a numeric distance) while the order was created with `post_only=true` (e.g. `Limit` order with `TimeInForce::Gtx` / post_only factory flag).","commonSituations":"Combining maker-only strategy config with price-match trailing activation; a strategy framework that globally sets post_only on all limit orders; copying params blocks between orders.","solutions":["Set `post_only=false` on the order when using `price_match`.","Remove the `price_match` param to keep the post-only limit order.","Use `time_in_force` and regular limit pricing instead of price_match for maker entries."],"exampleFix":"// before\nlet order = factory.limit(..., post_only=true);\nparams.insert(\"price_match\", \"OPPONENT\");\n// after\nlet order = factory.limit(..., post_only=false);\nparams.insert(\"price_match\", \"OPPONENT\");","handlingStrategy":"validation","validationCode":"fn check_price_match_post_only(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.is_post_only() {\n        return Err(\"price_match cannot be combined with post-only\".into());\n    }\n    Ok(())\n}","typeGuard":"fn price_match_ok(order: &OrderAny, params: &Option<NautilusParams>) -> bool {\n    params.as_ref().and_then(|p| p.get_str(\"price_match\")).is_none() || !order.is_post_only()\n}","tryCatchPattern":"match client.submit_order(cmd).await {\n    Err(e) if e.to_string().contains(\"price_match cannot be combined\") => {\n        // disable post_only or remove price_match, then resubmit\n    }\n    other => other?,\n}","preventionTips":["Never enable global post_only on limit orders if any venue params include price_match.","Keep maker-only and price-match strategies as separate order configurations.","Review params maps copied between orders for leftover price_match keys."],"tags":["binance","price-match","post-only","order-validation"],"backgroundTag":"mutually-exclusive-options","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"}