OpenBB-finance/OpenBB · error · ValueError

Invalid Deribit symbol, {symbol}. Supported symbols are: {',

Error message

Invalid Deribit symbol, {symbol}. Supported symbols are: {', '.join(DERIBIT_FUTURES_CURVE_SYMBOLS)}

What it means

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.

Source

Thrown at openbb_platform/providers/deribit/openbb_deribit/models/futures_curve.py:57

    }

    symbol: FuturesCurveSymbols = Field(
        default="BTC",
        description=QUERY_DESCRIPTIONS.get("symbol", "")
        + " Default is 'btc' Supported symbols are: ['btc', 'eth', 'paxg']",
    )
    hours_ago: int | list[int] | str | None = Field(
        default=None,
        description="Compare the current curve with the specified number of hours ago. Default is None.",
    )

    @field_validator("symbol", mode="before", check_fields=False)
    @classmethod
    def validate_symbol(cls, v):
        """Validate the symbol."""
        symbol = v.upper()
        if symbol not in DERIBIT_FUTURES_CURVE_SYMBOLS:
            raise ValueError(
                f"Invalid Deribit symbol, {symbol}. Supported symbols are: {', '.join(DERIBIT_FUTURES_CURVE_SYMBOLS)}"
            )
        return symbol

    @field_validator("hours_ago", mode="before", check_fields=False)
    @classmethod
    def _validate_hours_ago(cls, v):
        """Validate hours ago."""
        if isinstance(v, str):
            return v
        if isinstance(v, int):
            return v
        if isinstance(v, list):
            return ",".join([str(i) for i in v])
        return None

    @model_validator(mode="before")
    @classmethod

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Use one of BTC, ETH, or PAXG
  2. Check DERIBIT_FUTURES_CURVE_SYMBOLS (openbb_deribit.utils.helpers) or the symbol field's choices metadata before calling
  3. For other underlyings, use a general Deribit ticker/instruments endpoint rather than the curve model

Example fix

# before
curve = obb.derivatives.futures.curve(symbol='SOL', provider='deribit')

# after
curve = obb.derivatives.futures.curve(symbol='BTC', provider='deribit')
Defensive patterns

Strategy: validation

Validate before calling

from openbb_deribit.utils.helpers import DERIBIT_FUTURES_CURVE_SYMBOLS

def assert_curve_symbol(symbol: str) -> str:
    s = symbol.strip().upper()
    if s not in DERIBIT_FUTURES_CURVE_SYMBOLS:
        raise ValueError(f'{s!r} unsupported; curve supports {DERIBIT_FUTURES_CURVE_SYMBOLS}')
    return s

Type guard

from openbb_deribit.utils.helpers import DERIBIT_FUTURES_CURVE_SYMBOLS

def is_curve_symbol(symbol: str) -> bool:
    return symbol.strip().upper() in DERIBIT_FUTURES_CURVE_SYMBOLS

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/d55ad1217f24ec29. Report an issue: GitHub.