{"record":{"id":"b1b35f491f8c46b7","repo":"nautechsystems/nautilus_trader","slug":"at-the-open-time-in-force-is-not-supported-by-hype","errorCode":null,"errorMessage":"AT_THE_OPEN time in force is not supported by Hyperliquid","messagePattern":"AT_THE_OPEN time in force is not supported by Hyperliquid","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/common/converters.rs","lineNumber":259,"sourceCode":"///\n/// Returns an error if the time in force is not supported (e.g. FOK).\npub fn nautilus_time_in_force_to_hyperliquid(\n    tif: TimeInForce,\n) -> anyhow::Result<HyperliquidTimeInForce> {\n    match tif {\n        TimeInForce::Gtc => Ok(HyperliquidTimeInForce::Gtc),\n        TimeInForce::Ioc => Ok(HyperliquidTimeInForce::Ioc),\n        TimeInForce::Fok => {\n            anyhow::bail!(\"FOK time in force is not supported by Hyperliquid\")\n        }\n        TimeInForce::Gtd => {\n            anyhow::bail!(\"GTD time in force is not supported by Hyperliquid\")\n        }\n        TimeInForce::Day => {\n            anyhow::bail!(\"DAY time in force is not supported by Hyperliquid\")\n        }\n        TimeInForce::AtTheOpen => {\n            anyhow::bail!(\"AT_THE_OPEN time in force is not supported by Hyperliquid\")\n        }\n        TimeInForce::AtTheClose => {\n            anyhow::bail!(\"AT_THE_CLOSE time in force is not supported by Hyperliquid\")\n        }\n    }\n}\n\n/// Converts a Hyperliquid time in force to a Nautilus `TimeInForce`.\npub fn hyperliquid_time_in_force_to_nautilus(hl_tif: HyperliquidTimeInForce) -> TimeInForce {\n    match hl_tif {\n        HyperliquidTimeInForce::Gtc => TimeInForce::Gtc,\n        HyperliquidTimeInForce::Ioc\n        | HyperliquidTimeInForce::FrontendMarket\n        | HyperliquidTimeInForce::LiquidationMarket => TimeInForce::Ioc,\n        HyperliquidTimeInForce::Alo => TimeInForce::Gtc,\n    }\n}\n","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/common/converters.rs#L241-L277","documentation":"nautilus_time_in_force_to_hyperliquid cannot map an AtTheOpen time-in-force; Hyperliquid has no auction/Opening TIF concept, so this Nautilus TIF variant has no equivalent and the conversion is rejected.","triggerScenarios":"Converting TimeInForce::AtTheOpen via nautilus_time_in_force_to_hyperliquid when submitting an order to Hyperliquid.","commonSituations":"Porting equity strategies (opening auctions) to crypto; copy-pasted TimeInForce values from other adapters.","solutions":["Use a market or limit order with IOC/GTC timed by your own logic instead of AT_THE_OPEN.","Schedule submission for the desired open time and use GTC/IOC.","Reject AT_THE_OPEN orders at order construction for crypto venues."],"exampleFix":"// before\nlet tif = TimeInForce::AtTheOpen;\n// after\nlet tif = TimeInForce::Ioc; // submit at your intended time instead","handlingStrategy":"validation","validationCode":"fn hyperliquid_tif_ok(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc)\n}\nassert!(hyperliquid_tif_ok(order.time_in_force()));","typeGuard":null,"tryCatchPattern":"let hl_tif = nautilus_time_in_force_to_hyperliquid(tif)\n    .unwrap_or(HyperliquidTimeInForce::Gtc); // schedule submission timing yourself","preventionTips":["Implement open/close timing in strategy logic, not via TIF.","Block AtTheOpen/AtTheClose in crypto venue order builders.","Audit ported equity strategies for equity-only TIF values."],"tags":["hyperliquid","time-in-force","rust","order-routing"],"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-14T00:17:10.932Z"}