OpenBB-finance/OpenBB · error · ValueError
Symbol is required.
Error message
Symbol is required.
What it means
The DeribitFuturesHistoricalQueryParams symbol validator first rejects an empty value, then synchronously fetches the complete live symbol universe from Deribit (futures + perpetuals via run_async) and rejects any symbol not in it. This makes validation network-dependent: it fails both on empty input and on any instrument not currently listed, and it can be slow. The ValueError comes from pydantic field validation.
Source
Thrown at openbb_platform/providers/deribit/openbb_deribit/models/futures_historical.py:51
}
interval: DeribitIntervals = Field(
default="1d", description=QUERY_DESCRIPTIONS.get("interval", "")
)
@field_validator("symbol", mode="before", check_fields=False)
@classmethod
def _validate_symbol(cls, v):
"""Validate the symbol."""
# 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)View on GitHub (pinned to 3e071fcc2c)
Solutions
- Pass a non-empty, currently listed Deribit instrument name, e.g. 'BTC-PERPETUAL' or 'ETH-27JUN25'
- Refresh the valid universe programmatically first: from openbb_deribit.utils.helpers import get_futures_symbols; valid = await get_futures_symbols()
- For backfills on expired contracts, note the validator only knows live listings — pin a package version or use Deribit's API directly for delisted instruments
Example fix
# before
hist = obb.derivatives.futures.historical(symbol='BTC-27SEP24', provider='deribit') # expired
# after
from openbb_deribit.utils.helpers import get_futures_symbols
valid = await get_futures_symbols()
sym = next(s for s in valid if s.startswith('BTC-2')) # pick a live dated future
hist = obb.derivatives.futures.historical(symbol=sym, provider='deribit') Defensive patterns
Strategy: validation
Validate before calling
from openbb_deribit.utils.helpers import get_futures_symbols, get_perpetual_symbols
async def assert_live_symbol(symbol: str) -> str:
s = symbol.strip().upper()
universe = set(await get_perpetual_symbols()) | set(await get_futures_symbols())
if s not in universe:
raise ValueError(f'{s!r} not currently listed on Deribit')
return s Type guard
async def is_live_deribit_symbol(symbol: str) -> bool:
s = symbol.strip().upper()
universe = set(await get_perpetual_symbols()) | set(await get_futures_symbols())
return s in universe Try / catch
try:
hist = obb.derivatives.futures.historical(symbol=sym, provider='deribit')
except ValueError as e:
if 'Symbol is required' in str(e):
raise # caller bug: empty symbol
if 'Invalid Deribit symbol' in str(e):
sym = 'BTC-PERPETUAL' # fall back to a always-listed instrument
hist = obb.derivatives.futures.historical(symbol=sym, provider='deribit')
else:
raise Prevention
- Never pass empty symbol strings — guard at the call site
- Refresh the symbol universe each run; validators only know live listings, so expired contracts fail
- Note this validation makes a network call per instantiation — cache the symbol set for batch jobs
When it happens
Trigger: symbol='' (empty) — the direct trigger for 'Symbol is required.'; expired futures like 'BTC-27SEP24' no longer listed; typo'd instrument names; lowercase input is fine (uppercased) but hyphen/spacing variants must exactly match Deribit naming (e.g. 'BTC-PERPETUAL', 'ETH-27JUN25').
Common situations: Passing expired contract symbols after rollover; hardcoded instrument names in production code aging out; symbol lists built from other exchanges; calls during Deribit API downtime where the symbol fetch itself errors.
Related errors
- Invalid Deribit symbol, {symbol}. Supported symbols are: {',
- OBBject Extension Error -> An OBBject extension that modif
- Unsupported data format.
- ValueError: {ve}. Ensure the data format matches the expecte
- TypeError: {te}. Check the data types in your results.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/cb4c22ca5b044795.
Report an issue: GitHub.