nautechsystems/nautilus_trader · error

Unsupported time in force: {e}

Error message

Unsupported time in force: {e}

What it means

Raised in `prepare_limit_order_submission` when converting the request's `TimeInForce` to a `PolymarketOrderType` via TryFrom fails. Polymarket limit orders support GTC, GTD, FOK and FAK only; the bail message is 'Unsupported `TimeInForce` for Polymarket: {value:?}'. The limit order is not built or signed.

Source

Thrown at crates/adapters/polymarket/src/execution/submitter.rs:441

    }

    /// Prepares multiple limit order submissions in parallel.
    pub(crate) async fn prepare_limit_order_submissions(
        &self,
        requests: &[LimitOrderSubmitRequest],
    ) -> Vec<anyhow::Result<SignedLimitOrderSubmission>> {
        let futures = requests
            .iter()
            .map(|request| self.prepare_limit_order_submission(request));
        futures_util::future::join_all(futures).await
    }

    pub(crate) async fn prepare_limit_order_submission(
        &self,
        request: &LimitOrderSubmitRequest,
    ) -> anyhow::Result<SignedLimitOrderSubmission> {
        let order_type = PolymarketOrderType::try_from(request.time_in_force)
            .map_err(|e| anyhow::anyhow!("Unsupported time in force: {e}"))?;
        let side = PolymarketOrderSide::from(request.side);
        let expiration = limit_order_expiration(request.expire_time);

        let order = if request.quote_quantity {
            anyhow::ensure!(
                side == PolymarketOrderSide::Buy,
                "Limit SELL orders require quote_quantity=false (amount in shares)"
            );
            self.order_builder.build_limit_order_from_collateral(
                &request.token_id,
                request.price.as_decimal(),
                request.quantity.as_decimal(),
                &expiration,
                request.neg_risk,
                request.tick_decimals,
            )
        } else {
            self.order_builder.build_limit_order(

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Use TimeInForce::Gtc (resting), Gtd (with expire_time), Fok, or Ioc for Polymarket limit orders
  2. Map unsupported TIF variants at the strategy layer to the nearest supported one
  3. Check the adapter's enums.rs for the currently supported set

Example fix

// before
let req = LimitOrderSubmitRequest { time_in_force: TimeInForce::Day, .. };
// after
let req = LimitOrderSubmitRequest { time_in_force: TimeInForce::Gtc, .. };
Defensive patterns

Strategy: validation

Validate before calling

match tif {
    TimeInForce::Gtc | TimeInForce::Gtd | TimeInForce::Fok | TimeInForce::Ioc => {}
    other => return Err(anyhow!("unsupported Polymarket limit TIF: {other:?}")),
}

Try / catch

if let Err(e) = prepare_limit_order_submission(&req).await {
    if e.to_string().contains("Unsupported `TimeInForce`") {
        // translate TIF (e.g. Day -> Gtc) and rebuild the request
    }
}

Prevention

When it happens

Trigger: Submitting a limit order with a TimeInForce variant outside {Gtc, Gtd, Fok, Ioc}, e.g. TimeInForce::Day or venue-specific variants not mapped for Polymarket.

Common situations: Strategies ported from equity/futures adapters that default to DAY orders; configs using a TimeInForce enum variant added in a newer core version but not yet mapped in the Polymarket adapter.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/4eff4192ee4fa0d7. Report an issue: GitHub.