{"record":{"id":"ff2e337a2b24badb","repo":"nautechsystems/nautilus_trader","slug":"gtd-time-in-force-is-not-supported-by-hyperliquid","errorCode":null,"errorMessage":"GTD time in force is not supported by Hyperliquid","messagePattern":"GTD 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":253,"sourceCode":"    HyperliquidConditionalOrderType::from(order_type)\n}\n\n/// Converts a Nautilus `TimeInForce` to a Hyperliquid time in force.\n///\n/// # Errors\n///\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","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/common/converters.rs#L235-L271","documentation":"Conversion branch in nautilus_time_in_force_to_hyperliquid: Hyperliquid orders support only GTC and IOC time in force, so a GTD order cannot be represented and conversion fails before order submission.","triggerScenarios":"Converting a Nautilus order with TimeInForce::Gtd (with an expire time) through nautilus_time_in_force_to_hyperliquid for a Hyperliquid submission.","commonSituations":"Strategies that schedule order expiry per session/day and are ported to Hyperliquid; GTD defaults set in venue-agnostic config.","solutions":["Switch the order to GTC and cancel it yourself at the intended expiry time.","Use IOC/GTC depending on desired aggressiveness instead of GTD.","Guard at the strategy layer: if venue is Hyperliquid, translate GTD to GTC plus a scheduled cancel."],"exampleFix":"// before\nlet order = limit_order(tif: TimeInForce::Gtd, expire: expire_time);\n// after\nlet order = limit_order(tif: TimeInForce::Gtc);\nschedule_cancel(order_id, expire_time); // emulate expiry client-side","handlingStrategy":"fallback","validationCode":"fn hyperliquid_tif_ok(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc)\n}","typeGuard":null,"tryCatchPattern":"let hl_tif = nautilus_time_in_force_to_hyperliquid(tif)\n    .unwrap_or(HyperliquidTimeInForce::Gtc); // pair with client-side scheduled cancel","preventionTips":["Translate GTD to GTC plus a scheduled cancel for Hyperliquid.","Validate TIF at order construction, not at submit time.","Keep venue defaults per-venue rather than global."],"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"}