nautechsystems/nautilus_trader · error

Polymarket does not support OrderBookDepth10 subscriptions;

Error message

Polymarket does not support OrderBookDepth10 subscriptions; use managed L2_MBP order book deltas

What it means

subscribe_book_depth10 is deliberately unimplemented for Polymarket: the venue feed only supports incremental L2 level updates managed by the adapter, not fixed 10-level depth snapshots. The adapter always fails this call and directs users to managed L2_MBP order book deltas instead.

Source

Thrown at crates/adapters/polymarket/src/data/mod.rs:679

            );
        }

        // Mark intent before routing so unsubscribe can race-safely clear it.
        if !self.add_delta_subscription_intent(instrument_id) {
            return Ok(());
        }

        if !cached {
            self.queue_pending_load(instrument_id);
            return Ok(());
        }

        self.sync_ws_subscription(instrument_id);
        Ok(())
    }

    fn subscribe_book_depth10(&mut self, _cmd: SubscribeBookDepth10) -> anyhow::Result<()> {
        anyhow::bail!(
            "Polymarket does not support OrderBookDepth10 subscriptions; use managed L2_MBP order book deltas"
        )
    }

    fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> anyhow::Result<()> {
        let instrument_id = cmd.instrument_id;
        self.ensure_live_subscription_allowed(instrument_id)?;
        let cached = self.instruments.load().contains_key(&instrument_id);

        if !cached && !self.config.auto_load_missing_instruments {
            anyhow::bail!(
                "Instrument {instrument_id} not found, and `auto_load_missing_instruments` is disabled"
            );
        }

        if !self.add_live_subscription_intent(instrument_id, &self.active_quote_subs) {
            return Ok(());
        }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Switch the data subscription to SubscribeBookDeltas with BookType::L2_MBP and let the adapter manage the book.
  2. If fixed-depth snapshots are required, maintain them locally from the L2 delta stream.
  3. Branch subscription logic per venue so depth10 is only requested where supported.

Example fix

// before
client.subscribe_book_depth10(cmd)?;

// after
let cmd = SubscribeBookDeltas {
    instrument_id,
    book_type: BookType::L2_MBP,
    ..cmd_as_deltas
};
client.subscribe_book_deltas(cmd)?;
Defensive patterns

Strategy: validation

Validate before calling

if venue == Venue::POLYMARKET && cmd is depth10 {
    return Err(anyhow::anyhow!("use L2_MBP deltas on Polymarket"));
}

Prevention

When it happens

Trigger: Any call to subscribe_book_depth10 on the Polymarket data client — it is unconditional (no configuration can enable it).

Common situations: Porting a strategy written for a crypto exchange adapter (where depth10 snapshots are common) to Polymarket without adjusting the book subscription type; generic subscription code that requests depth10 by default.

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


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