{"record":{"id":"5e3606f9b895c73c","repo":"nautechsystems/nautilus_trader","slug":"unsupported-time-in-force-other-for-deribit","errorCode":null,"errorMessage":"Unsupported time_in_force {other:?} for Deribit","messagePattern":"Unsupported time_in_force (.+?) for Deribit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/deribit/src/execution.rs","lineNumber":277,"sourceCode":"            // Deribit rejects `time_in_force` on market-style order types\n            None\n        } else {\n            Some(\n                match order.time_in_force() {\n                    TimeInForce::Gtc => \"good_til_cancelled\",\n                    TimeInForce::Ioc => \"immediate_or_cancel\",\n                    TimeInForce::Fok => \"fill_or_kill\",\n                    TimeInForce::Gtd => {\n                        if order.expire_time().is_some() {\n                            log::warn!(\n                                \"Deribit GTD orders expire at 8:00 UTC only - custom expire_time is ignored. \\\n                                For custom expiry times, use managed GTD with emulation_trigger\"\n                            );\n                        }\n                        \"good_til_day\"\n                    }\n                    other => {\n                        anyhow::bail!(\"Unsupported time_in_force {other:?} for Deribit\");\n                    }\n                }\n                .to_string(),\n            )\n        };\n\n        // Deribit's `valid_until` is a REQUEST timeout, not order expiry.\n        // Deribit's `good_til_day` expires at end of trading session (8 UTC).\n        let valid_until = None;\n\n        let trigger = resolve_trigger_type(order.trigger_type());\n\n        Ok(DeribitOrderParams {\n            instrument_name: order.instrument_id().symbol.to_string(),\n            amount: order.quantity().as_decimal(),\n            order_type,\n            label: Some(order.client_order_id().to_string()),\n            price: order.price().map(|p| p.as_decimal()),","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/deribit/src/execution.rs#L259-L295","documentation":"build_order_params maps TimeInForce values to Deribit TIF strings (gtc, ioc, fok, good_til_day, and managed GTD under conditions). Any other TimeInForce hits the catch-all and bails, since Deribit does not accept that TIF value.","triggerScenarios":"Submitting an order whose time_in_force() is not one of GTC/IOC/FOK/GTD(handled specially)/DAY(mapped to good_til_day) — e.g. TimeInForce::AtTheOpen or TimeInForce::GoodTilDate used incorrectly — through the Deribit execution client.","commonSituations":"Orders built with a default TIF unsupported by Deribit; GTD orders with expiry conditions the adapter rejects (see message about managed GTD / emulation_trigger); strategies copied from venues with different TIF sets.","solutions":["Use TimeInForce::Gtc, Ioc, Fok, Gtd (with valid expiry handling), or Day where supported","For GTD, follow the adapter's requirement for managed GTD with a valid expiry/emulation_trigger as indicated by the preceding message text","Validate time_in_force at order construction time before submitting to Deribit"],"exampleFix":"// before\nlet order = factory.limit(..., TimeInForce::AtTheOpen, ...);\n// after\nlet order = factory.limit(..., TimeInForce::Gtc, ...);","handlingStrategy":"type-guard","validationCode":"const SUPPORTED_TIF: &[TimeInForce] = &[\n    TimeInForce::Gtc, TimeInForce::Ioc, TimeInForce::Fok, TimeInForce::Gtd, TimeInForce::Day,\n];\nif !SUPPORTED_TIF.contains(&order.time_in_force()) {\n    return Err(anyhow::anyhow!(\"TIF {:#?} unsupported on Deribit\", order.time_in_force()));\n}","typeGuard":"fn deribit_supported_tif(t: TimeInForce) -> bool {\n    matches!(t, TimeInForce::Gtc | TimeInForce::Ioc | TimeInForce::Fok\n        | TimeInForce::Gtd | TimeInForce::Day)\n}","tryCatchPattern":"match exec_client.submit_order(&order) {\n    Err(e) if e.to_string().contains(\"Unsupported time_in_force\") => rebuild_with_default_tif(&order),\n    other => other,\n}","preventionTips":["Default order TIF to Gtc unless the strategy explicitly needs IOC/FOK/GTD","For GTD, supply the expiry the adapter expects (managed GTD / emulation_trigger)","Validate TIF in the order factory per venue before submission"],"tags":["time-in-force","execution","unsupported","rust","deribit"],"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"}