{"record":{"id":"fa080d999bac644d","repo":"nautechsystems/nautilus_trader","slug":"submitted-position-id-submitted-position-id-conf","errorCode":null,"errorMessage":"submitted position ID {submitted_position_id} conflicts with canonical Binance Futures venue position ID {venue_position_id}; omit position_id while use_position_ids=true, or set use_position_ids=false for virtual hedging","messagePattern":"submitted position ID (.+?) conflicts with canonical Binance Futures venue position ID (.+?); omit position_id while use_position_ids=true, or set use_position_ids=false for virtual hedging","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":1347,"sourceCode":") -> anyhow::Result<(Option<BinancePositionSide>, Option<PositionId>)> {\n    let position_side =\n        determine_position_side(is_hedge_mode, order.order_side(), order.is_reduce_only());\n    let venue_position_id = make_venue_position_id(\n        use_position_ids,\n        order.instrument_id(),\n        Some(position_side.unwrap_or(BinancePositionSide::Both)),\n    )?;\n    Ok((position_side, venue_position_id))\n}\n\nfn validate_submit_position_id(\n    submitted_position_id: Option<PositionId>,\n    venue_position_id: Option<PositionId>,\n) -> anyhow::Result<()> {\n    if let (Some(submitted_position_id), Some(venue_position_id)) =\n        (submitted_position_id, venue_position_id)\n    {\n        anyhow::ensure!(\n            submitted_position_id == venue_position_id,\n            \"submitted position ID {submitted_position_id} conflicts with canonical Binance Futures venue position ID {venue_position_id}; omit position_id while use_position_ids=true, or set use_position_ids=false for virtual hedging\",\n        );\n    }\n    Ok(())\n}\n\nfn build_futures_order_list_batch(\n    orders: &[OrderAny],\n    is_hedge_mode: bool,\n    close_position: bool,\n    price_match: Option<BinancePriceMatch>,\n    product_type: BinanceProductType,\n    use_gtd: bool,\n    ts_now: UnixNanos,\n) -> Result<Vec<BatchOrderItem>, String> {\n    if orders.len() > 5 {\n        return Err(format!(","sourceCodeStart":1329,"sourceCodeEnd":1365,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L1329-L1365","documentation":"When the venue has a canonical position ID (use_position_ids=true), any caller-supplied position_id on a submitted order must match it exactly. validate_submit_position_id rejects a submitted PositionId that differs from the venue's, because split identity would break position tracking; the fix is to omit position_id and let the adapter assign the venue ID, or disable venue position IDs entirely.","triggerScenarios":"submit_order or submit_order_list called (directly or via a strategy) with an explicit custom PositionId on an order while the Binance Futures exec client runs with use_position_ids=true and a venue position ID exists for the instrument/side.","commonSituations":"Strategies that hardcode position IDs ported from another adapter or from backtests with virtual hedging; copying code that sets position_id while the config later enabled use_position_ids=true.","solutions":["Remove the explicit position_id from the SubmitOrder request so the adapter uses the canonical venue position ID.","Set use_position_ids=false in the Binance Futures exec client config if you need strategy-managed (virtual) position IDs.","Make the submitted position_id equal to the venue position ID if identity must be pinned deliberately.","Audit strategy code for hardcoded PositionId values and route them through the exec client's identity scheme."],"exampleFix":"// before\nclient.submit_order(order, Some(PositionId::new(\"MY-POS-1\")), None);\n// after\nclient.submit_order(order, None, None); // let venue position ID be assigned","handlingStrategy":"validation","validationCode":"if cfg.use_position_ids {\n    assert!(submit.position_id.is_none() || submit.position_id == Some(venue_position_id),\n        \"custom position_id not allowed with use_position_ids=true\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit position_id on submissions when use_position_ids=true","Set use_position_ids=false for strategy-managed virtual position IDs","Grep strategies for hardcoded PositionId values before deploying to Binance Futures"],"tags":["position-id","order-submission","binance-futures","config-conflict"],"backgroundTag":"conflicting-config-options","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}