nautechsystems/nautilus_trader · error · anyhow::Error
OUO contingency type not supported by BitMEX
Error message
OUO contingency type not supported by BitMEX
What it means
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.
Source
Thrown at crates/adapters/bitmex/src/common/enums.rs:408
fn from(value: BitmexContingencyType) -> Self {
match value {
BitmexContingencyType::OneCancelsTheOther => Some(ContingencyType::Oco),
BitmexContingencyType::OneTriggersTheOther => Some(ContingencyType::Oto),
BitmexContingencyType::OneUpdatesTheOtherProportional
| BitmexContingencyType::OneUpdatesTheOtherAbsolute => Some(ContingencyType::Ouo),
BitmexContingencyType::Unknown => None,
}
}
}
impl TryFrom<ContingencyType> for BitmexContingencyType {
type Error = anyhow::Error;
fn try_from(value: ContingencyType) -> Result<Self, Self::Error> {
match value {
ContingencyType::Oco => Ok(Self::OneCancelsTheOther),
ContingencyType::Oto => Ok(Self::OneTriggersTheOther),
ContingencyType::Ouo => anyhow::bail!("OUO contingency type not supported by BitMEX"),
}
}
}
/// Represents the available peg price types on BitMEX.
#[derive(
Copy,
Clone,
Debug,
Display,
PartialEq,
Eq,
AsRefStr,
EnumIter,
EnumString,
Serialize,
Deserialize,
)]View on GitHub (pinned to 18893faf8b)
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
Example fix
// before let contingency = ContingencyType::Ouo; // after let contingency = ContingencyType::Oco; // or Oto, supported by BitMEX
Defensive patterns
Strategy: validation
Validate before calling
if order.contingency_type() == ContingencyType::Ouo && order.instrument_id().venue() == *BITMEX_VENUE {
return Err("OUO unsupported on BitMEX; use Oco or Oto");
} Prevention
- Restrict contingent order types per venue
- Prefer OTO/OCO for BitMEX bracket-style logic
- Document venue contingency support in strategy config
When it happens
Trigger: Submitting or converting a contingent order whose ContingencyType is Ouo when translating to the BitMEX order representation.
Common situations: Strategies using OUO parent/child order relationships (supported on venues like Binance) are pointed at BitMEX without converting to OCO or OTO.
Related errors
- MarketToLimit order type is not supported by BitMEX
- GTD time in force is not supported for BitMEX order submit;
- BitMEX does not support {}-{:?}-{:?} bars
- Only EXTERNAL aggregation bars are supported
- Market orders on Betfair are only supported with AtTheClose
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/b6823367fd5e7107.
Report an issue: GitHub.