{"record":{"id":"924b64de22485d84","repo":"nautechsystems/nautilus_trader","slug":"missing-positive-trigger-price-for-binance-algo-or-924b64","errorCode":null,"errorMessage":"missing positive trigger_price for Binance algo order type {:?}","messagePattern":"missing positive trigger_price for Binance algo order type (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/websocket/streams/parse_exec.rs","lineNumber":449,"sourceCode":"    }\n\n    Price::from_decimal_dp(decimal, precision)\n        .map(Some)\n        .map_err(|e| anyhow::anyhow!(\"invalid {field} precision: {e}\"))\n}\n\nfn parse_algo_trigger_price(\n    algo_data: &AlgoOrderUpdateData,\n    price_precision: u8,\n) -> anyhow::Result<Option<Price>> {\n    let trigger_price = parse_positive_price_at_precision(\n        &algo_data.trigger_price,\n        price_precision,\n        \"trigger_price\",\n    )?;\n\n    if trigger_price.is_none() && requires_algo_trigger_price(algo_data.order_type) {\n        anyhow::bail!(\n            \"missing positive trigger_price for Binance algo order type {:?}\",\n            algo_data.order_type\n        );\n    }\n\n    Ok(trigger_price)\n}\n\nfn parse_algo_limit_price(\n    algo_data: &AlgoOrderUpdateData,\n    price_precision: u8,\n) -> anyhow::Result<Option<Price>> {\n    let price = parse_positive_price_at_precision(&algo_data.price, price_precision, \"price\")?;\n\n    if price.is_none() && requires_algo_limit_price(algo_data.order_type) {\n        anyhow::bail!(\n            \"missing positive price for Binance algo order type {:?}\",\n            algo_data.order_type","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/websocket/streams/parse_exec.rs#L431-L467","documentation":"When parsing a futures algo (conditional) order websocket update, parse_algo_trigger_price requires a positive trigger price for order types where requires_algo_trigger_price returns true (e.g. STOP_MARKET). A missing/non-positive trigger_price for such types aborts parsing.","triggerScenarios":"Receiving an algo order update event whose triggerPrice field is empty, \"0\", or negative while algo_data.order_type requires a trigger (e.g. STOP_MARKET, TAKE_PROFIT_MARKET).","commonSituations":"Cancelled or expired conditional orders reported with zeroed prices; new algo order types added by Binance that the requires_algo_trigger_price mapping treats as trigger-requiring but the payload omits; mock/test events missing triggerPrice.","solutions":["Verify the order was placed with a valid stopPrice; re-fetch order state via REST if the stream record is incomplete.","Extend requires_algo_trigger_price/parse logic if a newly added order type should not require a trigger price.","Correct test/mock payloads to include a positive triggerPrice."],"exampleFix":"// before\n{\"o\": {\"ot\": \"STOP_MARKET\", \"tp\": \"0\"}}\n// after\n{\"o\": {\"ot\": \"STOP_MARKET\", \"tp\": \"25000.00\"}}","handlingStrategy":"validation","validationCode":"fn needs_trigger(order_type: &str) -> bool {\n    matches!(order_type, \"STOP_MARKET\" | \"TAKE_PROFIT_MARKET\")\n}\nif needs_trigger(ot) && tp.parse::<f64>().map(|v| v <= 0.0).unwrap_or(true) {\n    return Err(\"algo update requires positive trigger price\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"missing positive trigger_price\") => {\n        tracing::warn!(\"algo stream update lacks trigger price; reconcile via REST\");\n    }\n    r => r?,\n}","preventionTips":["Place conditional orders with a valid stopPrice.","Treat zeroed prices on terminal-order updates as incomplete data and refetch.","Keep parser tests covering cancelled/expired algo payloads."],"tags":["algo-orders","websocket","price","binance-futures"],"backgroundTag":"missing-required-argument","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"}