{"record":{"id":"6d35d0297fb13075","repo":"nautechsystems/nautilus_trader","slug":"e-6d35d0","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/http/gamma.rs","lineNumber":660,"sourceCode":"                                parse_markets_to_instruments(&markets, ts_init)\n                            })\n                            .collect();\n\n                        if instruments.is_empty() {\n                            return Err(Error::transport(\n                                \"Gamma returned no instruments (indexing lag)\",\n                            ));\n                        }\n\n                        Ok(instruments)\n                    }\n                },\n                |e| e.is_retryable(),\n                |e| Error::transport(e.to_string()),\n            )\n            .execute()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"{e}\"))\n    }\n\n    /// Fetches instruments from event slugs concurrently.\n    ///\n    /// Each slug queries `GET /events?slug=`, extracts the markets array from\n    /// the first matching event, and parses each market into instruments.\n    pub async fn request_instruments_by_event_slugs(\n        &self,\n        event_slugs: Vec<String>,\n    ) -> anyhow::Result<Vec<InstrumentAny>> {\n        let ts_init = self.clock.get_time_ns();\n\n        let futures = event_slugs.into_iter().map(|slug| {\n            let inner = Arc::clone(&self.inner);\n            async move {\n                match inner.get_gamma_events_by_slug(&slug).await {\n                    Ok(events) => Some((slug, events)),\n                    Err(e) => {","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/http/gamma.rs#L642-L678","documentation":"request_instruments_by_slugs_with_retry executes the retried Gamma API request and maps any remaining error into anyhow with this message. It means the instrument fetch from the Gamma /events endpoint failed after retry attempts.","triggerScenarios":"Calling request_instruments_by_slugs_with_retry when every retry fails — e.g. persistent transport errors, non-retryable HTTP errors, or the retry policy exhausting its attempts against GET /events?slug=.","commonSituations":"Gamma API outage, rate limiting beyond the retry budget, invalid slugs causing repeated HTTP errors, or network/proxy misconfiguration in the deployment environment.","solutions":["Read the wrapped error {e} for the underlying cause (transport vs HTTP status vs retry exhaustion).","Confirm the slug values are correct and the Gamma endpoint is reachable.","Increase retry attempts/backoff or handle non-retryable Error variants explicitly before retrying."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"for slug in &slugs { if slug.is_empty() { bail!(\"empty slug\"); } }","typeGuard":null,"tryCatchPattern":"match request_instruments_by_slugs_with_retry(slugs).await {\n    Ok(instruments) => instruments,\n    Err(e) => { error!(\"gamma instruments fetch failed after retries: {e}\"); Vec::new() }\n}","preventionTips":["Validate slugs before issuing requests.","Keep the retry policy's is_retryable predicate aligned with which errors are genuinely transient.","Set alerting on Gamma API failure rates to catch outages early."],"tags":["rust","http","polymarket","gamma","retry"],"backgroundTag":"api-request-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}