{"record":{"id":"7181f35fccfa6f19","repo":"nautechsystems/nautilus_trader","slug":"order-notional-notional-below-lighter-min-quot","errorCode":null,"errorMessage":"order notional `{notional}` below Lighter min_quote_amount `{}` for {}","messagePattern":"order notional `(.+?)` below Lighter min_quote_amount `(.+?)` for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":5645,"sourceCode":"\nfn validate_order_amount(\n    instrument: &InstrumentAny,\n    quantity: Quantity,\n    price_ticks: u32,\n    price_precision: u8,\n) -> anyhow::Result<()> {\n    if let Some(min_quantity) = instrument.min_quantity() {\n        anyhow::ensure!(\n            quantity >= min_quantity,\n            \"quantity `{quantity}` below Lighter min_base_amount `{min_quantity}` for {}\",\n            instrument.id(),\n        );\n    }\n\n    if let Some(min_notional) = instrument.min_notional() {\n        let price = decimal_from_ticks(price_ticks, price_precision);\n        let notional = quantity.as_decimal() * price;\n        anyhow::ensure!(\n            notional >= min_notional.as_decimal(),\n            \"order notional `{notional}` below Lighter min_quote_amount `{}` for {}\",\n            min_notional.as_decimal(),\n            instrument.id(),\n        );\n    }\n\n    Ok(())\n}\n\nfn decimal_from_ticks(ticks: u32, decimals: u8) -> Decimal {\n    Decimal::from(ticks) / Decimal::from(10_i64.pow(u32::from(decimals)))\n}\n\n/// Route a venue `account_orders` payload through the tracked-event path\n/// when the cloid is known, otherwise fall back to the existing\n/// [`OrderStatusReport`] flow used for externally-managed orders.\nfn dispatch_lighter_order(","sourceCodeStart":5627,"sourceCodeEnd":5663,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L5627-L5663","documentation":"The adapter validates that the order notional (quantity × limit price, computed from price_ticks) meets the instrument's minimum quote amount (min_notional). Lighter rejects orders below this threshold, so the adapter pre-validates and raises this error instead.","triggerScenarios":"Submitting a limit order where quantity × price (from price_ticks and price_precision) is less than instrument.min_notional() — small quantity at a low price, or a mis-scaled price (wrong tick precision).","commonSituations":"Small test orders on high-priced markets, price tick conversion errors making notional appear tiny, risk engine clipping size below notional minimums.","solutions":["Increase order size or price so quantity × price meets min_notional before submission.","Verify price_ticks/price_precision conversion — a scaling bug often produces an undersized notional.","Consult instrument.min_notional() in strategy sizing logic and enforce it pre-trade.","Skip or aggregate sub-minimum orders instead of submitting them."],"exampleFix":"// before\nlet price = decimal_from_ticks(price_ticks, price_precision);\nsubmit(quantity, price);\n// after\nlet price = decimal_from_ticks(price_ticks, price_precision);\nif let Some(min_notional) = instrument.min_notional() {\n    if quantity.as_decimal() * price < min_notional.as_decimal() {\n        tracing::warn!(\"order notional below min_quote_amount; skipping\");\n        return Ok(());\n    }\n}\nsubmit(quantity, price);","handlingStrategy":"validation","validationCode":"let price = decimal_from_ticks(price_ticks, price_precision);\nif let Some(min_n) = instrument.min_notional() {\n    assert!(quantity.as_decimal() * price >= min_n.as_decimal(), \"notional below minimum\");\n}","typeGuard":"fn meets_min_notional(instrument: &InstrumentAny, qty: Quantity, price_ticks: u32, precision: u8) -> bool {\n    instrument.min_notional().map_or(true, |min| {\n        qty.as_decimal() * decimal_from_ticks(price_ticks, precision) >= min.as_decimal()\n    })\n}","tryCatchPattern":"match submit_result {\n    Err(e) if e.to_string().contains(\"below Lighter min_quote_amount\") => {\n        // increase size or skip; log for sizing review\n    }\n    other => other,\n}","preventionTips":["Enforce min_notional in pre-trade risk checks","Unit-test price tick/precision conversions to avoid undersized notional","Aggregate sub-minimum orders instead of dropping them silently"],"tags":["order-validation","lighter","min-notional","pre-trade-check"],"backgroundTag":"value-out-of-range","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"}