{"record":{"id":"b870a8eeb108935c","repo":"nautechsystems/nautilus_trader","slug":"definitive-submit-rejection","errorCode":"DEFINITIVE_SUBMIT_REJECTION","errorMessage":"{DEFINITIVE_SUBMIT_REJECTION}: All {} requests were refused by BitMEX: {errors:?}","messagePattern":"(.+?): All (.+?) requests were refused by BitMEX: (.+?)","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/bitmex/src/broadcast/submitter.rs","lineNumber":648,"sourceCode":"        // All tasks failed\n        self.failed_submits.fetch_add(1, Ordering::Relaxed);\n\n        // If all errors were \"Duplicate clOrdID\", this is likely an idempotent scenario\n        // where the order exists but the success response was lost\n        if all_duplicate_clordid && !errors.is_empty() {\n            log::warn!(\n                \"All {} requests returned 'Duplicate clOrdID' - order likely exists {params}\",\n                operation.to_lowercase(),\n            );\n            anyhow::bail!(\"IDEMPOTENT_DUPLICATE: Order likely exists but confirmation was lost\");\n        }\n\n        if all_definitive_refusals && !errors.is_empty() {\n            log::error!(\n                \"All {} requests were refused by BitMEX: {errors:?} {params}\",\n                operation.to_lowercase(),\n            );\n            anyhow::bail!(\n                \"{DEFINITIVE_SUBMIT_REJECTION}: All {} requests were refused by BitMEX: {errors:?}\",\n                operation.to_lowercase(),\n            );\n        }\n\n        log::error!(\n            \"All {} requests failed: {errors:?} {params}\",\n            operation.to_lowercase(),\n        );\n        Err(anyhow::anyhow!(\n            \"All {} requests failed: {:?}\",\n            operation.to_lowercase(),\n            errors\n        ))\n    }\n\n    /// Broadcasts a submit request to all healthy clients in parallel.\n    ///","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/broadcast/submitter.rs#L630-L666","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the `errors` payload in the error message to see the exact per-request BitMEX refusal reason","Validate order parameters (symbol, quantity, price, order type) against BitMEX instrument metadata before submitting","Check account balance, API key permissions, and that the symbol is listed and tradable on BitMEX","Retry only after correcting the order — this is a definitive rejection, not transient"],"exampleFix":"// before\nsubmit(order)?; // panics/bails with DEFINITIVE_SUBMIT_REJECTION when order is invalid\n// after\nlet instrument = get_bitmex_instrument(order.symbol)?;\nif !instrument.supports_order_type(order.order_type) || order.qty > instrument.max_qty {\n    return Err(OrderValidationError::new(order));\n}\nsubmit(order)?;","handlingStrategy":"try-catch","validationCode":"// Validate before submit\nif order.qty.as_decimal() <= Decimal::ZERO || !is_tradable_symbol(order.instrument_id) {\n    return Err(\"invalid order before BitMEX submit\");\n}","typeGuard":null,"tryCatchPattern":"match broadcast_submit(order).await {\n    Err(e) if e.to_string().contains(\"DEFINITIVE_SUBMIT_REJECTION\") => {\n        log::error!(\"Order definitively rejected: {e}\"); // do NOT retry\n    }\n    r => r?,\n}","preventionTips":["Always parse the per-request error details embedded in the message","Validate order parameters against instrument metadata pre-submit","Never blindly retry definitive rejections; fix the order first"],"tags":["bitmex","order-submit","exchange-rejection"],"backgroundTag":"api-error-response","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}