{"record":{"id":"d55ad1217f24ec29","repo":"OpenBB-finance/OpenBB","slug":"invalid-deribit-symbol-symbol-supported-symbol","errorCode":null,"errorMessage":"Invalid Deribit symbol, {symbol}. Supported symbols are: {', '.join(DERIBIT_FUTURES_CURVE_SYMBOLS)}","messagePattern":"Invalid Deribit symbol, (.+?)\\. Supported symbols are: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/deribit/openbb_deribit/models/futures_curve.py","lineNumber":57,"sourceCode":"    }\n\n    symbol: FuturesCurveSymbols = Field(\n        default=\"BTC\",\n        description=QUERY_DESCRIPTIONS.get(\"symbol\", \"\")\n        + \" Default is 'btc' Supported symbols are: ['btc', 'eth', 'paxg']\",\n    )\n    hours_ago: int | list[int] | str | None = Field(\n        default=None,\n        description=\"Compare the current curve with the specified number of hours ago. Default is None.\",\n    )\n\n    @field_validator(\"symbol\", mode=\"before\", check_fields=False)\n    @classmethod\n    def validate_symbol(cls, v):\n        \"\"\"Validate the symbol.\"\"\"\n        symbol = v.upper()\n        if symbol not in DERIBIT_FUTURES_CURVE_SYMBOLS:\n            raise ValueError(\n                f\"Invalid Deribit symbol, {symbol}. Supported symbols are: {', '.join(DERIBIT_FUTURES_CURVE_SYMBOLS)}\"\n            )\n        return symbol\n\n    @field_validator(\"hours_ago\", mode=\"before\", check_fields=False)\n    @classmethod\n    def _validate_hours_ago(cls, v):\n        \"\"\"Validate hours ago.\"\"\"\n        if isinstance(v, str):\n            return v\n        if isinstance(v, int):\n            return v\n        if isinstance(v, list):\n            return \",\".join([str(i) for i in v])\n        return None\n\n    @model_validator(mode=\"before\")\n    @classmethod","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/deribit/openbb_deribit/models/futures_curve.py#L39-L75","documentation":"DeribitFuturesCurveQueryParams validates the symbol field (uppercased) against DERIBIT_FUTURES_CURVE_SYMBOLS = ['BTC','ETH','PAXG'], since the curve is built by querying all listed futures for one underlying. Pydantic runs this in a field_validator before the fetcher, so bad symbols fail at parameter validation time with ValueError, before any network call.","triggerScenarios":"obb.derivatives.futures.curve(symbol='SOL', provider='deribit') — Deribit does have SOL futures but this model only supports BTC/ETH/PAXG; lowercase 'btc' is fine (uppercased first) but 'BTC-PERPETUAL' (an instrument name, not an underlying) fails.","commonSituations":"Assuming all Deribit-listed underlyings are supported; passing instrument names instead of the underlying asset; symbols from other providers' curve endpoints (e.g. commodities) reused here.","solutions":["Use one of BTC, ETH, or PAXG","Check DERIBIT_FUTURES_CURVE_SYMBOLS (openbb_deribit.utils.helpers) or the symbol field's choices metadata before calling","For other underlyings, use a general Deribit ticker/instruments endpoint rather than the curve model"],"exampleFix":"# before\ncurve = obb.derivatives.futures.curve(symbol='SOL', provider='deribit')\n\n# after\ncurve = obb.derivatives.futures.curve(symbol='BTC', provider='deribit')","handlingStrategy":"validation","validationCode":"from openbb_deribit.utils.helpers import DERIBIT_FUTURES_CURVE_SYMBOLS\n\ndef assert_curve_symbol(symbol: str) -> str:\n    s = symbol.strip().upper()\n    if s not in DERIBIT_FUTURES_CURVE_SYMBOLS:\n        raise ValueError(f'{s!r} unsupported; curve supports {DERIBIT_FUTURES_CURVE_SYMBOLS}')\n    return s","typeGuard":"from openbb_deribit.utils.helpers import DERIBIT_FUTURES_CURVE_SYMBOLS\n\ndef is_curve_symbol(symbol: str) -> bool:\n    return symbol.strip().upper() in DERIBIT_FUTURES_CURVE_SYMBOLS","tryCatchPattern":null,"preventionTips":["Only underlyings (BTC/ETH/PAXG), not instrument names, are valid","Deribit lists more futures than this model supports — check the constant first","Expose the symbol field's 'choices' metadata in your UI as a dropdown"],"tags":["deribit","validation","symbol","pydantic"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}