{"record":{"id":"a6e1c7887a1139aa","repo":"nautechsystems/nautilus_trader","slug":"no-venue-config-found-for-venue-venue-require","errorCode":null,"errorMessage":"No venue config found for venue '{venue}' (required by instrument {instrument_id})","messagePattern":"No venue config found for venue '(.+?)' \\(required by instrument (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/backtest/src/node.rs","lineNumber":344,"sourceCode":"        );\n\n        let venue_names: Vec<String> = config\n            .venues()\n            .iter()\n            .map(|v| v.name().to_string())\n            .collect();\n\n        for data_config in config.data() {\n            if let (Some(start), Some(end)) = (data_config.start_time(), data_config.end_time()) {\n                anyhow::ensure!(\n                    start <= end,\n                    \"Data config start_time ({start}) must be <= end_time ({end})\"\n                );\n            }\n\n            for instrument_id in data_config.get_instrument_ids()? {\n                let venue = instrument_id.venue.to_string();\n                anyhow::ensure!(\n                    venue_names.contains(&venue),\n                    \"No venue config found for venue '{venue}' (required by instrument {instrument_id})\"\n                );\n            }\n        }\n\n        for venue_config in config.venues() {\n            let needs_book_data = matches!(\n                venue_config.book_type(),\n                BookType::L2_MBP | BookType::L3_MBO\n            );\n\n            if needs_book_data {\n                let venue_name = venue_config.name().to_string();\n                let has_book_data = config.data().iter().any(|dc| {\n                    let is_book_type = matches!(\n                        dc.data_type(),\n                        NautilusDataType::OrderBookDelta | NautilusDataType::OrderBookDepth10","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/backtest/src/node.rs#L326-L362","documentation":"During backtest node configuration validation, every instrument referenced by a data config must belong to a venue that also has a venue config defined. This error is thrown when an instrument's venue is not present in the configured venue names, so the backtest engine cannot build a matching venue/matching-engine for it.","triggerScenarios":"Constructing a BacktestNode via BacktestNode::new and calling add_data (or passing a data config whose get_instrument_ids() yields instruments) where an instrument's venue (e.g. 'SIM' in 'AAPL.NASDAQ') has no corresponding add_venue call.","commonSituations":"Typo in the venue suffix of an instrument ID (e.g. 'EUR/USD.SIM' vs venue 'SIMULATION'); adding market data for a venue that was never registered; loading instruments from a catalog for exchanges not configured in the node.","solutions":["Add a venue config for the missing venue via BacktestNode.add_venue(...) before building the node.","Check each instrument ID's venue suffix and correct typos so it matches a configured venue name.","Remove data configs / instruments whose venues are not part of the backtest."],"exampleFix":"// before\nnode.add_data(InstrumentId::from(\"AAPL.NASDAQ\")); // no NASDAQ venue configured\n// after\nnode.add_venue(Venue::from(\"NASDAQ\"));\nnode.add_data(InstrumentId::from(\"AAPL.NASDAQ\"));","handlingStrategy":"validation","validationCode":"# python side, before building the node\nvenue_names = {v.name for v in venue_configs}\nfor inst in instruments:\n    assert inst.venue.value in venue_names, f\"venue {inst.venue.value} missing for {inst.id}\"\n","typeGuard":null,"tryCatchPattern":"try:\n    node = BacktestNode(config)\nexcept ValueError as e:\n    if \"No venue config found\" in str(e):\n        # log venue names + instrument ids and abort config build\n        raise SystemExit(f\"Backtest misconfigured: {e}\")\n    raise\n","preventionTips":["Build venue configs from the same source as instrument IDs (derive venues from instruments, not hand-written lists).","Keep instrument ID venue suffixes consistent with a single shared venue naming constant.","Validate all data configs and venue configs together in a small pre-check function before BacktestNode::new."],"tags":["backtest","config","venue","instrument"],"backgroundTag":"missing-required-config","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"}