{"record":{"id":"bea28bbc8b5ea26e","repo":"nautechsystems/nautilus_trader","slug":"missing-tick-size-for","errorCode":null,"errorMessage":"Missing tick_size for {}","messagePattern":"Missing tick_size for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/bitmex/src/websocket/messages.rs","lineNumber":591,"sourceCode":"impl TryFrom<BitmexInstrumentMsg> for crate::http::models::BitmexInstrument {\n    type Error = anyhow::Error;\n\n    fn try_from(msg: BitmexInstrumentMsg) -> Result<Self, Self::Error> {\n        use crate::common::enums::{BitmexInstrumentState, BitmexInstrumentType};\n\n        // Required fields\n        let root_symbol = msg\n            .root_symbol\n            .ok_or_else(|| anyhow::anyhow!(\"Missing root_symbol for {}\", msg.symbol))?;\n        let underlying = msg\n            .underlying\n            .ok_or_else(|| anyhow::anyhow!(\"Missing underlying for {}\", msg.symbol))?;\n        let quote_currency = msg\n            .quote_currency\n            .ok_or_else(|| anyhow::anyhow!(\"Missing quote_currency for {}\", msg.symbol))?;\n        let tick_size = msg\n            .tick_size\n            .ok_or_else(|| anyhow::anyhow!(\"Missing tick_size for {}\", msg.symbol))?;\n        let multiplier = msg\n            .multiplier\n            .ok_or_else(|| anyhow::anyhow!(\"Missing multiplier for {}\", msg.symbol))?;\n        let is_quanto = msg\n            .is_quanto\n            .ok_or_else(|| anyhow::anyhow!(\"Missing is_quanto for {}\", msg.symbol))?;\n        let is_inverse = msg\n            .is_inverse\n            .ok_or_else(|| anyhow::anyhow!(\"Missing is_inverse for {}\", msg.symbol))?;\n\n        // Parse state - default to Open if not present\n        let state = msg\n            .state\n            .and_then(|s| serde_json::from_str::<BitmexInstrumentState>(&format!(\"\\\"{s}\\\"\")).ok())\n            .unwrap_or(BitmexInstrumentState::Open);\n\n        // Parse instrument type - default to PerpetualContract if not present\n        let instrument_type = msg","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/websocket/messages.rs#L573-L609","documentation":"The instrument conversion guard chain continues: `tick_size` is null in the BitmexInstrumentMsg. Tick size is mandatory for constructing a valid instrument (price precision/step), so the conversion fails with this error.","triggerScenarios":"WS instrument message arriving with tick_size: null — partial instrument updates, index symbols, or contracts where BitMEX has not published tick metadata.","commonSituations":"Initial bulk snapshot fetching where some rows are placeholders; partial delta updates missing fields not changed; newly listed instruments with incomplete metadata.","solutions":["Skip the incomplete record and rely on a later complete snapshot.","Cache full instrument definitions and merge deltas before conversion.","Restrict subscription to symbols known to have complete metadata.","Refetch the instrument definition via REST if the WS update is incomplete."],"exampleFix":"// before\nlet tick_size = msg.tick_size.ok_or_else(|| anyhow::anyhow!(\"Missing tick_size for {}\", msg.symbol))?;\n// after\nlet Some(tick_size) = msg.tick_size else {\n    log::debug!(\"Deferring {}: no tick_size yet\", msg.symbol);\n    return Ok(());\n};","handlingStrategy":"fallback","validationCode":"if msg.tick_size.is_none() { /* wait for complete snapshot or fetch via REST */ }","typeGuard":"fn has_tick_size(msg: &BitmexInstrumentMsg) -> Option<f64> { msg.tick_size }","tryCatchPattern":"let Ok(def) = TryInto::<InstrumentDef>::try_into(msg) else {\n    pending.insert(msg.symbol.clone(), msg);\n    return Ok(());\n};","preventionTips":["Buffer incomplete rows until a later update completes their metadata.","Seed instrument definitions from the REST /instrument endpoint before WS streaming.","Never construct trading instruments without a verified tick_size."],"tags":["websocket","bitmex","instrument","missing-field"],"backgroundTag":"missing-required-config-field","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"}