OpenBB-finance/OpenBB · error · ValueError

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

Error message

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

What it means

Raised by the field_validator on DeribitFuturesHistoricalQueryParams.symbol when a requested symbol is not in the combined set of live Deribit perpetual and futures instrument names. Note the validator itself performs two run_async network fetches (get_futures_symbols, get_perpetual_symbols), so the valid set is the exchange's current listing, not a static list. Perpetual aliases (e.g. 'BTC') are mapped to full instrument names after validation.

Source

Thrown at openbb_platform/providers/deribit/openbb_deribit/models/futures_historical.py:61

        # pylint: disable=import-outside-toplevel
        from openbb_core.provider.utils.helpers import run_async
        from openbb_deribit.utils.helpers import (
            get_futures_symbols,
            get_perpetual_symbols,
        )

        if not v:
            raise ValueError("Symbol is required.")

        futures_symbols = run_async(get_futures_symbols)
        perpetual_symbols = run_async(get_perpetual_symbols)
        all_symbols = list(perpetual_symbols) + futures_symbols
        symbols = v.upper().split(",")
        new_symbols: list = []

        for symbol in symbols:
            if symbol not in all_symbols:
                raise ValueError(
                    f"Invalid Deribit symbol: {symbol}. Supported symbols are: {', '.join(all_symbols)}"
                )
            if symbol in perpetual_symbols:
                new_symbols.append(perpetual_symbols[symbol])
            else:
                new_symbols.append(symbol)

        return ",".join(new_symbols)

    @model_validator(mode="before")
    @classmethod
    def _validate_model(cls, values):
        """Validate the model."""
        interval = values.get("interval")
        now = datetime.today()

        if not values.get("start_date"):
            if interval == "1m":

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Use a currently listed Deribit instrument name (e.g. 'BTC-PERPETUAL', 'ETH-PERPETUAL', or an active dated future like 'BTC-27JUN26') or a perpetual short symbol such as 'BTC'.
  2. List valid symbols first via the Deribit instruments endpoint (openbb_deribit.utils.helpers.get_instruments('all','future')) and pick from that result.
  3. Remove expired contracts from your symbol list; Deribit delists them and they disappear from the valid set.
  4. If every symbol fails, check network access to deribit.com — the validator fetches the symbol list synchronously at validation time.

Example fix

# before
obb.derivatives.futures.historical(symbol="BTCUSDT", provider="deribit")

# after
obb.derivatives.futures.historical(symbol="BTC-PERPETUAL", provider="deribit")
Defensive patterns

Strategy: validation

Validate before calling

from openbb_deribit.utils.helpers import get_instruments
import asyncio

valid = {d["instrument_name"] for d in asyncio.run(get_instruments("all", "future"))}
requested = [s.strip().upper() for s in "BTC-PERPETUAL,BTCUSDT".split(",")]
bad = [s for s in requested if s not in valid]
assert not bad, f"Unknown symbols: {bad}; pick from the exchange's live list"

Type guard

def is_valid_deribit_future(symbol: str, valid: set[str]) -> bool:
    """True if symbol is a currently listed Deribit futures instrument name."""
    return isinstance(symbol, str) and symbol.strip().upper() in valid

Try / catch

from pydantic import ValidationError
try:
    obb.derivatives.futures.historical(symbol=sym, provider="deribit")
except ValidationError as e:
    if "Invalid Deribit symbol" in str(e):
        log_bad_symbol(sym)  # refresh instrument list, correct symbol
    raise

Prevention

When it happens

Trigger: Calling futures historical with a symbol like 'DOGE_PERPETUAL' (not listed), a typo'd or expired future contract name, or a lowercase name is fine (it is .upper()ed) but an unknown one fails. Because the valid list comes from live API calls, running the validator offline makes the symbol fetch itself fail rather than validate.

Common situations: Users copying symbols from other venues (Binance 'BTCUSDT' style), using delisted/expired contracts, or running in an environment where Deribit is unreachable so the dynamic list cannot be fetched.

Related errors


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