{"record":{"id":"3148ee87e277e05f","repo":"OpenBB-finance/OpenBB","slug":"symbol-symbol-not-found","errorCode":null,"errorMessage":"Symbol {symbol} not found","messagePattern":"Symbol (.+?) not found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py","lineNumber":252,"sourceCode":") -> list[dict]:\n    \"\"\"Get OHLC data for a given symbol. Enter dates in the format 'YYYY-MM-DD'.\"\"\"\n    # pylint: disable=import-outside-toplevel\n    import asyncio  # noqa\n    from openbb_core.provider.utils.errors import EmptyDataError\n    from openbb_core.provider.utils.helpers import amake_request\n    from pandas import DataFrame, date_range, to_datetime\n\n    new_interval = INTERVAL_MAP.get(interval, interval)\n\n    all_instruments = await get_instruments(\"all\", None)\n    all_symbols = {\n        d.get(\"instrument_name\"): d.get(\"creation_timestamp\") for d in all_instruments\n    }\n    creation_date = all_symbols.get(symbol, 0)\n    use_start = to_datetime(start_date).timestamp() * 1000 > creation_date\n\n    if creation_date == 0:\n        raise ValueError(f\"Symbol {symbol} not found\")\n\n    def generate_urls(symbol, start_date, end_date, interval, window_size=5000):\n        \"\"\"Generate urls for historical data breaking it down into requests of length window_size.\"\"\"\n        interval_period = f\"{interval}min\" if interval.lower() != \"1d\" else \"1d\"\n        interval = \"1D\" if interval.lower() == \"1d\" else interval\n        dates = date_range(\n            start=start_date if use_start else creation_date,\n            end=end_date,\n            freq=interval_period,\n        )\n        windows = [\n            (dates[i], dates[min(i + window_size, len(dates) - 1)])\n            for i in range(0, len(dates), window_size)\n        ]\n        urls: list = []\n        for start, end in windows:\n            start_timestamp = int(start.timestamp() * 1000)\n            end_timestamp = int(end.timestamp() * 1000)","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py#L234-L270","documentation":"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'.","triggerScenarios":"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.","commonSituations":"Historical backfills over expired contracts — Deribit only returns active instruments here, so expired futures fail this check even though they once had data.","solutions":["Use an active instrument name; verify via get_instruments('all', None) — the same map this function checks.","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.","Check formatting: dated futures look like BTC-27JUN26, options like BTC-27JUN26-25000-C.","Handle the ValueError to skip unknown symbols in batch jobs."],"exampleFix":"# before\n candles = await get_ohlc_data(\"BTC-28JUN25\", ...)  # already expired\n\n# after\ncandles = await get_ohlc_data(\"BTC-PERPETUAL\", ...)  # active instrument","handlingStrategy":"validation","validationCode":"from openbb_deribit.utils.helpers import get_instruments\nlive = {d[\"instrument_name\"] for d in asyncio.run(get_instruments(\"all\", None))}\nif symbol not in live:\n    raise ValueError(f\"{symbol} is not a currently listed instrument; pick from {len(live)} live names\")","typeGuard":"def is_known_instrument(symbol: str, live: set[str]) -> bool:\n    \"\"\"True only for instruments Deribit currently returns (active, not expired).\"\"\"\n    return isinstance(symbol, str) and symbol in live","tryCatchPattern":"try:\n    candles = await get_ohlc_data(symbol, interval, start, end)\nexcept ValueError as e:\n    if \"not found\" in str(e):\n        skip_or_refresh(symbol)  # delisted/never existed\n    else:\n        raise","preventionTips":["Expired contracts are invisible to this function (get_instruments runs without expired=True).","Verify name format: futures BTC-27JUN26, options BTC-27JUN26-25000-C.","Filter symbol batches against a fresh instrument map before fetching."],"tags":["deribit","ohlc","instrument-name","expired-contract","validation"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}