OpenBB-finance/OpenBB · error · ValueError

Symbol {symbol} not found

Error message

Symbol {symbol} not found

What it means

ValueError raised in get_ohlc_data when the requested instrument_name is absent from the all-instruments map, i.e. the ticker's creation_timestamp lookup returned the default 0. It means Deribit does not currently know this instrument (never existed, delisted+not returned, or typo) — distinct from 'instrument exists but no candles in range'.

Source

Thrown at openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py:252

) -> list[dict]:
    """Get OHLC data for a given symbol. Enter dates in the format 'YYYY-MM-DD'."""
    # pylint: disable=import-outside-toplevel
    import asyncio  # noqa
    from openbb_core.provider.utils.errors import EmptyDataError
    from openbb_core.provider.utils.helpers import amake_request
    from pandas import DataFrame, date_range, to_datetime

    new_interval = INTERVAL_MAP.get(interval, interval)

    all_instruments = await get_instruments("all", None)
    all_symbols = {
        d.get("instrument_name"): d.get("creation_timestamp") for d in all_instruments
    }
    creation_date = all_symbols.get(symbol, 0)
    use_start = to_datetime(start_date).timestamp() * 1000 > creation_date

    if creation_date == 0:
        raise ValueError(f"Symbol {symbol} not found")

    def generate_urls(symbol, start_date, end_date, interval, window_size=5000):
        """Generate urls for historical data breaking it down into requests of length window_size."""
        interval_period = f"{interval}min" if interval.lower() != "1d" else "1d"
        interval = "1D" if interval.lower() == "1d" else interval
        dates = date_range(
            start=start_date if use_start else creation_date,
            end=end_date,
            freq=interval_period,
        )
        windows = [
            (dates[i], dates[min(i + window_size, len(dates) - 1)])
            for i in range(0, len(dates), window_size)
        ]
        urls: list = []
        for start, end in windows:
            start_timestamp = int(start.timestamp() * 1000)
            end_timestamp = int(end.timestamp() * 1000)

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Use an active instrument name; verify via get_instruments('all', None) — the same map this function checks.
  2. For expired contracts, the current implementation cannot fetch them (get_instruments is called without expired=True); use Deribit's API directly with expired=true or pick the live contract.
  3. Check formatting: dated futures look like BTC-27JUN26, options like BTC-27JUN26-25000-C.
  4. Handle the ValueError to skip unknown symbols in batch jobs.

Example fix

# before
 candles = await get_ohlc_data("BTC-28JUN25", ...)  # already expired

# after
candles = await get_ohlc_data("BTC-PERPETUAL", ...)  # active instrument
Defensive patterns

Strategy: validation

Validate before calling

from openbb_deribit.utils.helpers import get_instruments
live = {d["instrument_name"] for d in asyncio.run(get_instruments("all", None))}
if symbol not in live:
    raise ValueError(f"{symbol} is not a currently listed instrument; pick from {len(live)} live names")

Type guard

def is_known_instrument(symbol: str, live: set[str]) -> bool:
    """True only for instruments Deribit currently returns (active, not expired)."""
    return isinstance(symbol, str) and symbol in live

Try / catch

try:
    candles = await get_ohlc_data(symbol, interval, start, end)
except ValueError as e:
    if "not found" in str(e):
        skip_or_refresh(symbol)  # delisted/never existed
    else:
        raise

Prevention

When it happens

Trigger: Requesting OHLC for a mistyped name, a delisted instrument (expired contracts disappear from get_instruments once expired=true is not set), or a name assembled with wrong date/strike formatting. Note the function fetches ALL instruments each call to build the map.

Common situations: Historical backfills over expired contracts — Deribit only returns active instruments here, so expired futures fail this check even though they once had data.

Related errors


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