{"record":{"id":"c596a911c949786b","repo":"nautechsystems/nautilus_trader","slug":"gamma-scope-filter-key-must-be-a-decimal-num","errorCode":null,"errorMessage":"Gamma {scope} filter '{key}' must be a decimal number: {e}","messagePattern":"Gamma (.+?) filter '(.+?)' must be a decimal number: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/providers.rs","lineNumber":993,"sourceCode":"        anyhow::bail!(\"Gamma {scope} filter '{key}' must be true or false, was '{value}'\")\n    }\n}\n\nfn parse_gamma_filter_u32(scope: &str, key: &str, value: &str) -> anyhow::Result<u32> {\n    value.parse::<u32>().map_err(|e| {\n        anyhow::anyhow!(\"Gamma {scope} filter '{key}' must be an unsigned integer: {e}\")\n    })\n}\n\nfn parse_gamma_filter_u64(scope: &str, key: &str, value: &str) -> anyhow::Result<u64> {\n    value.parse::<u64>().map_err(|e| {\n        anyhow::anyhow!(\"Gamma {scope} filter '{key}' must be an unsigned integer: {e}\")\n    })\n}\n\nfn parse_gamma_filter_decimal(scope: &str, key: &str, value: &str) -> anyhow::Result<Decimal> {\n    parse_decimal_exact(value)\n        .map_err(|e| anyhow::anyhow!(\"Gamma {scope} filter '{key}' must be a decimal number: {e}\"))\n}\n\nfn parse_gamma_filter_list(scope: &str, key: &str, value: &str) -> anyhow::Result<Vec<String>> {\n    let values = value\n        .split(',')\n        .map(str::trim)\n        .map(str::to_string)\n        .collect::<Vec<_>>();\n\n    if values.is_empty() || values.iter().any(String::is_empty) {\n        anyhow::bail!(\"Gamma {scope} filter '{key}' must contain non-empty comma-separated values\")\n    }\n    Ok(values)\n}\n\nfn parse_gamma_numeric_filter_list(\n    scope: &str,\n    key: &str,","sourceCodeStart":975,"sourceCodeEnd":1011,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/providers.rs#L975-L1011","documentation":"parse_gamma_filter_decimal parses a Gamma filter as a Decimal via parse_decimal_exact and re-wraps failures as 'Gamma {scope} filter {key} must be a decimal number'. parse_decimal_exact requires exact decimal representation, so scientific notation or extra precision that cannot be represented exactly will fail.","triggerScenarios":"Supplying a price/threshold-style Gamma filter like \"1e-5\", \"0.1.2\", \"\", or a value with too many decimal places that parse_decimal_exact rejects.","commonSituations":"Scientific-notation numbers from JSON configs, locale decimal commas (\"1,25\"), or over-precise floats from upstream systems.","solutions":["Write the value as a plain decimal string with a dot separator, e.g. \"0.00001\" instead of \"1e-5\"","Convert commas to dots and remove currency symbols/thousands separators before parsing","Round the value to the exchange's supported precision before passing it","Call parse_decimal_exact on the value in your own code first to get the raw reason"],"exampleFix":"// before\nfilters.insert(\"min_liquidity\", \"1e5\");\n// after\nfilters.insert(\"min_liquidity\", \"100000\");","handlingStrategy":"validation","validationCode":"// Rust: plain decimal check mirroring parse_decimal_exact expectations\nfn is_plain_decimal(v: &str) -> bool {\n    let v = v.trim();\n    !v.is_empty() && !v.contains('e') && !v.contains('E')\n        && v.replace('.', \"\").chars().all(|c| c.is_ascii_digit())\n        && v.matches('.').count() <= 1\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid scientific notation in decimal config values; write 0.00001 not 1e-5","Normalize locale decimal commas to dots before parsing","Round to the venue's tick size before passing thresholds"],"tags":["validation","parsing","decimal","polymarket","gamma-api"],"backgroundTag":"invalid-argument-format","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"}