{"record":{"id":"8fe79c7df5e7ea17","repo":"nautechsystems/nautilus_trader","slug":"unsupported-usd-m-contract-type-for-symbol","errorCode":null,"errorMessage":"Unsupported USD-M contract type '{}' for symbol '{}'","messagePattern":"Unsupported USD-M contract type '(.+?)' for symbol '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/parse.rs","lineNumber":288,"sourceCode":"    maker_fee: Option<Decimal>,\n    taker_fee: Option<Decimal>,\n    ts_event: UnixNanos,\n    ts_init: UnixNanos,\n) -> anyhow::Result<InstrumentAny> {\n    enum ContractKind {\n        CryptoPerpetual,\n        TradFi(AssetClass),\n        Delivery,\n    }\n\n    let contract_kind = match symbol.contract_type.as_str() {\n        CONTRACT_TYPE_PERPETUAL => ContractKind::CryptoPerpetual,\n        CONTRACT_TYPE_TRADIFI_PERPETUAL => ContractKind::TradFi(parse_tradifi_asset_class(symbol)?),\n        CONTRACT_TYPE_CURRENT_MONTH\n        | CONTRACT_TYPE_NEXT_MONTH\n        | CONTRACT_TYPE_CURRENT_QUARTER\n        | CONTRACT_TYPE_NEXT_QUARTER => ContractKind::Delivery,\n        _ => anyhow::bail!(\n            \"Unsupported USD-M contract type '{}' for symbol '{}'\",\n            symbol.contract_type,\n            symbol.symbol,\n        ),\n    };\n\n    if symbol.status != BinanceTradingStatus::Trading {\n        anyhow::bail!(\n            \"Symbol '{}' is not trading (status: {:?})\",\n            symbol.symbol,\n            symbol.status\n        );\n    }\n\n    let quote_currency = get_currency(symbol.quote_asset.as_str());\n    let settlement_currency = get_currency(symbol.margin_asset.as_str());\n\n    let instrument_id = format_instrument_id(&symbol.symbol, BinanceProductType::UsdM);","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/common/parse.rs#L270-L306","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Inspect the symbol's contractType in GET /fapi/v1/exchangeInfo to see the unexpected value","Upgrade the binance adapter to a version supporting the new contract type","Filter out symbols with unsupported contract types before instrument loading","Extend the match in parse_usdm_instrument_with_fees (crates/adapters/binance/src/common/parse.rs) to map the new contract type"],"exampleFix":"// before\nCONTRACT_TYPE_CURRENT_QUARTER | CONTRACT_TYPE_NEXT_QUARTER => ContractKind::Delivery,\n_ => anyhow::bail!(\"Unsupported USD-M contract type ...\"),\n// after\nCONTRACT_TYPE_CURRENT_QUARTER | CONTRACT_TYPE_NEXT_QUARTER => ContractKind::Delivery,\nCONTRACT_TYPE_PERPETUAL_DELIVERING => ContractKind::Delivery, // new exchange type\n_ => anyhow::bail!(\"Unsupported USD-M contract type ...\"),","handlingStrategy":"validation","validationCode":"const SUPPORTED_CONTRACT_TYPES: [&str; 6] = [\"PERPETUAL\", \"TRADIFI_PERPETUAL\", \"CURRENT_MONTH\", \"NEXT_MONTH\", \"CURRENT_QUARTER\", \"NEXT_QUARTER\"];\nfn is_supported_usdm_contract(ct: &str) -> bool { SUPPORTED_CONTRACT_TYPES.contains(&ct) }","typeGuard":"fn is_supported_contract_type(ct: &str) -> bool {\n    matches!(ct, \"PERPETUAL\" | \"TRADIFI_PERPETUAL\" | \"CURRENT_MONTH\" | \"NEXT_MONTH\" | \"CURRENT_QUARTER\" | \"NEXT_QUARTER\")\n}","tryCatchPattern":null,"preventionTips":["Verify contractType values against the live /fapi/v1/exchangeInfo when Binance announces new products","Pre-filter symbols by contract type before parsing instruments","Wrap per-symbol parsing so one unsupported type does not abort the full load"],"tags":["binance","usdm-futures","instrument-parsing","unsupported-value","rust"],"backgroundTag":"unsupported-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}