{"record":{"id":"6770a9eb6bbba721","repo":"nautechsystems/nautilus_trader","slug":"at-the-close-time-in-force-is-not-supported-by-hyp","errorCode":null,"errorMessage":"AT_THE_CLOSE time in force is not supported by Hyperliquid","messagePattern":"AT_THE_CLOSE 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":262,"sourceCode":"    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\n/// Determines the TP/SL type based on order type and side.\n///\n/// # Logic","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/common/converters.rs#L244-L280","documentation":"nautilus_time_in_force_to_hyperliquid cannot map an AtTheClose time-in-force; Hyperliquid has no closing-auction TIF concept, so this Nautilus TIF variant has no equivalent and the conversion is rejected.","triggerScenarios":"Converting TimeInForce::AtTheClose via nautilus_time_in_force_to_hyperliquid when routing an order to Hyperliquid.","commonSituations":"Strategies liquidating at the close ported from equities; shared order templates across venues.","solutions":["Use a market/limit order with GTC or IOC submitted at your desired close time.","Cancel remaining quantity after your close window to emulate MOC behavior.","Add a venue-capability check that blocks AtTheClose for Hyperliquid."],"exampleFix":"// before\nlet tif = TimeInForce::AtTheClose;\n// after\nlet tif = TimeInForce::Gtc; // schedule submission near session close yourself","handlingStrategy":"validation","validationCode":"fn hyperliquid_tif_ok(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc)\n}\nif !hyperliquid_tif_ok(tif) { return Err(anyhow::anyhow!(\"unsupported TIF {tif:?} for Hyperliquid\")); }","typeGuard":null,"tryCatchPattern":"match nautilus_time_in_force_to_hyperliquid(tif) {\n    Ok(t) => send(t),\n    Err(e) => anyhow::bail!(\"adjust time in force: {e}\"),\n}","preventionTips":["Use GTC/IOC with your own close-window scheduling.","Keep a single TIF capability check used by all order paths.","Test order builders against the supported TIF set for each venue."],"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-14T05:17:10.506Z"}