{"record":{"id":"844533f262055d43","repo":"nautechsystems/nautilus_trader","slug":"polymarket-clob-protocol-version-version-is-unsu","errorCode":null,"errorMessage":"Polymarket CLOB protocol version {version} is unsupported; adapter supports V2 only","messagePattern":"Polymarket CLOB protocol version (.+?) is unsupported; adapter supports V2 only","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/execution/lifecycle.rs","lineNumber":672,"sourceCode":"        }\n        self.stopping.store(false, Ordering::Release);\n        let ws_shutdown = self.ws_client.shutdown_handle();\n        let stopping = Arc::clone(&self.stopping);\n        let setup_guard =\n            TaskGroupGuard::new(&[&self.session_tasks, &self.pending_tasks], move || {\n                stopping.store(true, Ordering::Release);\n                ws_shutdown.begin_shutdown();\n            });\n\n        let version = self\n            .http_client\n            .get_version()\n            .await\n            .context(\"failed to query Polymarket CLOB protocol version\")?\n            .version;\n\n        if version != SUPPORTED_CLOB_VERSION {\n            anyhow::bail!(\n                \"Polymarket CLOB protocol version {version} is unsupported; adapter supports V2 only\"\n            );\n        }\n\n        self.load_instruments_from_cache();\n        self.load_orders_from_cache();\n        self.core.set_instruments_initialized();\n\n        if let Err(e) = self.start_ws_stream().await {\n            if let Err(teardown_error) = self.teardown_partial_connect().await {\n                return Err(e.context(format!(\n                    \"Polymarket startup teardown failed: {teardown_error}\"\n                )));\n            }\n            return Err(e);\n        }\n        self.ensure_order_event_subscription();\n        self.ensure_position_event_subscription();","sourceCodeStart":654,"sourceCodeEnd":690,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/execution/lifecycle.rs#L654-L690","documentation":"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.","triggerScenarios":"connect_client -> get_version() returns a version string other than V2 (e.g. V1, V3, or an unexpected value) during adapter connect.","commonSituations":"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.","solutions":["Check the reported version in the message against SUPPORTED_CLOB_VERSION in the adapter","Upgrade the nautilus polymarket adapter crate to a version supporting the server's protocol version","Verify the configured CLOB API base URL points at the production V2 endpoint","If the server regressed or is staging, point the adapter at an environment running V2","Track Polymarket API release notes for protocol version changes"],"exampleFix":"// before\nlet adapter = PolymarketExecutionClient::new(clob_url: \"https://staging-clob.polymarket.com\", ...);\n// after\nlet adapter = PolymarketExecutionClient::new(clob_url: \"https://clob.polymarket.com\", ...); // V2 endpoint","handlingStrategy":"validation","validationCode":"let version = clob_client.get_version().await?.version;\nif version != \"V2\" {\n    anyhow::bail!(\"CLOB endpoint reports {version}; adapter requires V2 - check base URL or upgrade adapter\");\n}","typeGuard":null,"tryCatchPattern":"match adapter.connect().await {\n    Err(e) if e.to_string().contains(\"unsupported\") => {\n        error!(\"protocol version mismatch: {e:#}\");\n        // halt trading; require config or crate upgrade\n    }\n    Err(e) => return Err(e),\n    Ok(_) => {},\n}","preventionTips":["Pin the adapter to a Polymarket API version and check release notes on upgrades","Use the production clob.polymarket.com endpoint unless deliberately testing","Add a startup version preflight check before initializing the adapter","Alert on this error in production - it means server/client protocol drift"],"tags":["polymarket","version-check","api-compatibility","rust"],"backgroundTag":"unsupported-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}