nautechsystems/nautilus_trader · error

Unsupported TIF {time_in_force} for MARKET on Coinbase (use

Error message

Unsupported TIF {time_in_force} for MARKET on Coinbase (use IOC or FOK)

What it means

When converting a MARKET order to Coinbase's Advanced Trade API payload, only IOC and FOK time-in-force values are supported (mapped to MarketIoc/MarketFok configurations). Any other TIF on a MARKET order is rejected by the payload builder.

Source

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

                }
            } else {
                MarketParams {
                    quote_size: None,
                    base_size: Some(qty),
                }
            };

            match time_in_force {
                TimeInForce::Ioc | TimeInForce::Gtc => {
                    Ok(OrderConfiguration::MarketIoc(MarketIoc {
                        market_market_ioc: params,
                    }))
                }
                TimeInForce::Fok => Ok(OrderConfiguration::MarketFok(MarketFok {
                    market_market_fok: params,
                })),
                _ => {
                    anyhow::bail!(
                        "Unsupported TIF {time_in_force} for MARKET on Coinbase (use IOC or FOK)"
                    )
                }
            }
        }
        OrderType::Limit => {
            let limit_price =
                price.ok_or_else(|| anyhow::anyhow!("LIMIT order requires a price"))?;

            match time_in_force {
                TimeInForce::Gtc => Ok(OrderConfiguration::LimitGtc(LimitGtc {
                    limit_limit_gtc: LimitGtcParams {
                        base_size: qty,
                        limit_price,
                        post_only,
                    },
                })),
                TimeInForce::Gtd => {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set time_in_force to TimeInForce::Ioc (or Fok) on MARKET orders sent to Coinbase
  2. Leave TIF unset so the adapter can map the market order appropriately if supported
  3. Adjust strategy/order-factory defaults so only limit orders carry GTC/DAY
  4. Validate the (order_type, time_in_force) combination in pre-submit checks

Example fix

// before
let order = order_factory.market(..., TimeInForce::Gtc, ...);

// after
let order = order_factory.market(..., TimeInForce::Ioc, ...);
Defensive patterns

Strategy: validation

Validate before calling

if order.order_type == OrderType::Market
    && !matches!(order.time_in_force, TimeInForce::Ioc | TimeInForce::Fok | TimeInForce::Gtc)
{
    return Err(anyhow!("Coinbase MARKET orders need IOC or FOK"));
}

Prevention

When it happens

Trigger: Submitting a MARKET order whose TimeInForce is GTC, GTD, DAY, etc.; typically from a config that sets a default TIF globally without considering order type.

Common situations: Strategy defaults TIF=GTC for all orders; a routing layer that stamps DAY on market orders; porting orders built for venues that accept GTC market orders.

Related errors


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