{"record":{"id":"94e4785f8a009d41","repo":"OpenBB-finance/OpenBB","slug":"kind-derivative-type-not-supported-supported-ki","errorCode":null,"errorMessage":"Kind {derivative_type} not supported. Supported kinds are: {', '.join(DERIVATIVE_TYPES)}","messagePattern":"Kind (.+?) not supported\\. Supported kinds are: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py","lineNumber":80,"sourceCode":"    currency : Currencies\n        The currency to get instruments for. Default is \"BTC\".\n    derivative_type : Optional[DerivativeTypes]\n        The type of derivative to get instruments for. Default is None, which gets all types.\n\n    Returns\n    -------\n    list[dict]\n        A list of instrument dictionaries.\n    \"\"\"\n    # pylint: disable=import-outside-toplevel\n    from openbb_core.provider.utils.helpers import amake_request\n\n    if currency != \"all\" and currency.upper() not in CURRENCIES:\n        raise ValueError(\n            f\"Currency {currency} not supported. Supported currencies are: {', '.join(CURRENCIES)}\"\n        )\n    if derivative_type and derivative_type not in DERIVATIVE_TYPES:\n        raise ValueError(\n            f\"Kind {derivative_type} not supported. Supported kinds are: {', '.join(DERIVATIVE_TYPES)}\"\n        )\n\n    url = f\"{BASE_URL}/api/v2/public/get_instruments?currency={currency.upper() if currency != 'all' else 'any'}\"\n\n    if derivative_type is not None:\n        url += f\"&kind={derivative_type}\"\n\n    if expired:\n        url += f\"&expired={str(expired).lower()}\"\n\n    try:\n        response = await amake_request(url)\n        return response.get(\"result\", [])  # type: ignore\n    except Exception as e:  # pylint: disable=broad-except\n        raise OpenBBError(\n            f\"Failed to get instruments -> {e.__class__.__name__}: {e}\"\n        ) from e","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py#L62-L98","documentation":"ValueError from get_instruments when derivative_type is truthy and not in DERIVATIVE_TYPES = [future, option, spot, future_combo, option_combo]. The value is interpolated into the &kind= query parameter verbatim, so this guard prevents malformed Deribit URLs.","triggerScenarios":"Passing 'futures' (plural), 'options', 'perp', 'PERPETUAL', or None-vs-string mistakes. Note: None is allowed (omits kind), but any other unlisted string fails; matching is case-sensitive.","commonSituations":"Pluralized or uppercased kind strings copied from docs/conversations, or reusing DerivativeTypes values from other providers.","solutions":["Use exactly one of: future, option, spot, future_combo, option_combo (lowercase, singular).","Pass None (or omit) to get all types.","For perpetuals, use kind='future' — Deribit treats perpetuals as futures."],"exampleFix":"# before\ndata = await get_instruments(\"BTC\", \"futures\")\n\n# after\ndata = await get_instruments(\"BTC\", \"future\")","handlingStrategy":"type-guard","validationCode":"DERIVATIVE_TYPES = {\"future\", \"option\", \"spot\", \"future_combo\", \"option_combo\"}\nif derivative_type is not None:\n    assert derivative_type in DERIVATIVE_TYPES, f\"kind must be one of {sorted(DERIVATIVE_TYPES)}\"","typeGuard":"from typing import Literal, TypeGuard\nDerivativeType = Literal[\"future\", \"option\", \"spot\", \"future_combo\", \"option_combo\"]\n\ndef is_derivative_type(s: str) -> TypeGuard[DerivativeType]:\n    return s in {\"future\", \"option\", \"spot\", \"future_combo\", \"option_combo\"}","tryCatchPattern":null,"preventionTips":["Always singular, lowercase: 'future' not 'futures' or 'FUTURE'.","Pass None for all types instead of inventing an 'all' kind."],"tags":["deribit","validation","derivative-type","instruments"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}