{"record":{"id":"b6823367fd5e7107","repo":"nautechsystems/nautilus_trader","slug":"ouo-contingency-type-not-supported-by-bitmex","errorCode":null,"errorMessage":"OUO contingency type not supported by BitMEX","messagePattern":"OUO contingency type not supported by BitMEX","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/bitmex/src/common/enums.rs","lineNumber":408,"sourceCode":"    fn from(value: BitmexContingencyType) -> Self {\n        match value {\n            BitmexContingencyType::OneCancelsTheOther => Some(ContingencyType::Oco),\n            BitmexContingencyType::OneTriggersTheOther => Some(ContingencyType::Oto),\n            BitmexContingencyType::OneUpdatesTheOtherProportional\n            | BitmexContingencyType::OneUpdatesTheOtherAbsolute => Some(ContingencyType::Ouo),\n            BitmexContingencyType::Unknown => None,\n        }\n    }\n}\n\nimpl TryFrom<ContingencyType> for BitmexContingencyType {\n    type Error = anyhow::Error;\n\n    fn try_from(value: ContingencyType) -> Result<Self, Self::Error> {\n        match value {\n            ContingencyType::Oco => Ok(Self::OneCancelsTheOther),\n            ContingencyType::Oto => Ok(Self::OneTriggersTheOther),\n            ContingencyType::Ouo => anyhow::bail!(\"OUO contingency type not supported by BitMEX\"),\n        }\n    }\n}\n\n/// Represents the available peg price types on BitMEX.\n#[derive(\n    Copy,\n    Clone,\n    Debug,\n    Display,\n    PartialEq,\n    Eq,\n    AsRefStr,\n    EnumIter,\n    EnumString,\n    Serialize,\n    Deserialize,\n)]","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/common/enums.rs#L390-L426","documentation":"Generic guard in the TryFrom<ContingencyType> for BitmexContingencyType conversion: BitMEX has no exchange-side representation for the OUO (one-updates-the-other) contingency type, so any Nautilus order carrying ContingencyType::Ouo cannot be submitted to BitMEX.","triggerScenarios":"Submitting or converting a contingent order whose ContingencyType is Ouo when translating to the BitMEX order representation.","commonSituations":"Strategies using OUO parent/child order relationships (supported on venues like Binance) are pointed at BitMEX without converting to OCO or OTO.","solutions":["Use ContingencyType::Oco or ContingencyType::Oto for BitMEX contingent orders","Implement OUO semantics manually (two linked orders with custom cancel/replace logic) outside the adapter","Guard the strategy to refuse contingent orders on BitMEX unless type is OCO/OTO"],"exampleFix":"// before\nlet contingency = ContingencyType::Ouo;\n// after\nlet contingency = ContingencyType::Oco; // or Oto, supported by BitMEX","handlingStrategy":"validation","validationCode":"if order.contingency_type() == ContingencyType::Ouo && order.instrument_id().venue() == *BITMEX_VENUE {\n    return Err(\"OUO unsupported on BitMEX; use Oco or Oto\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict contingent order types per venue","Prefer OTO/OCO for BitMEX bracket-style logic","Document venue contingency support in strategy config"],"tags":["bitmex","contingency-type","unsupported"],"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-14T00:17:10.932Z"}