nautechsystems/nautilus_trader · error

Binance Futures supports L1_MBP and L2_MBP order book…

Error message

Binance Futures supports L1_MBP and L2_MBP order book subscriptions

What it means

Guard in subscribe_book_deltas rejecting book types other than L1_MBP and L2_MBP (e.g. L3_MBO): Binance Futures exposes no L3 feed, so such a subscription cannot be served and is rejected before any channel is opened.

Solutions

  1. Change the subscription's book_type to L2_MBP (or L1_MBP)
  2. Do not also keep an existing L1 subscription for the same instrument (that raises the separate conflicting-subscription error)
  3. If L3 depth is required, use a different adapter/venue that supports it

Example fix

// before
book_type: BookType::L3_MBP,
// after
book_type: BookType::L2_MBP,
Defensive patterns

Strategy: validation

Validate before calling

assert!(matches!(cmd.book_type, BookType::L1_MBP | BookType::L2_MBP), "Binance Futures supports only L1/L2 MBP");

Type guard

fn is_supported_book_type(bt: &BookType) -> bool {
    matches!(bt, BookType::L1_MBP | BookType::L2_MBP)
}

Try / catch

match client.subscribe_book_deltas(cmd).await {
    Err(e) if e.to_string().contains("supports L1_MBP and L2_MBP") => return Err(anyhow::anyhow!("switch to L2_MBP: {e}")),
    other => other,
}

Prevention

When it happens

Trigger: subscribe_book_deltas called with cmd.book_type neither L1_MBP nor L2_MBP (e.g. L3_MBP).

Common situations: Configuring a strategy with L3 order book data and routing it to the Binance Futures adapter, or a generic catalog config that doesn't constrain book_type per venue.

Related errors


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

Appendix: source

Thrown at crates/adapters/binance/src/futures/data.rs:1985

    fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> anyhow::Result<()> {
        if cmd.book_type == BookType::L1_MBP {
            anyhow::ensure!(
                cmd.depth.is_none_or(|depth| depth.get() == 1),
                "Binance Futures L1_MBP supports depth 1 only"
            );
            anyhow::ensure!(
                !self.book_subscriptions.contains_key(&cmd.instrument_id),
                "cannot subscribe L1_MBP and L2_MBP for the same Binance Futures instrument"
            );
            self.l1_book_subscriptions.rcu(|subscriptions| {
                *subscriptions.entry(cmd.instrument_id).or_insert(0) += 1;
            });
            self.subscribe_top_of_book(cmd.instrument_id);
            return Ok(());
        }

        if cmd.book_type != BookType::L2_MBP {
            anyhow::bail!("Binance Futures supports L1_MBP and L2_MBP order book subscriptions");
        }
        anyhow::ensure!(
            !self.l1_book_subscriptions.contains_key(&cmd.instrument_id),
            "cannot subscribe L1_MBP and L2_MBP for the same Binance Futures instrument"
        );

        let instrument_id = cmd.instrument_id;
        let depth = cmd.depth.map_or(1000, |d| d.get() as u32);

        if !BINANCE_BOOK_DEPTHS.contains(&depth) {
            anyhow::bail!(
                "Invalid depth {depth} for Binance Futures order book. \
                Valid values: {BINANCE_BOOK_DEPTHS:?}"
            );
        }

        self.book_subscriptions.insert(instrument_id, depth);

View on GitHub (pinned to 18893faf8b)