{"record":{"id":"c71f07c42fbd3800","repo":"nautechsystems/nautilus_trader","slug":"unsupported-timeinforce-for-polymarket-value","errorCode":null,"errorMessage":"Unsupported `TimeInForce` for Polymarket: {value:?}","messagePattern":"Unsupported `TimeInForce` for Polymarket: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/common/enums.rs","lineNumber":313,"sourceCode":"            PolymarketOrderType::GTC => Self::Gtc,\n            PolymarketOrderType::GTD => Self::Gtd,\n            PolymarketOrderType::FOK => Self::Fok,\n            // Fill-And-Kill is equivalent to Immediate-Or-Cancel\n            PolymarketOrderType::FAK => Self::Ioc,\n        }\n    }\n}\n\nimpl TryFrom<TimeInForce> for PolymarketOrderType {\n    type Error = anyhow::Error;\n\n    fn try_from(value: TimeInForce) -> anyhow::Result<Self> {\n        match value {\n            TimeInForce::Gtc => Ok(Self::GTC),\n            TimeInForce::Gtd => Ok(Self::GTD),\n            TimeInForce::Fok => Ok(Self::FOK),\n            TimeInForce::Ioc => Ok(Self::FAK),\n            _ => anyhow::bail!(\"Unsupported `TimeInForce` for Polymarket: {value:?}\"),\n        }\n    }\n}\n\nimpl PolymarketOrderType {\n    pub(crate) fn from_market_time_in_force(value: TimeInForce) -> anyhow::Result<Self> {\n        match value {\n            TimeInForce::Fok => Ok(Self::FOK),\n            TimeInForce::Ioc => Ok(Self::FAK),\n            _ => anyhow::bail!(\"Unsupported `TimeInForce` for Polymarket market order: {value:?}\"),\n        }\n    }\n}\n\nimpl From<PolymarketOrderStatus> for OrderStatus {\n    fn from(value: PolymarketOrderStatus) -> Self {\n        match value {\n            PolymarketOrderStatus::Invalid => Self::Rejected,","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/common/enums.rs#L295-L331","documentation":"Conversion of a Nautilus TimeInForce into a Polymarket API time-in-force fails because Polymarket only supports GTC, GTD, FOK (and IOC mapped to FAK). Any other TimeInForce variant has no Polymarket equivalent.","triggerScenarios":"Submitting a Polymarket order whose TimeInForce is one of the unsupported variants (e.g. TimeInForce::Day, AtTheOpen, AtTheClose, or any new variant) via TryFrom<TimeInForce> for PolymarketTimeInForce.","commonSituations":"Default order templates using TimeInForce::Day from other venues being reused with the Polymarket adapter.","solutions":["Set the order's time_in_force to Gtc, Gtd, Fok, or Ioc before submitting to Polymarket","If a Day-style order is needed, explicitly convert it to Gtc for Polymarket","Match on the variant in your order-building code and reject unsupported values early"],"exampleFix":"// before\nlet tif = TimeInForce::Day;\nlet poly_tif = PolymarketTimeInForce::try_from(tif)?; // panics/bails\n// after\nlet tif = TimeInForce::Gtc; // or Gtd/Fok/Ioc\nlet poly_tif = PolymarketTimeInForce::try_from(tif)?;","handlingStrategy":"validation","validationCode":"const POLYMARKET_TIFS: &[TimeInForce] = &[TimeInForce::Gtc, TimeInForce::Gtd, TimeInForce::Fok, TimeInForce::Ioc];\nassert!(POLYMARKET_TIFS.contains(&order.time_in_force()), \"unsupported Polymarket TIF\");","typeGuard":"fn is_polymarket_tif(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Gtd | TimeInForce::Fok | TimeInForce::Ioc)\n}","tryCatchPattern":"match PolymarketTimeInForce::try_from(order.time_in_force()) {\n    Ok(t) => submit_with(t),\n    Err(e) => { log::error!(\"{e}\"); /* fall back to Gtc or reject order */ }\n}","preventionTips":["Only submit GTC/GTD/FOK/IOC orders via the Polymarket adapter","Centralize order construction so venue-specific TIFs are enforced","Review adapter docs for supported order parameters"],"tags":["polymarket","time-in-force","enum-conversion"],"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"}