{"record":{"id":"0e25ea17d303b7fb","repo":"nautechsystems/nautilus_trader","slug":"continuous-future-segment-venue-mismatch-for-targ","errorCode":null,"errorMessage":"Continuous future segment venue mismatch for {target_bar_type}: target venue {target_venue}, segment venues pre={}, post={}","messagePattern":"Continuous future segment venue mismatch for (.+?): target venue (.+?), segment venues pre=(.+?), post=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/data/src/engine/requests.rs","lineNumber":554,"sourceCode":"            .with_context(|| {\n                format!(\"Invalid continuous future transition_time_ns, was {row_value}\")\n            })?;\n\n        if let Some(previous) = previous_transition_time_ns\n            && transition_time_ns <= previous\n        {\n            anyhow::bail!(\n                \"Continuous future transition times must be strictly increasing, was {value}\"\n            );\n        }\n        previous_transition_time_ns = Some(transition_time_ns);\n\n        let pre_instrument_id =\n            parse_transition_instrument_id(row.get(\"pre_instrument_id\"), target_bar_type)?;\n        let post_instrument_id =\n            parse_transition_instrument_id(row.get(\"post_instrument_id\"), target_bar_type)?;\n        if pre_instrument_id.venue != target_venue || post_instrument_id.venue != target_venue {\n            anyhow::bail!(\n                \"Continuous future segment venue mismatch for {target_bar_type}: target venue {target_venue}, segment venues pre={}, post={}\",\n                pre_instrument_id.venue,\n                post_instrument_id.venue,\n            );\n        }\n\n        if let Some(previous) = previous_post_instrument_id\n            && pre_instrument_id != previous\n        {\n            anyhow::bail!(\n                \"Continuous future chain discontinuity for {target_bar_type}: previous post {previous} != current pre {pre_instrument_id}\",\n            );\n        }\n        previous_post_instrument_id = Some(post_instrument_id);\n\n        let pre_price = parse_transition_price(row.get(\"pre_price\"), row_value, \"pre_price\")?;\n        let post_price = parse_transition_price(row.get(\"post_price\"), row_value, \"post_price\")?;\n        if is_ratio && (pre_price <= Decimal::ZERO || post_price <= Decimal::ZERO) {","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/data/src/engine/requests.rs#L536-L572","documentation":"Every transition's pre/post instrument IDs must be listed on the same venue as the target continuous instrument. A segment whose pre or post contract is on another venue breaks the continuity assumption and is rejected.","triggerScenarios":"parse_transitions finds a row where pre_instrument_id.venue or post_instrument_id.venue differs from the target bar type's venue (e.g. a roll row referencing an ICE contract inside a CME continuous series).","commonSituations":"Merging roll tables from multiple exchanges; vendor data with inconsistent venue suffixes; hand-edited transition rows with a wrong venue code.","solutions":["Correct the pre/post instrument IDs so both carry the target venue suffix.","Remove transition rows belonging to other venues.","Validate every transition's venue against the target bar type before building the request."],"exampleFix":"// before\n{\"pre_instrument_id\": \"BRN-ICE\", \"post_instrument_id\": \"CL-NYMEX\"} // target CL...NYMEX\n// after\n{\"pre_instrument_id\": \"CLZ5-NYMEX\", \"post_instrument_id\": \"CLH6-NYMEX\"}","handlingStrategy":"validation","validationCode":"let target_venue = target_bar_type.instrument_id().venue;\nfor t in &transitions {\n    assert_eq!(t.pre_instrument_id.venue, target_venue);\n    assert_eq!(t.post_instrument_id.venue, target_venue);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never merge roll tables across venues","Parse instrument IDs with explicit venue and compare before inserting rows"],"tags":["validation","venue-mismatch","continuous-futures"],"backgroundTag":"invalid-argument-value","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"}