{"record":{"id":"818b141b0365a4fb","repo":"nautechsystems/nautilus_trader","slug":"unsupported-underlying-type-underlying-type-fo","errorCode":null,"errorMessage":"Unsupported underlying type '{underlying_type}' for TRADIFI_PERPETUAL symbol '{}'","messagePattern":"Unsupported underlying type '(.+?)' for TRADIFI_PERPETUAL symbol '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/parse.rs","lineNumber":126,"sourceCode":"        Err(e) => {\n            log::warn!(\"{e}; using initialization timestamp\");\n            ts_init\n        }\n    }\n}\n\nfn parse_tradifi_asset_class(symbol: &BinanceFuturesUsdSymbol) -> anyhow::Result<AssetClass> {\n    let underlying_type = symbol.underlying_type.as_deref().with_context(|| {\n        format!(\n            \"Missing underlying type for TRADIFI_PERPETUAL symbol '{}'\",\n            symbol.symbol\n        )\n    })?;\n\n    match underlying_type {\n        \"EQUITY\" | \"KR_EQUITY\" | \"HK_EQUITY\" | \"PREMARKET\" => Ok(AssetClass::Equity),\n        \"COMMODITY\" => Ok(AssetClass::Commodity),\n        _ => anyhow::bail!(\n            \"Unsupported underlying type '{underlying_type}' for TRADIFI_PERPETUAL symbol '{}'\",\n            symbol.symbol\n        ),\n    }\n}\n\n/// Returns a currency from the internal map or creates a new crypto currency.\npub fn get_currency(code: &str) -> Currency {\n    Currency::get_or_create_crypto(code)\n}\n\n/// Extracts filter values from Binance symbol filters array.\nfn get_filter<'a>(filters: &'a [Value], filter_type: &str) -> Option<&'a Value> {\n    filters.iter().find(|f| {\n        f.get(\"filterType\")\n            .and_then(|v| v.as_str())\n            .is_some_and(|t| t == filter_type)\n    })","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/common/parse.rs#L108-L144","documentation":"When parsing a Binance USD-M TRADIFI_PERPETUAL instrument, the exchange reports the underlying asset class of the symbol (e.g. EQUITY, COMMODITY). This error is thrown when the underlying type reported by Binance is not one of the asset classes the adapter knows how to map to a Nautilus AssetClass. It indicates a new or unmapped TradFi underlying type from the exchange exchangeInfo payload.","triggerScenarios":"Calling parse_usdm_instrument (directly or via request_instruments / instrument loading) on a TRADIFI_PERPETUAL symbol whose `underlyingType` field is anything other than EQUITY, KR_EQUITY, HK_EQUITY, PREMARKET, or COMMODITY — e.g. Binance adds a new asset class like 'INDEX' or 'FX' to its USD-M futures.","commonSituations":"Binance lists a new TradFi perpetual category before the adapter is updated; a stale/older adapter version against a current exchangeInfo; tests feeding synthetic exchangeInfo payloads with an exotic underlyingType.","solutions":["Check the symbol's underlyingType in the raw exchangeInfo response (GET /fapi/v1/exchangeInfo) to see what value Binance now returns","Upgrade the nautilusTrader binance adapter to a version that maps the new underlying type","If upgrading is not possible, skip/filter the affected TRADIFI_PERPETUAL symbols when loading instruments","Patch parse_tradifi_asset_class in crates/adapters/binance/src/common/parse.rs to map the new underlying type to the appropriate AssetClass"],"exampleFix":"// before (parse.rs)\n\"COMMODITY\" => Ok(AssetClass::Commodity),\n_ => anyhow::bail!(\"Unsupported underlying type ...\"),\n// after\n\"COMMODITY\" => Ok(AssetClass::Commodity),\n\"INDEX\" => Ok(AssetClass::Index), // map the newly listed underlying type\n_ => anyhow::bail!(\"Unsupported underlying type ...\"),","handlingStrategy":"validation","validationCode":"const SUPPORTED_UNDERLYING: [&str; 5] = [\"EQUITY\", \"KR_EQUITY\", \"HK_EQUITY\", \"PREMARKET\", \"COMMODITY\"];\nfn is_supported_tradifi(underlying_type: &str) -> bool {\n    SUPPORTED_UNDERLYING.contains(&underlying_type)\n}\n// check before parsing: assert!(is_supported_tradifi(&symbol.underlying_type));","typeGuard":"fn is_supported_underlying(u: &str) -> bool {\n    matches!(u, \"EQUITY\" | \"KR_EQUITY\" | \"HK_EQUITY\" | \"PREMARKET\" | \"COMMODITY\")\n}","tryCatchPattern":null,"preventionTips":["Keep the binance adapter updated so new exchange underlying types are mapped promptly","Filter TRADIFI_PERPETUAL symbols by supported underlyingType before instrument loading","Log skipped symbols instead of failing the whole instrument load"],"tags":["binance","usdm-futures","instrument-parsing","unsupported-value","rust"],"backgroundTag":"invalid-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"}