nautechsystems/nautilus_trader · error

Unsupported USD-M contract type

Error message

Unsupported USD-M contract type '{}' for symbol '{}'

What it means

The USD-M futures adapter only supports perpetual, delivery (current/next month, current/next quarter), and known TRADIFI_PERPETUAL contract types. This error is thrown when a symbol's `contractType` field from exchangeInfo does not match any of those known values, so no ContractKind can be determined for the instrument.

Solutions

  1. Inspect the symbol's contractType in GET /fapi/v1/exchangeInfo to see the unexpected value
  2. Upgrade the binance adapter to a version supporting the new contract type
  3. Filter out symbols with unsupported contract types before instrument loading
  4. Extend the match in parse_usdm_instrument_with_fees (crates/adapters/binance/src/common/parse.rs) to map the new contract type

Example fix

// before
CONTRACT_TYPE_CURRENT_QUARTER | CONTRACT_TYPE_NEXT_QUARTER => ContractKind::Delivery,
_ => anyhow::bail!("Unsupported USD-M contract type ..."),
// after
CONTRACT_TYPE_CURRENT_QUARTER | CONTRACT_TYPE_NEXT_QUARTER => ContractKind::Delivery,
CONTRACT_TYPE_PERPETUAL_DELIVERING => ContractKind::Delivery, // new exchange type
_ => anyhow::bail!("Unsupported USD-M contract type ..."),
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_CONTRACT_TYPES: [&str; 6] = ["PERPETUAL", "TRADIFI_PERPETUAL", "CURRENT_MONTH", "NEXT_MONTH", "CURRENT_QUARTER", "NEXT_QUARTER"];
fn is_supported_usdm_contract(ct: &str) -> bool { SUPPORTED_CONTRACT_TYPES.contains(&ct) }

Type guard

fn is_supported_contract_type(ct: &str) -> bool {
    matches!(ct, "PERPETUAL" | "TRADIFI_PERPETUAL" | "CURRENT_MONTH" | "NEXT_MONTH" | "CURRENT_QUARTER" | "NEXT_QUARTER")
}

Prevention

When it happens

Trigger: Loading USD-M instruments via parse_usdm_instrument / request_instruments_with_config when the exchangeInfo payload contains a symbol whose contract_type is not PERPETUAL, TRADIFI_PERPETUAL, CURRENT_MONTH, NEXT_MONTH, CURRENT_QUARTER, or NEXT_QUARTER (e.g. a new Binance contract type, or a malformed/synthetic payload).

Common situations: Binance introduces a new contract type (historically e.g. 'PERPETUAL DELIVERING'); running an outdated adapter against the live exchangeInfo; hand-built test fixtures with a typo'd contractType string.

Related errors


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

Appendix: source

Thrown at crates/adapters/binance/src/common/parse.rs:288

    maker_fee: Option<Decimal>,
    taker_fee: Option<Decimal>,
    ts_event: UnixNanos,
    ts_init: UnixNanos,
) -> anyhow::Result<InstrumentAny> {
    enum ContractKind {
        CryptoPerpetual,
        TradFi(AssetClass),
        Delivery,
    }

    let contract_kind = match symbol.contract_type.as_str() {
        CONTRACT_TYPE_PERPETUAL => ContractKind::CryptoPerpetual,
        CONTRACT_TYPE_TRADIFI_PERPETUAL => ContractKind::TradFi(parse_tradifi_asset_class(symbol)?),
        CONTRACT_TYPE_CURRENT_MONTH
        | CONTRACT_TYPE_NEXT_MONTH
        | CONTRACT_TYPE_CURRENT_QUARTER
        | CONTRACT_TYPE_NEXT_QUARTER => ContractKind::Delivery,
        _ => anyhow::bail!(
            "Unsupported USD-M contract type '{}' for symbol '{}'",
            symbol.contract_type,
            symbol.symbol,
        ),
    };

    if symbol.status != BinanceTradingStatus::Trading {
        anyhow::bail!(
            "Symbol '{}' is not trading (status: {:?})",
            symbol.symbol,
            symbol.status
        );
    }

    let quote_currency = get_currency(symbol.quote_asset.as_str());
    let settlement_currency = get_currency(symbol.margin_asset.as_str());

    let instrument_id = format_instrument_id(&symbol.symbol, BinanceProductType::UsdM);

View on GitHub (pinned to 18893faf8b)