{"record":{"id":"be29218e2292d683","repo":"nautechsystems/nautilus_trader","slug":"lighter-does-not-support-historical-order-book-dep","errorCode":null,"errorMessage":"Lighter does not support historical order book depth requests for {}; use request_book_snapshot for an L2 snapshot or subscribe_book_depth10 for live depth10","messagePattern":"Lighter does not support historical order book depth requests for (.+?); use request_book_snapshot for an L2 snapshot or subscribe_book_depth10 for live depth10","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/data/mod.rs","lineNumber":1808,"sourceCode":"                        ts_init,\n                        params,\n                    ));\n\n                    if let Err(e) = sender.send(DataEvent::Response(response)) {\n                        log::error!(\"Failed to send book snapshot response: {e}\");\n                    }\n                }\n                Err(e) => {\n                    log::error!(\"Lighter book snapshot request failed for {instrument_id}: {e:?}\");\n                }\n            }\n        });\n\n        Ok(())\n    }\n\n    fn request_book_depth(&self, request: RequestBookDepth) -> anyhow::Result<()> {\n        anyhow::bail!(\n            \"Lighter does not support historical order book depth requests for {}; \\\n             use request_book_snapshot for an L2 snapshot or subscribe_book_depth10 for live depth10\",\n            request.instrument_id,\n        )\n    }\n}\n\nfn retain_trade_ticks_in_range(\n    trades: &mut Vec<TradeTick>,\n    start_nanos: Option<UnixNanos>,\n    end_nanos: Option<UnixNanos>,\n) {\n    trades.retain(|trade| trade_tick_in_range(trade.ts_event, start_nanos, end_nanos));\n    trades.sort_by_key(|trade| trade.ts_event);\n}\n\nfn trade_tick_in_range(\n    ts_event: UnixNanos,","sourceCodeStart":1790,"sourceCodeEnd":1826,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/data/mod.rs#L1790-L1826","documentation":"The Lighter data client does not support historical (streamed/replayed) order book depth requests. Depth is available either as a one-shot L2 snapshot via request_book_snapshot or as live depth10 via subscribe_book_depth10; request_book_depth always bails with this guidance message naming the instrument.","triggerScenarios":"Calling request_book_depth (or sending a RequestBookDepth through the DataEngine) for a Lighter instrument, e.g. a strategy requesting historical depth between two timestamps.","commonSituations":"Cross-venue strategies that request depth history elsewhere; assuming replayed book depth exists because L2 snapshots do; backfill pipelines requesting depth ranges.","solutions":["Use request_book_snapshot for the current L2 snapshot.","Use subscribe_book_depth10 for continuous live depth10 updates.","Record depth via the depth10 subscription into your own store if you need history.","Skip request_book_depth calls for the Lighter venue in venue-agnostic code paths."],"exampleFix":"// before\ndata_engine.request(RequestBookDepth::new(instrument_id, depth, start, end))\n// after\ndata_engine.request_book_snapshot(instrument_id, depth)?; // or subscribe_book_depth10(instrument_id, depth)","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// venue-agnostic path\nif request.instrument_id.venue.as_str() == \"LIGHTER\" {\n    data_engine.request_book_snapshot(request.instrument_id, request.depth)?;\n    data_engine.subscribe_book_depth10(request.instrument_id, request.depth)?;\n} else {\n    data_engine.request_book_depth(request)?;\n}","preventionTips":["Use request_book_snapshot or subscribe_book_depth10 for Lighter depth.","Record depth10 streams yourself if historical depth is required.","Branch venue-agnostic depth-history code paths per venue capability."],"tags":["rust","adapter","order-book","historical-data","unsupported"],"backgroundTag":"operation-not-supported","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"}