nautechsystems/nautilus_trader · error
Only depth=10 is currently supported for order book depths
Error message
Only depth=10 is currently supported for order book depths
What it means
`get_range_order_book_depth10` fetches MBP-10 snapshots, and the `depth` parameter currently only accepts 10 (the default). Any other depth value bails because the implementation only supports the MBP_10 schema. This is an explicit capability limitation, not a data problem.
Source
Thrown at crates/adapters/databento/src/historical.rs:498
&self,
params: RangeQueryParams,
depth: Option<usize>,
) -> anyhow::Result<Vec<OrderBookDepth10>> {
let symbols: Vec<&str> = params.symbols.iter().map(String::as_str).collect();
check_consistent_symbology(&symbols)?;
let first_symbol = params
.symbols
.first()
.ok_or_else(|| anyhow::anyhow!("No symbols provided"))?;
let stype_in = infer_symbology_type(first_symbol);
let end = params.end.unwrap_or_else(|| self.clock.get_time_ns());
let time_range = get_date_time_range(params.start, end)?;
// For now, only support MBP_10 schema for depth 10
let _depth = depth.unwrap_or(10);
if _depth != 10 {
anyhow::bail!("Only depth=10 is currently supported for order book depths");
}
let range_params = GetRangeParams::builder()
.dataset(params.dataset)
.date_time_range(time_range)
.symbols(symbols)
.stype_in(stype_in)
.schema(dbn::Schema::Mbp10)
.maybe_limit(params.limit.and_then(NonZeroU64::new))
.build();
let price_precision_arg = params.price_precision;
let mut client = (*self.inner).clone();
let mut decoder = client
.timeseries()
.get_range(&range_params)
.awaitView on GitHub (pinned to 18893faf8b)
Solutions
- Pass `None` (defaults to 10) or `Some(10)` for the depth parameter.
- If a different depth is needed, fetch the corresponding MBP schema directly or extend the adapter to support additional depth schemas.
- Clamp/validate user-configured depth values to 10 before calling.
Example fix
// before
let depth = app_config.book_depth; // e.g. 5
historical.get_range_order_book_depth10(params, Some(depth)).await?;
// after
let depth = if app_config.book_depth != 10 { None } else { Some(10) };
historical.get_range_order_book_depth10(params, depth).await?; Defensive patterns
Strategy: validation
Validate before calling
let depth = depth.unwrap_or(10);
if depth != 10 { panic!("only depth=10 supported, got {depth}"); } Prevention
- Hard-code or clamp depth to 10 when calling get_range_order_book_depth10.
- Pass None to accept the default depth of 10.
- Check adapter docs for newly supported depths before configuring other values.
When it happens
Trigger: Calling `get_range_order_book_depth10(params, Some(n))` where `n != 10` (e.g. Some(5) or Some(20)).
Common situations: Configuring desired book depth generically in an application and passing it straight through; assuming the adapter supports Databento's other depth schemas (mbp-2, mbp-5, etc.).
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Invalid depth {depth} for Binance Futures order book. Valid
- Invalid `BookAction`, was '{invalid}'
- invalid depth {depth}; supported depths: {DERIBIT_BOOK_VALID
- Hyperliquid only supports L2_MBP order book deltas
- Hyperliquid only supports L2_MBP order book depth10
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/63378fa30c5f2f76.
Report an issue: GitHub.