{"record":{"id":"002e1f1a9431dc10","repo":"nautechsystems/nautilus_trader","slug":"no-lighter-instrument-registered-for-fill-market-i","errorCode":null,"errorMessage":"no Lighter instrument registered for fill market_index={}","messagePattern":"no Lighter instrument registered for fill market_index=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":5280,"sourceCode":"                Ok(response) => response,\n                Err(e) => {\n                    // `{e:#}` preserves the venue's status/body across the\n                    // outer context wrap; `scrub_auth` redacts any `auth=`\n                    // query value the HTTP layer's error included.\n                    log::warn!(\n                        \"Lighter get_trades failed (market_id={:?}, account_index={}, cursor={:?}): {}\",\n                        query.market_id,\n                        credential.account_index(),\n                        cursor,\n                        scrub_auth(&format!(\"{e:#}\")),\n                    );\n                    return Err(anyhow::Error::new(e).context(\"failed to fetch Lighter fills\"));\n                }\n            };\n\n            for trade in &response.trades {\n                let Some(instrument_id) = self.registry.instrument_id(trade.market_id) else {\n                    anyhow::bail!(\n                        \"no Lighter instrument registered for fill market_index={}\",\n                        trade.market_id,\n                    );\n                };\n                let Some(instrument) = self.core.cache().instrument(&instrument_id).cloned() else {\n                    anyhow::bail!(\"Lighter fill instrument {instrument_id} missing from cache\");\n                };\n\n                match parse_ws_fill_report(\n                    trade,\n                    credential.account_index(),\n                    &instrument,\n                    self.core.account_id,\n                    ts_init,\n                ) {\n                    Ok(Some(report)) => {\n                        if cmd.start.is_some_and(|start| report.ts_event < start)\n                            || cmd.end.is_some_and(|end| report.ts_event > end)","sourceCodeStart":5262,"sourceCodeEnd":5298,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L5262-L5298","documentation":"Raised while processing fetched fills: a trade arrived from the venue with a market_id that has no registered instrument_id in the adapter's registry, so the fill cannot be mapped to a Nautilus instrument. This is the reverse lookup of error 966 — venue market_index back to a local instrument.","triggerScenarios":"The fills fetcher received trades for a market the client never registered instruments for — e.g. the account traded a market the adapter did not discover/subscribe to at startup, or a newly listed market appeared between instrument load and the fills fetch.","commonSituations":"Trading a market added after client startup, fills history covering markets outside the subscribed set, or instrument loading partially failed at startup.","solutions":["Refresh/reload instruments so the registry includes the fill's market_id","Subscribe to all markets the account can trade before fetching fills","Skip or quarantine the unknown-market fill instead of failing the whole fills sync","Restart the client to rerun full instrument discovery"],"exampleFix":"// before: fetch fills immediately at startup\nlet fills = client.fetch_fills().await?;\n// after: ensure instruments are loaded first\nclient.request_instruments().await?; // populate registry\nlet fills = client.fetch_fills().await?;","handlingStrategy":"validation","validationCode":"// before fetching fills, ensure all tradable markets are registered\nclient.request_instruments().await?;\nassert!(!client.registry.is_empty(), \"instrument registry empty\");","typeGuard":null,"tryCatchPattern":"match client.fetch_fills().await {\n    Err(e) if e.to_string().contains(\"no Lighter instrument registered\") => {\n        client.request_instruments().await?; // refresh registry, then retry\n        client.fetch_fills().await?;\n    }\n    r => r,\n}","preventionTips":["Refresh instrument discovery periodically so new listings are registered","Load instruments before enabling fills polling at startup","Subscribe to every market the account can trade, not only actively traded ones"],"tags":["instrument-registry","fills","rust","not-found","market-index"],"backgroundTag":"entity-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"}