{"record":{"id":"3f09d74812a523c0","repo":"nautechsystems/nautilus_trader","slug":"lighter-does-not-support-timeinforce-other","errorCode":null,"errorMessage":"Lighter does not support TimeInForce::{other:?}","messagePattern":"Lighter does not support TimeInForce::(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/websocket/dispatch.rs","lineNumber":2026,"sourceCode":"            ),\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`]\n/// discriminant for use in `CreateOrder` tx bodies.\npub(crate) fn nautilus_to_lighter_order_type(\n    order_type: OrderType,\n) -> anyhow::Result<LighterOrderType> {\n    LighterOrderType::try_from(order_type)\n        .map_err(|e| anyhow::anyhow!(\"unsupported Nautilus order type for Lighter: {e}\"))\n}\n\n/// Compute the venue-side `order_expiry` (millis) for a Nautilus order.\n///\n/// - `MARKET`: `ORDER_EXPIRY_IOC` (`0`) because it has no resting trigger\n///   lifetime.\n/// - Conditional orders: positive expiry from `GTD` or the default GTC window.\n///   Lighter uses `TimeInForce` as the post-trigger execution instruction,","sourceCodeStart":2008,"sourceCodeEnd":2044,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/websocket/dispatch.rs#L2008-L2044","documentation":"Catch-all for TimeInForce values the Lighter adapter does not recognize in the general TIF translation path. Accepted values are Ioc (ImmediateOrCancel), Gtc/Day/Gtd (GoodTillTime); Fok has a dedicated error; everything else lands here.","triggerScenarios":"Submitting a Lighter order with any TimeInForce outside {Ioc, Fok, Gtc, Day, Gtd} — e.g. AtTheOpen, AtTheClose, or Auction variants.","commonSituations":"A Nautilus version bump introducing new TimeInForce variants; strategy code constructing TimeInForce dynamically from config that lets arbitrary values through.","solutions":["Restrict configured/allowed TIFs to Gtc, Ioc, Day, or Gtd for Lighter","Whitelist TIF values in strategy config parsing before order creation","Update the adapter match when new TimeInForce variants must be supported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust\nfn lighter_tif_supported(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Ioc | TimeInForce::Gtc | TimeInForce::Day | TimeInForce::Gtd)\n}","typeGuard":"fn is_supported_lighter_tif(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Ioc | TimeInForce::Gtc | TimeInForce::Day | TimeInForce::Gtd)\n}","tryCatchPattern":null,"preventionTips":["Restrict TIF to the four supported variants in strategy config","Handle new TimeInForce enum variants explicitly when upgrading Nautilus","Avoid constructing TIF from unvalidated strings"],"tags":["rust","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"}