{"record":{"id":"84beea390d5df5eb","repo":"nautechsystems/nautilus_trader","slug":"unsupported-order-type-for-betfair-other","errorCode":null,"errorMessage":"Unsupported order type for Betfair: {other:?}","messagePattern":"Unsupported order type for Betfair: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/betfair/src/execution.rs","lineNumber":3436,"sourceCode":"            if order.time_in_force() != TimeInForce::AtTheClose {\n                anyhow::bail!(\n                    \"Market orders on Betfair are only supported with AtTheClose \\\n                     time in force (BSP MarketOnClose)\"\n                );\n            }\n\n            Ok(PlaceInstruction {\n                order_type: BetfairOrderType::MarketOnClose,\n                selection_id,\n                handicap,\n                side,\n                limit_order: None,\n                limit_on_close_order: None,\n                market_on_close_order: Some(MarketOnCloseOrder { liability: size }),\n                customer_order_ref,\n            })\n        }\n        other => anyhow::bail!(\"Unsupported order type for Betfair: {other:?}\"),\n    }\n}\n\nfn customer_order_ref_collision_reason(customer_order_ref: &str) -> String {\n    OrderDeniedReason::ValidationFailed {\n        detail: format!(\n            \"customerOrderRef {customer_order_ref} collides with another tracked order\"\n        ),\n    }\n    .to_string()\n}\n\n// Even states admit submissions; each halt advances to a distinct odd generation.\n// The commit lock makes generation validation, publication, and reopening one boundary.\n#[derive(Debug)]\nstruct ReconciliationGate {\n    state: AtomicU64,\n    commit_lock: Mutex<()>,","sourceCodeStart":3418,"sourceCodeEnd":3454,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/betfair/src/execution.rs#L3418-L3454","documentation":"The Betfair order translator maps supported Nautilus order types (Limit, LimitOnClose, MarketOnClose) to Betfair PlaceInstructions. Any other order variant (e.g. Market, Stop, TrailingStop) hits the catch-all `other` arm and bails with this error naming the variant.","triggerScenarios":"Calling the order conversion (build PlaceInstruction path) with an unsupported OrderType such as Market (without AtTheClose, see separate check), StopMarket, StopLimit, or TrailingStopMarket.","commonSituations":"Strategies written for other venues submitting stop or plain market orders to Betfair; dynamic order routing sending every order type to the adapter; backtest code assumptions carried into live Betfair execution.","solutions":["Restrict strategies on Betfair to Limit, LimitOnClose, and MarketOnClose orders","Pre-filter unsupported order types before submitting (match on OrderType and skip/convert)","Emulate stop behavior in strategy logic if stops are needed on Betfair"],"exampleFix":"// before\nlet order = order_factory.stop_market(instrument_id, side, qty, trigger_price, ...);\n// after\nlet order = order_factory.limit(instrument_id, side, qty, limit_price, TimeInForce::Gtc, ...);","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[OrderType] = &[OrderType::Limit, OrderType::LimitOnClose, OrderType::MarketOnClose];\nif !SUPPORTED.contains(&order.order_type()) {\n    return Err(anyhow!(\"{} not supported on Betfair\", order.order_type()));\n}","typeGuard":"fn betfair_supported(o: &dyn Order) -> bool {\n    matches!(o.order_type(), OrderType::Limit | OrderType::LimitOnClose | OrderType::MarketOnClose)\n}","tryCatchPattern":"match submit_result {\n    Err(e) if e.to_string().contains(\"Unsupported order type for Betfair\") => {\n        eprintln!(\"use Limit/LimitOnClose/MarketOnClose\");\n    }\n    other => other?,\n}","preventionTips":["Only submit Limit, LimitOnClose, MarketOnClose orders to Betfair","Emulate stops in strategy logic (Betfair has no native stop orders)","Add venue capability checks before order submission in your strategy framework"],"tags":["betfair","orders","unsupported","order-type"],"backgroundTag":"unsupported-enum-value","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"}