{"record":{"id":"95295449645d28f1","repo":"nautechsystems/nautilus_trader","slug":"crypto-tick-scheme-is-valid","errorCode":null,"errorMessage":"crypto tick scheme is valid","messagePattern":"crypto tick scheme is valid","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/model/src/instruments/tick_scheme.rs","lineNumber":203,"sourceCode":"            (30_000.0, 100_000.0, 10.0),\n            (100_000.0, 300_000.0, 50.0),\n            (300_000.0, 1_000_000.0, 100.0),\n            (1_000_000.0, 3_000_000.0, 500.0),\n            (3_000_000.0, 10_000_000.0, 1_000.0),\n            (10_000_000.0, 30_000_000.0, 5_000.0),\n            (30_000_000.0, f64::INFINITY, 10_000.0),\n        ],\n        4,\n        10_000,\n    )\n    .expect(\"TOPIX100 tick scheme tiers are valid by construction\")\n});\n\nstatic FIXED_TICK_SCHEME: LazyLock<FixedTickScheme> =\n    LazyLock::new(|| FixedTickScheme::new(1.0).expect(\"fixed tick scheme is valid\"));\n\nstatic CRYPTO_0_01_TICK_SCHEME: LazyLock<FixedTickScheme> =\n    LazyLock::new(|| FixedTickScheme::new(0.01).expect(\"crypto tick scheme is valid\"));\n\nstatic FIXED_PRECISION_TICK_SCHEMES: LazyLock<Vec<FixedTickScheme>> = LazyLock::new(|| {\n    (0..=FIXED_PRECISION)\n        .map(|precision| {\n            let tick = 10_f64.powi(-i32::from(precision));\n            FixedTickScheme::new(tick).expect(\"fixed precision tick scheme is valid\")\n        })\n        .collect()\n});\n\n#[derive(Debug, Clone, Copy, PartialEq)]\npub struct FixedTickScheme {\n    tick: f64,\n}\n\nimpl Eq for FixedTickScheme {}\n\nimpl FixedTickScheme {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/model/src/instruments/tick_scheme.rs#L185-L221","documentation":"Panic site for the CRYPTO_0_01_TICK_SCHEME static, which constructs FixedTickScheme::new(0.01). The constructor rejects non-finite/non-positive ticks; 0.01 is valid by construction, so this expect should never fire. It exists to convert the Result into a plain value for a global constant and doubles as a guard against regressions in the tick validation logic.","triggerScenarios":"Untriggerable in normal use; only reachable if FixedTickScheme::new's validation is modified to reject the hard-coded 0.01 tick, then any use of the crypto tick scheme static panics on first access.","commonSituations":"Seen only after edits to tick_scheme.rs validation code or the constant, surfacing as a panic during the first price-rounding operation that touches the static.","solutions":["Check recent diffs to FixedTickScheme::new for an over-strict validity check (e.g. rejecting small ticks via epsilon comparison).","Verify the constant 0.01 wasn't changed to 0.0 or NaN.","Run the module's tests to reproduce and fix the validation regression.","No user-side action needed — this is library-internal."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Library-internal static; nothing for users to validate.\n// If you maintain this code:\nassert!(0.01_f64.is_finite() && 0.01 > 0.0);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid epsilon comparisons in FixedTickScheme::new that could reject small ticks.","Keep the crypto tick constant unmodified.","Cover static initializers with unit tests."],"tags":["rust","panic","static-init","invariant"],"backgroundTag":"internal-invariant-violation","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"}