nautechsystems/nautilus_trader · error

Polymarket CLOB protocol version {version} is unsupported; a

Error message

Polymarket CLOB protocol version {version} is unsupported; adapter supports V2 only

What it means

On connect, the adapter queries the Polymarket CLOB API for its protocol version and refuses to proceed unless it equals SUPPORTED_CLOB_VERSION (V2). This guard prevents the adapter from speaking an incompatible protocol against a changed server API. The error surfaces the server-reported version so the mismatch is diagnosable.

Source

Thrown at crates/adapters/polymarket/src/execution/lifecycle.rs:672

        }
        self.stopping.store(false, Ordering::Release);
        let ws_shutdown = self.ws_client.shutdown_handle();
        let stopping = Arc::clone(&self.stopping);
        let setup_guard =
            TaskGroupGuard::new(&[&self.session_tasks, &self.pending_tasks], move || {
                stopping.store(true, Ordering::Release);
                ws_shutdown.begin_shutdown();
            });

        let version = self
            .http_client
            .get_version()
            .await
            .context("failed to query Polymarket CLOB protocol version")?
            .version;

        if version != SUPPORTED_CLOB_VERSION {
            anyhow::bail!(
                "Polymarket CLOB protocol version {version} is unsupported; adapter supports V2 only"
            );
        }

        self.load_instruments_from_cache();
        self.load_orders_from_cache();
        self.core.set_instruments_initialized();

        if let Err(e) = self.start_ws_stream().await {
            if let Err(teardown_error) = self.teardown_partial_connect().await {
                return Err(e.context(format!(
                    "Polymarket startup teardown failed: {teardown_error}"
                )));
            }
            return Err(e);
        }
        self.ensure_order_event_subscription();
        self.ensure_position_event_subscription();

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Check the reported version in the message against SUPPORTED_CLOB_VERSION in the adapter
  2. Upgrade the nautilus polymarket adapter crate to a version supporting the server's protocol version
  3. Verify the configured CLOB API base URL points at the production V2 endpoint
  4. If the server regressed or is staging, point the adapter at an environment running V2
  5. Track Polymarket API release notes for protocol version changes

Example fix

// before
let adapter = PolymarketExecutionClient::new(clob_url: "https://staging-clob.polymarket.com", ...);
// after
let adapter = PolymarketExecutionClient::new(clob_url: "https://clob.polymarket.com", ...); // V2 endpoint
Defensive patterns

Strategy: validation

Validate before calling

let version = clob_client.get_version().await?.version;
if version != "V2" {
    anyhow::bail!("CLOB endpoint reports {version}; adapter requires V2 - check base URL or upgrade adapter");
}

Try / catch

match adapter.connect().await {
    Err(e) if e.to_string().contains("unsupported") => {
        error!("protocol version mismatch: {e:#}");
        // halt trading; require config or crate upgrade
    }
    Err(e) => return Err(e),
    Ok(_) => {},
}

Prevention

When it happens

Trigger: connect_client -> get_version() returns a version string other than V2 (e.g. V1, V3, or an unexpected value) during adapter connect.

Common situations: Polymarket deploys a new CLOB protocol version; pointing the adapter at a test/staging endpoint running a different version; pinned old adapter against an upgraded API; misconfigured base URL hitting a proxy serving a different version.

Related errors


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