nautechsystems/nautilus_trader · warning

Skipping execution without order_id: {:?}

Error message

Skipping execution without order_id: {:?}

What it means

parse_fill_report skips BitMEX executions that have no `order_id`. Such executions are not order fills (funding, settlement, etc. carry no order reference). The library surfaces this as an anyhow error so the caller (request_fill_reports) can catch and skip the record.

Source

Thrown at crates/adapters/bitmex/src/http/parse.rs:1094

/// Parse a BitMEX execution into a Nautilus `FillReport` using instrument scaling.
///
/// # Errors
///
/// Returns an error when the execution does not represent a trade or lacks required identifiers.
pub fn parse_fill_report(
    exec: &BitmexExecution,
    instrument: &InstrumentAny,
    ts_init: UnixNanos,
) -> anyhow::Result<FillReport> {
    // Skip non-trade executions (funding, settlements, etc.)
    // Trade executions have exec_type of Trade and must have order_id
    if !matches!(exec.exec_type, BitmexExecType::Trade) {
        anyhow::bail!("Skipping non-trade execution: {:?}", exec.exec_type);
    }

    // Additional check: skip executions without order_id (likely funding/settlement)
    let order_id = exec.order_id.ok_or_else(|| {
        anyhow::anyhow!("Skipping execution without order_id: {:?}", exec.exec_type)
    })?;

    let account_id = bitmex_account_id(exec.account);
    let instrument_id = instrument.id();
    let venue_order_id = VenueOrderId::new(order_id.to_string());
    // trd_match_id might be missing for some execution types, use exec_id as fallback
    let trade_id = TradeId::new(
        exec.trd_match_id
            .or(Some(exec.exec_id))
            .ok_or_else(|| anyhow::anyhow!("Fill missing both trd_match_id and exec_id"))?
            .to_string(),
    );
    // Skip executions without side (likely not trades)
    let Some(side) = exec.side else {
        anyhow::bail!("Skipping execution without side: {:?}", exec.exec_type);
    };
    let order_side = OrderSide::from(side);
    let last_qty = parse_signed_contracts_quantity(exec.last_qty, instrument);

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Treat this as an expected skip: catch the error in request_fill_reports and continue to the next execution.
  2. Filter the execution list to entries with a non-null order_id before parsing.
  3. Restrict the request to order-scoped execution endpoints when only fills are needed.
  4. Inspect exec_type/exec_id of the offending record to confirm it is funding/settlement.

Example fix

// before
let report = parse_fill_report(exec, instrument)?;
// after
for exec in executions {
    match parse_fill_report(exec, instrument) {
        Ok(r) => reports.push(r),
        Err(e) if e.to_string().contains("Skipping") => continue,
        Err(e) => return Err(e),
    }
}
Defensive patterns

Strategy: try-catch

Validate before calling

let fillable: Vec<_> = executions.into_iter().filter(|e| e.order_id.is_some()).collect();

Type guard

fn is_order_fill(exec: &BitmexExecution) -> bool {
    exec.order_id.is_some() && matches!(exec.exec_type, BitmexExecType::Trade)
}

Try / catch

match parse_fill_report(exec, instrument) {
    Ok(r) => reports.push(r),
    Err(e) if e.to_string().starts_with("Skipping") => continue,
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: request_fill_reports iterating the /execution response when an entry has exec_type Trade but order_id null — e.g. funding or settlement records mis-typed, or execution rows for manually-liquidated positions.

Common situations: Downloading full fill history for an account that includes funding payments; ADL/liquidation rows without a parent order; BitMEX returning non-order executions in the execution feed.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/3a49c239f92b1063. Report an issue: GitHub.