{"record":{"id":"2b67b5dd96827150","repo":"nautechsystems/nautilus_trader","slug":"invalid-stepsize-of-0","errorCode":null,"errorMessage":"Invalid stepSize of 0","messagePattern":"Invalid stepSize of 0","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/parse.rs","lineNumber":793,"sourceCode":"        .filters\n        .iter()\n        .find(|filter| filter.filter_type == \"LOT_SIZE\")\n        .context(\"Missing LOT_SIZE in symbol filters\")?;\n\n    let tick_size = decimal_price(\n        price_filter\n            .tick_size\n            .as_deref()\n            .context(\"Missing PRICE_FILTER tickSize\")?,\n    )?;\n    anyhow::ensure!(!tick_size.is_zero(), \"Invalid tickSize of 0\");\n    let step_size = decimal_quantity(\n        lot_filter\n            .step_size\n            .as_deref()\n            .context(\"Missing LOT_SIZE stepSize\")?,\n    )?;\n    anyhow::ensure!(!step_size.is_zero(), \"Invalid stepSize of 0\");\n\n    let instrument = CurrencyPair::builder()\n        .instrument_id(InstrumentId::new(\n            Symbol::from_str_unchecked(&symbol.symbol),\n            Venue::new(BINANCE),\n        ))\n        .raw_symbol(Symbol::new(&symbol.symbol))\n        .base_currency(get_currency(&symbol.base_asset))\n        .quote_currency(get_currency(&symbol.quote_asset))\n        .price_precision(tick_size.precision)\n        .size_precision(step_size.precision)\n        .price_increment(tick_size)\n        .size_increment(step_size)\n        .lot_size(step_size)\n        .maybe_max_quantity(optional_decimal_quantity(\n            lot_filter.max_qty.as_deref(),\n            step_size.precision,\n        )?)","sourceCodeStart":775,"sourceCodeEnd":811,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/common/parse.rs#L775-L811","documentation":"Venue-data guard when parsing Binance spot symbol filters: a LOT_SIZE step_size of zero is invalid (quantity quantization would divide by zero) and is rejected after being parsed from the exchange filters.","triggerScenarios":"parse_spot_instrument_json_with_fees building a spot instrument when the exchange-info LOT_SIZE.stepSize field is \"0\".","commonSituations":"Malformed or placeholder exchange-info entries (often on testnet); corrupt cached exchange info; new symbols published with incomplete filters.","solutions":["Skip or exclude the affected symbol from instrument loading","Re-fetch exchange-info and confirm the filter values are sane","Use load_ids to load only verified symbols","Update the adapter if Binance changes how it publishes stepSize"],"exampleFix":"// before\nlet instrument = parse_spot_instrument_json(&json)?;\n// after\nlet step = json[\"filters\"][\"stepSize\"].as_str().unwrap_or_default();\nif step == \"0\" || step.is_empty() { eprintln!(\"skip: zero stepSize\"); continue; }","handlingStrategy":"validation","validationCode":"let step = lot_filter[\"stepSize\"].as_str().unwrap_or(\"0\"); if step.parse::<Decimal>().map(|d| d.is_zero()).unwrap_or(true) { skip_symbol(); }","typeGuard":"fn valid_step(f: &serde_json::Value) -> bool { f[\"stepSize\"].as_str().and_then(|s| s.parse::<Decimal>().ok()).map_or(false, |d| !d.is_zero()) }","tryCatchPattern":"match build_instrument(&sym) { Ok(i) => Some(i), Err(e) if e.to_string().contains(\"stepSize\") => { warn!(\"skip: {e}\"); None }, Err(e) => return Err(e) }","preventionTips":["Validate LOT_SIZE fields before instrument construction","Avoid cached or stale exchange-info snapshots","Report persistent zero-stepSize symbols to Binance support"],"tags":["binance","instruments","step-size","validation"],"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-23T08:17:48.524Z"}