{"record":{"id":"e6d36de34192e94e","repo":"nautechsystems/nautilus_trader","slug":"e-e6d36d","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/http/clob.rs","lineNumber":739,"sourceCode":"            .request_with_params(Method::GET, url, None::<&()>, None, None, None, None)\n            .await\n            .map_err(Error::from_http_client)?;\n\n        decode_response(&response)\n    }\n\n    /// Requests an order book snapshot and builds an [`OrderBook`].\n    pub async fn request_book_snapshot(\n        &self,\n        instrument_id: InstrumentId,\n        token_id: &str,\n        price_precision: u8,\n        size_precision: u8,\n    ) -> anyhow::Result<OrderBook> {\n        let resp = self\n            .get_book(token_id)\n            .await\n            .map_err(|e| anyhow::anyhow!(e))?;\n\n        let mut book = OrderBook::new(instrument_id, BookType::L2_MBP);\n\n        for (i, level) in resp.bids.iter().enumerate() {\n            let price = parse_price(&level.price, price_precision)?;\n            let size = parse_quantity(&level.size, size_precision)?;\n            let order = BookOrder::new(OrderSide::Buy, price, size, i as u64);\n            book.add(order, 0, i as u64, Default::default());\n        }\n\n        let bids_len = resp.bids.len();\n        for (i, level) in resp.asks.iter().enumerate() {\n            let price = parse_price(&level.price, price_precision)?;\n            let size = parse_quantity(&level.size, size_precision)?;\n            let order = BookOrder::new(OrderSide::Sell, price, size, (bids_len + i) as u64);\n            book.add(order, 0, (bids_len + i) as u64, Default::default());\n        }\n","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/http/clob.rs#L721-L757","documentation":"request_book_snapshot fetches the CLOB order book via get_book and wraps any transport/HTTP error from that call into an anyhow::Error with this message. It indicates the order-book snapshot could not be retrieved from the Polymarket CLOB API, so no OrderBook is built.","triggerScenarios":"Calling request_book_snapshot while the CLOB /book endpoint returns a network error, non-2xx response, timeout, or the token_id is rejected by the server.","commonSituations":"Invalid or delisted token_id, CLOB API outage or rate limiting, DNS/proxy failures, or running against a stale/incorrect CLOB host.","solutions":["Inspect the inner error message ({e}) to distinguish transport vs HTTP status causes.","Verify the token_id is a valid, active CLOB token id.","Retry with backoff for transient transport errors; check Polymarket status if 5xx persists."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if token_id.is_empty() { bail!(\"token_id required for book snapshot\"); }","typeGuard":null,"tryCatchPattern":"match client.request_book_snapshot(instrument_id, token_id, pp, sp).await {\n    Ok(book) => book,\n    Err(e) => { warn!(\"book snapshot failed: {e}\"); backoff_retry(|| client.request_book_snapshot(...), 3).await? }\n}","preventionTips":["Validate token ids come from a parsed Gamma market, not ad-hoc strings.","Apply exponential backoff for transport errors against the CLOB API.","Monitor CLOB API status/rate limits in production deployments."],"tags":["rust","http","polymarket","orderbook"],"backgroundTag":"http-request-failed","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"}