{"record":{"id":"ea7c32d0a7c7e538","repo":"nautechsystems/nautilus_trader","slug":"lighter-conditional-market-orders-do-not-support-t","errorCode":null,"errorMessage":"Lighter conditional market orders do not support TimeInForce::{other:?}","messagePattern":"Lighter conditional market orders do not support TimeInForce::(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/websocket/dispatch.rs","lineNumber":2012,"sourceCode":"            ),\n            other => anyhow::bail!(\n                \"Lighter market orders support only TimeInForce::Gtc or TimeInForce::Ioc, was TimeInForce::{other:?}\",\n            ),\n        };\n    }\n\n    if is_conditional_market_order(order_type) {\n        return match tif {\n            TimeInForce::Gtc | TimeInForce::Day | TimeInForce::Gtd => {\n                Ok(LighterTimeInForce::ImmediateOrCancel)\n            }\n            TimeInForce::Ioc => anyhow::bail!(\n                \"Lighter conditional market orders require a positive expiry; Nautilus IOC cannot be represented because the venue uses IOC for post-trigger execution\",\n            ),\n            TimeInForce::Fok => anyhow::bail!(\n                \"Lighter has no fill-or-kill TIF; reject FOK at the strategy or use IOC explicitly\",\n            ),\n            other => anyhow::bail!(\n                \"Lighter conditional market orders do not support TimeInForce::{other:?}\",\n            ),\n        };\n    }\n\n    match tif {\n        TimeInForce::Ioc => Ok(LighterTimeInForce::ImmediateOrCancel),\n        TimeInForce::Fok => anyhow::bail!(\n            \"Lighter has no fill-or-kill TIF; reject FOK at the strategy or use IOC explicitly\",\n        ),\n        TimeInForce::Gtc | TimeInForce::Day | TimeInForce::Gtd => {\n            Ok(LighterTimeInForce::GoodTillTime)\n        }\n        other => anyhow::bail!(\"Lighter does not support TimeInForce::{other:?}\"),\n    }\n}\n\n/// Translate a Nautilus [`OrderType`] into the venue's [`LighterOrderType`]","sourceCodeStart":1994,"sourceCodeEnd":2030,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/websocket/dispatch.rs#L1994-L2030","documentation":"Catch-all rejection for conditional market orders on Lighter whose TimeInForce is none of Gtc/Day/Gtd (accepted), Ioc and Fok (dedicated errors). Any other TIF value has no mapping to a Lighter conditional-market TIF and is rejected here.","triggerScenarios":"Submitting a conditional market order with a TIF outside {Gtc, Day, Gtd, Ioc, Fok} — e.g. TimeInForce::AtTheOpen, TimeInForce::AtTheClose, or other less-common enum variants.","commonSituations":"Strategies using venue-agnostic TIF constants that resolve to exotic variants; enum drift after a Nautilus version adds new TimeInForce members not yet handled by the adapter.","solutions":["Use TimeInForce::Gtc, Day, or Gtd for conditional market orders","Check the TimeInForce value actually set on the order; it may come from a factory default","Keep the adapter updated when the Nautilus TimeInForce enum gains new variants"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust\nassert!(matches!(tif, TimeInForce::Gtc | TimeInForce::Day | TimeInForce::Gtd), \"Lighter conditional market orders accept Gtc/Day/Gtd only\");","typeGuard":"fn is_lighter_conditional_tif(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Day | TimeInForce::Gtd)\n}","tryCatchPattern":null,"preventionTips":["Whitelist TIF values in config parsing","Re-check adapter coverage after Nautilus TimeInForce enum changes","Log order TIF at submission for fast diagnosis"],"tags":["rust","conditional-orders","time-in-force","exchange-adapter"],"backgroundTag":"unsupported-enum-value","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"}