nautechsystems/nautilus_trader · error · anyhow::Error

DEFINITIVE_SUBMIT_REJECTION

DEFINITIVE_SUBMIT_REJECTION

Error message

{DEFINITIVE_SUBMIT_REJECTION}: All {} requests were refused by BitMEX: {errors:?}

What it means

This error is raised by the BitMEX order submitter after broadcasting order requests to all transport clients and receiving definitive refusals for every one of them. It means the exchange (or all transports) categorically rejected the submit, so the outcome is definitive (not ambiguous network failure) and the order will not be placed. The library bails with a structured DEFINITIVE_SUBMIT_REJECTION error carrying the per-request error details.

Source

Thrown at crates/adapters/bitmex/src/broadcast/submitter.rs:648

        // All tasks failed
        self.failed_submits.fetch_add(1, Ordering::Relaxed);

        // If all errors were "Duplicate clOrdID", this is likely an idempotent scenario
        // where the order exists but the success response was lost
        if all_duplicate_clordid && !errors.is_empty() {
            log::warn!(
                "All {} requests returned 'Duplicate clOrdID' - order likely exists {params}",
                operation.to_lowercase(),
            );
            anyhow::bail!("IDEMPOTENT_DUPLICATE: Order likely exists but confirmation was lost");
        }

        if all_definitive_refusals && !errors.is_empty() {
            log::error!(
                "All {} requests were refused by BitMEX: {errors:?} {params}",
                operation.to_lowercase(),
            );
            anyhow::bail!(
                "{DEFINITIVE_SUBMIT_REJECTION}: All {} requests were refused by BitMEX: {errors:?}",
                operation.to_lowercase(),
            );
        }

        log::error!(
            "All {} requests failed: {errors:?} {params}",
            operation.to_lowercase(),
        );
        Err(anyhow::anyhow!(
            "All {} requests failed: {:?}",
            operation.to_lowercase(),
            errors
        ))
    }

    /// Broadcasts a submit request to all healthy clients in parallel.
    ///

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Inspect the `errors` payload in the error message to see the exact per-request BitMEX refusal reason
  2. Validate order parameters (symbol, quantity, price, order type) against BitMEX instrument metadata before submitting
  3. Check account balance, API key permissions, and that the symbol is listed and tradable on BitMEX
  4. Retry only after correcting the order — this is a definitive rejection, not transient

Example fix

// before
submit(order)?; // panics/bails with DEFINITIVE_SUBMIT_REJECTION when order is invalid
// after
let instrument = get_bitmex_instrument(order.symbol)?;
if !instrument.supports_order_type(order.order_type) || order.qty > instrument.max_qty {
    return Err(OrderValidationError::new(order));
}
submit(order)?;
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate before submit
if order.qty.as_decimal() <= Decimal::ZERO || !is_tradable_symbol(order.instrument_id) {
    return Err("invalid order before BitMEX submit");
}

Try / catch

match broadcast_submit(order).await {
    Err(e) if e.to_string().contains("DEFINITIVE_SUBMIT_REJECTION") => {
        log::error!("Order definitively rejected: {e}"); // do NOT retry
    }
    r => r?,
}

Prevention

When it happens

Trigger: Calling broadcast_submit when every request sent to BitMEX is definitively refused — e.g. invalid order parameters, insufficient balance, rejected symbol, or exchange-side validation errors returned by all transports in the pool.

Common situations: Submitting orders with parameters BitMEX rejects (bad qty/price/symbol), trading during maintenance, accounts lacking funds or permissions, or a misconfigured instrument that the exchange rejects at every retry.

Related errors


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