{"record":{"id":"e4754e638a208ec7","repo":"nautechsystems/nautilus_trader","slug":"no-lighter-market-index-registered-for-instrument-e4754e","errorCode":null,"errorMessage":"no Lighter market_index registered for instrument {instrument_id}","messagePattern":"no Lighter market_index registered for instrument (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":1581,"sourceCode":"    ) -> anyhow::Result<()> {\n        let context = self.fanout_dispatch_context(credential)?;\n        let prepared = context.sign_create_order(plan)?;\n        self.spawn_task(\"submit_order\", async move {\n            context.send_create_order(prepared).await;\n            Ok(())\n        });\n\n        Ok(())\n    }\n\n    fn prepare_create_order_plan(\n        &self,\n        order: &OrderAny,\n        slippage_bps: u32,\n    ) -> anyhow::Result<CreateOrderPlan> {\n        let instrument_id = order.instrument_id();\n        let market_index = self.registry.market_index(&instrument_id).ok_or_else(|| {\n            anyhow::anyhow!(\"no Lighter market_index registered for instrument {instrument_id}\")\n        })?;\n\n        let instrument = self.core.cache().try_instrument(&instrument_id)?.clone();\n\n        let order_kind = nautilus_to_lighter_order_type(order.order_type())?;\n\n        let tif = nautilus_to_lighter_tif(\n            order.order_type(),\n            order.time_in_force(),\n            order.is_post_only(),\n        )?;\n        let now_ms = (self.clock.get_time_ns().as_u64() / 1_000_000) as i64;\n        let order_expiry = order_expiry_for(\n            order.order_type(),\n            &order.time_in_force(),\n            order.expire_time(),\n            now_ms,\n        )?;","sourceCodeStart":1563,"sourceCodeEnd":1599,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L1563-L1599","documentation":"prepare_create_order_plan could not find a Lighter market_index for the order's instrument_id in the adapter's instrument registry. The registry is populated when instruments are loaded/registered; submitting for an unregistered instrument is impossible because Lighter identifies markets by integer index.","triggerScenarios":"submit_order or submit_order_list with an OrderAny whose instrument_id was never registered (e.g. instrument not in the configured markets, wrong venue prefix, or instruments not yet loaded).","commonSituations":"Typo or mismatch between configured Lighter markets and the instrument used in the strategy; submitting on a different venue than configured; starting the trader before instrument registration completes; stale cache after config change.","solutions":["Ensure the instrument is in the adapter's configured markets and that instruments were loaded before trading.","Verify the instrument_id matches a registered Lighter instrument (venue/exchange prefix and symbol).","Check adapter startup logs for instrument registration errors.","Query the registry (or dump registered instruments) to confirm the exact symbol spelling."],"exampleFix":"// before\nlet order = order_factory.market(\"LIGHTER-ETH-USDC\", ...); // not configured\n// after\nlet order = order_factory.market(\"ETH-USDC.LIGHTER\", ...); // registered instrument id","handlingStrategy":"validation","validationCode":"// Rust\nanyhow::ensure!(\n    registry.market_index(&order.instrument_id()).is_some(),\n    \"instrument {} not registered with Lighter\",\n    order.instrument_id()\n);","typeGuard":null,"tryCatchPattern":"match adapter.submit_order(order) {\n    Err(e) if e.to_string().contains(\"no Lighter market_index registered\") => {\n        log::error!(\"unregistered instrument: check config/startup\");\n        Err(e)\n    }\n    other => other,\n}","preventionTips":["Keep the list of tradable instruments derived from the adapter config","Assert instrument registration in startup tests","Use instrument ids copied from registered definitions, not hand-typed strings"],"tags":["instrument","registry","configuration","trading"],"backgroundTag":"resource-not-found","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"}