nautechsystems/nautilus_trader · error · anyhow::Error

Binance Futures does not support native GTD

Error message

Binance {product_type:?} Futures does not support native GTD

What it means

Native Binance GTD (goodTillDate) is only supported on USD-Margined futures. determine_futures_order_lifetime rejects GTD for other Binance product types (e.g. CoinM Spot-style setups) since the venue endpoint does not honor the parameter there; the adapter fails fast rather than silently degrading the expiry.

Solutions

  1. Move the GTD order to a USD-M (UsdM) instrument/config.
  2. Set use_gtd=false so GTD orders are submitted as GTC (with local expiry management via manage_gtd_expiry).
  3. Use TimeInForce Gtc/Ioc/Fok directly for CoinM orders.
  4. If CoinM GTD is essential, implement client-side expiry by scheduling a cancel at expire_time.

Example fix

// before
BinanceFuturesExecClientConfig { product_type: CoinM, .. } // + strategy emits GTD
// after
BinanceFuturesExecClientConfig { product_type: UsdM, .. } // or use_gtd=false
Defensive patterns

Strategy: validation

Validate before calling

if tif == TimeInForce::Gtd && use_gtd && product_type != BinanceProductType::UsdM {
    // fall back to Gtc or local expiry management
}

Prevention

When it happens

Trigger: Order with TimeInForce=Gtd, use_gtd=true, on an exec client configured with product_type != UsdM (e.g. CoinM futures), submitted via validate_order or build_futures_order_list_batch.

Common situations: Reusing a strategy tuned for USDT-margined futures on COIN-margined instruments; config templates that set use_gtd=true but product_type CoinM.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at crates/adapters/binance/src/futures/execution.rs:1503

        log::warn!(
            "Binance Futures GTD submitted as GTC because use_gtd=false. Enable manage_gtd_expiry on the submitting strategy"
        );
        return Ok(FuturesOrderLifetime {
            time_in_force: TimeInForce::Gtc,
            good_till_date: None,
        });
    }

    anyhow::ensure!(
        matches!(
            order_type,
            OrderType::Limit | OrderType::StopLimit | OrderType::LimitIfTouched
        ),
        "Binance Futures does not support GTD for order type {order_type:?}"
    );
    anyhow::ensure!(!post_only, "Binance Futures GTD cannot be post-only");

    anyhow::ensure!(
        product_type == BinanceProductType::UsdM,
        "Binance {product_type:?} Futures does not support native GTD"
    );

    let expire_time = expire_time.context("Binance Futures GTD requires an expire_time")?;
    let expire_ns = expire_time.as_u64();
    anyhow::ensure!(
        expire_ns.is_multiple_of(NANOSECONDS_IN_SECOND),
        "Binance Futures goodTillDate requires whole-second precision"
    );

    let minimum_ns = ts_now
        .as_u64()
        .checked_add(BINANCE_GTD_MIN_LEAD_SECS * NANOSECONDS_IN_SECOND)
        .context("Binance Futures GTD minimum timestamp overflow")?;
    anyhow::ensure!(
        expire_ns > minimum_ns,
        "Binance Futures goodTillDate must be strictly greater than current time plus {BINANCE_GTD_MIN_LEAD_SECS} seconds"

View on GitHub (pinned to 18893faf8b)