nautechsystems/nautilus_trader · error

Unsupported TIF {time_in_force} for LIMIT on Coinbase

Error message

Unsupported TIF {time_in_force} for LIMIT on Coinbase

What it means

The Coinbase adapter builds a LIMIT order request by matching the order's TimeInForce to a specific Coinbase product type (GTC, GTD, IOC, FOK). If the TIF is anything not explicitly handled, the adapter aborts with this anyhow error because Coinbase's REST API requires a distinct order configuration per TIF and no fallback exists.

Source

Thrown at crates/adapters/coinbase/src/http/client.rs:1679

                TimeInForce::Gtd => {
                    let expire = expire_time
                        .ok_or_else(|| anyhow::anyhow!("GTD LIMIT requires expire_time"))?;
                    Ok(OrderConfiguration::LimitGtd(LimitGtd {
                        limit_limit_gtd: LimitGtdParams {
                            base_size: qty,
                            limit_price,
                            end_time: format_rfc3339_from_nanos(expire)?,
                            post_only,
                        },
                    }))
                }
                TimeInForce::Fok => Ok(OrderConfiguration::LimitFok(LimitFok {
                    limit_limit_fok: LimitFokParams {
                        base_size: qty,
                        limit_price,
                    },
                })),
                _ => anyhow::bail!("Unsupported TIF {time_in_force} for LIMIT on Coinbase"),
            }
        }
        OrderType::StopLimit => {
            let limit_price =
                price.ok_or_else(|| anyhow::anyhow!("STOP_LIMIT order requires a price"))?;
            let stop_price = trigger
                .ok_or_else(|| anyhow::anyhow!("STOP_LIMIT order requires trigger_price"))?;
            let direction = match side {
                OrderSide::Buy => CoinbaseStopDirection::StopUp,
                OrderSide::Sell => CoinbaseStopDirection::StopDown,
            };

            match time_in_force {
                TimeInForce::Gtc => Ok(OrderConfiguration::StopLimitGtc(StopLimitGtc {
                    stop_limit_stop_limit_gtc: StopLimitGtcParams {
                        base_size: qty,
                        limit_price,
                        stop_price,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set the order's time_in_force to Gtc, Gtd, Ioc, or Fok before submitting LIMIT orders to Coinbase
  2. Add the missing TIF to the match arm in build order configuration if Coinbase now supports it (check API docs)
  3. Use an order factory preset that only produces Coinbase-supported TIF values

Example fix

// before
let order = self.factory.limit(..., TimeInForce::Day, ...);
// after
let order = self.factory.limit(..., TimeInForce::Gtc, ...); // or Ioc/Fok/Gtd
Defensive patterns

Strategy: validation

Validate before calling

fn coinbase_limit_tif(tif: TimeInForce) -> Result<(), String> {
    match tif {
        TimeInForce::Gtc | TimeInForce::Gtd | TimeInForce::Ioc | TimeInForce::Fok => Ok(()),
        other => Err(format!("Coinbase LIMIT does not support TIF {other}")),
    }
}

Prevention

When it happens

Trigger: Submitting a LIMIT order to Coinbase whose TimeInForce is not one of Gtc, Gtd, Ioc, Fok — e.g. a TIF value like MarketOnOpen/Day/AtTheOpen/Unknown that reached the order factory or client.

Common situations: Configuring strategies with a Nautilus TimeInForce that has no Coinbase equivalent (e.g. DAY or OPG mapped straight through); copying order templates from other venues (Binance/FX) that use DAY TIF; leaving TIF unset so it deserializes to an unsupported variant.

Related errors


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