{"record":{"id":"a8f00c4ac8658f63","repo":"nautechsystems/nautilus_trader","slug":"inverse-instrument-has-no-base-currency-a8f00c","errorCode":null,"errorMessage":"inverse instrument {} has no base currency","messagePattern":"inverse instrument (.+?) has no base currency","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/model/src/instruments/mod.rs","lineNumber":581,"sourceCode":"    ///\n    /// # Errors\n    ///\n    /// Returns an error if base-denominated inverse valuation lacks a base currency or positive\n    /// price, or if the result cannot be represented as [`Money`].\n    #[inline(always)]\n    fn try_calculate_notional_value(\n        &self,\n        quantity: Quantity,\n        price: Price,\n        use_quote_for_inverse: Option<bool>,\n    ) -> anyhow::Result<Money> {\n        let use_quote_inverse = use_quote_for_inverse.unwrap_or(false);\n        let currency = if self.is_inverse() {\n            if use_quote_inverse {\n                self.quote_currency()\n            } else {\n                self.base_currency().ok_or_else(|| {\n                    anyhow::anyhow!(\"inverse instrument {} has no base currency\", self.id())\n                })?\n            }\n        } else if self.is_quanto() {\n            self.settlement_currency()\n        } else {\n            self.quote_currency()\n        };\n\n        try_notional_value(\n            quantity,\n            price,\n            self.multiplier(),\n            self.is_inverse(),\n            use_quote_inverse,\n            currency,\n        )\n    }\n","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/model/src/instruments/mod.rs#L563-L599","documentation":"calculate_notional_value for inverse instruments requires a base currency; inverse contracts (e.g. coin-margined futures) are denominated in their base asset. When use_quote_for_inverse is false and the instrument's base_currency() returns None (the instrument model has no base currency defined), this error is raised.","triggerScenarios":"Calling calculate_notional_value (default use_quote_for_inverse=false) on an inverse instrument whose type implements base_currency() as None, such as certain synthetic or option-like inverse instruments.","commonSituations":"Using generic notional/PnL reporting code against an inverse instrument that lacks a base currency, or forgetting to pass use_quote_for_inverse=true for instruments where only the quote currency is meaningful.","solutions":["Pass use_quote_for_inverse = Some(true) so quote currency is used instead of the missing base currency.","Check instrument.is_inverse() and base_currency().is_some() before computing notional; skip or route those instruments differently.","Fix the instrument definition so a base currency is provided for the inverse instrument."],"exampleFix":"// before\nlet notional = instrument.calculate_notional_value(price, qty, None);\n// after\nlet notional = instrument.calculate_notional_value(price, qty, Some(true)); // use quote for inverse","handlingStrategy":"validation","validationCode":"let use_quote = instrument.is_inverse() && instrument.base_currency().is_none();\nlet notional = instrument.calculate_notional_value(price, qty, Some(use_quote));","typeGuard":null,"tryCatchPattern":"// Rust\nmatch instrument.try_calculate_notional_value(price, qty, None) {\n    Ok(m) => m,\n    Err(e) => { log::warn!(\"notional skipped: {e}\"); Money::zero(currency, precision) }\n}","preventionTips":["Check is_inverse() and base_currency() availability before inverse valuation","Set use_quote_for_inverse=true for inverse instruments without a base currency","Fix instrument definitions so inverse instruments carry their base currency"],"tags":["notional","inverse-instrument","missing-value","currency"],"backgroundTag":"missing-required-argument","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"}