{"record":{"id":"c9f8472ca409c017","repo":"nautechsystems/nautilus_trader","slug":"instrument-instrument-id-not-found-on-polymarket","errorCode":null,"errorMessage":"Instrument {instrument_id} not found on Polymarket","messagePattern":"Instrument (.+?) not found on Polymarket","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/providers.rs","lineNumber":1151,"sourceCode":"                if self.store.contains(instrument_id) {\n                    return Ok(());\n                }\n            }\n        }\n\n        // Fallback: full load_all if not initialized. A provider with an explicit\n        // scope is excluded: `load_all` would broaden it into the full-universe\n        // fetch that scoping exists to avoid, and would also clear the partially\n        // loaded store and mark it initialized, making a later `initialize(false)`\n        // skip the scopes it still owes after a failed bootstrap.\n        if !self.store.is_initialized() && !self.config.has_explicit_scope() {\n            self.load_all(filters).await?;\n        }\n\n        if self.store.contains(instrument_id) {\n            Ok(())\n        } else {\n            anyhow::bail!(\"Instrument {instrument_id} not found on Polymarket\")\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use rstest::rstest;\n\n    use super::*;\n\n    #[rstest]\n    #[case(\"0xcondition-0xtoken\", Some(\"0xtoken\"))]\n    #[case(\"0xcondition-with-dash-0xtoken\", Some(\"0xtoken\"))]\n    #[case(\"0xcondition\", None)]\n    fn extracts_token_id_from_instrument_symbol(\n        #[case] symbol: &str,\n        #[case] expected: Option<&str>,\n    ) {","sourceCodeStart":1133,"sourceCodeEnd":1169,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/providers.rs#L1133-L1169","documentation":"After loading instruments into the provider's store, the requested instrument_id is still absent, so load() fails. load() either loads filtered instruments or falls back to load_all, then checks the store; this error means the instrument does not exist on Polymarket or was not matched by the filters.","triggerScenarios":"Calling provider.load(instrument_id) (directly or via instrument provider initialization) with an ID whose slug/market does not exist, is closed, or was filtered out by the configured load filters.","commonSituations":"Typo in the instrument ID or slug; market resolved/delisted since config was written; load filters too narrow so the fallback load_all is skipped; network returned data that didn't include the market.","solutions":["Verify the instrument_id/slug exists on Polymarket (check via the Gamma API or the website)","Remove or broaden the load filters so load_all/filters can fetch the market","Check for typos and casing in the configured instrument IDs"],"exampleFix":"// before\nprovider.load(\"0x-wrong-address\").await?;\n// after\nlet id = look_up_instrument_id_from_gamma(\"real-slug\").await?;\nprovider.load(&id).await?;","handlingStrategy":"fallback","validationCode":"if !provider.store_contains(&instrument_id) {\n    eprintln!(\"{instrument_id} not cached; verify slug/address via Gamma API first\");\n}","typeGuard":null,"tryCatchPattern":"match provider.load(&instrument_id).await {\n    Err(e) if e.to_string().contains(\"not found on Polymarket\") => {\n        // verify the market exists / clear filters, then retry\n    }\n    r => r?,\n}","preventionTips":["Resolve instrument IDs from the Gamma API at startup rather than hardcoding","Keep load filters minimal so load_all can backfill","Alert on delisted/resolved markets when refreshing config"],"tags":["rust","instruments","not-found","provider"],"backgroundTag":"resource-not-found","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"}