nautechsystems/nautilus_trader · error · anyhow::Error

Hyperliquid only supports L2_MBP order book depth10

Error message

Hyperliquid only supports L2_MBP order book depth10

What it means

Identical constraint as for deltas, applied to depth10 subscriptions: the Hyperliquid adapter can only build depth10 books of type L2_MBP because that is what the venue feed supports. Any other BookType in a SubscribeBookDepth10 request is rejected with this bail!.

Source

Thrown at crates/adapters/hyperliquid/src/data.rs:917

        let (n_sig_figs, mantissa) = parse_book_precision_params(subscription.params.as_ref())?;
        self.register_stream_health(MarketDataChannel::Deltas, instrument_id);

        self.spawn_task("subscribe_book_deltas", async move {
            ws.subscribe_book_with_options(instrument_id, n_sig_figs, mantissa)
                .await
        });

        Ok(())
    }

    fn subscribe_book_depth10(&mut self, subscription: SubscribeBookDepth10) -> anyhow::Result<()> {
        log::debug!(
            "Subscribing to book depth10: {}",
            subscription.instrument_id
        );

        if subscription.book_type != BookType::L2_MBP {
            anyhow::bail!("Hyperliquid only supports L2_MBP order book depth10");
        }

        let ws = self.ws_client.clone();
        let instrument_id = subscription.instrument_id;
        let (n_sig_figs, mantissa) = parse_book_precision_params(subscription.params.as_ref())?;
        self.register_stream_health(MarketDataChannel::Depth10, instrument_id);

        self.spawn_task("subscribe_book_depth10", async move {
            ws.subscribe_book_depth10_with_options(instrument_id, n_sig_figs, mantissa)
                .await
        });

        Ok(())
    }

    fn subscribe_quotes(&mut self, subscription: SubscribeQuotes) -> anyhow::Result<()> {
        let ws = self.ws_client.clone();
        let instrument_id = subscription.instrument_id;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set book_type=BookType::L2_MBP for depth10 subscriptions on Hyperliquid.
  2. Align the depth10 subscription config generation so it always emits L2_MBP for this venue.
  3. Verify the config file/strategy code that sets the book type for Hyperliquid instruments.

Example fix

// before
book_type="L1_MBP"
// after
book_type="L2_MBP"
Defensive patterns

Strategy: validation

Validate before calling

assert_eq!(sub.book_type, BookType::L2_MBP, "Hyperliquid depth10 requires L2_MBP");

Prevention

When it happens

Trigger: Calling subscribe_book_depth10 with subscription.book_type != BookType::L2_MBP — e.g. requesting an L1_MBP depth10 snapshot config for a Hyperliquid instrument.

Common situations: Reusing depth10 subscription templates from Binance or other venues that allow L1 top-of-book depth; misconfigured backtest vs live data configs differing in book type.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/05138f94149e3e5d. Report an issue: GitHub.