{"record":{"id":"d60f8ed17dd2cbbd","repo":"OpenBB-finance/OpenBB","slug":"currency-currency-not-supported-supported-curre","errorCode":null,"errorMessage":"Currency {currency} not supported. Supported currencies are: {', '.join(CURRENCIES)}","messagePattern":"Currency (.+?) not supported\\. Supported currencies are: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py","lineNumber":76,"sourceCode":"    Get Deribit instruments.\n\n    Parameters\n    ----------\n    currency : Currencies\n        The currency to get instruments for. Default is \"BTC\".\n    derivative_type : Optional[DerivativeTypes]\n        The type of derivative to get instruments for. Default is None, which gets all types.\n\n    Returns\n    -------\n    list[dict]\n        A list of instrument dictionaries.\n    \"\"\"\n    # pylint: disable=import-outside-toplevel\n    from openbb_core.provider.utils.helpers import amake_request\n\n    if currency != \"all\" and currency.upper() not in CURRENCIES:\n        raise ValueError(\n            f\"Currency {currency} not supported. Supported currencies are: {', '.join(CURRENCIES)}\"\n        )\n    if derivative_type and derivative_type not in DERIVATIVE_TYPES:\n        raise ValueError(\n            f\"Kind {derivative_type} not supported. Supported kinds are: {', '.join(DERIVATIVE_TYPES)}\"\n        )\n\n    url = f\"{BASE_URL}/api/v2/public/get_instruments?currency={currency.upper() if currency != 'all' else 'any'}\"\n\n    if derivative_type is not None:\n        url += f\"&kind={derivative_type}\"\n\n    if expired:\n        url += f\"&expired={str(expired).lower()}\"\n\n    try:\n        response = await amake_request(url)\n        return response.get(\"result\", [])  # type: ignore","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py#L58-L94","documentation":"ValueError from get_instruments (openbb_deribit.utils.helpers) when the currency argument is not 'all' (case-insensitive) and its uppercased form is not in CURRENCIES = [BTC, ETH, USDC, USDT, EURR, 'all']. This is a static guard in front of the Deribit /public/get_instruments URL build.","triggerScenarios":"Calling get_instruments('SOL') (options-only underlying, not a futures currency), 'BTC_USD', 'usdt' is fine (uppercased), or any fiat/altcoin not in the list. Note this function is also called internally with mapped values, so user-facing trigger is via direct helper use.","commonSituations":"Assuming every DERIBIT_OPTIONS_SYMBOLS underlying works as a currency for instruments (SOL, XRP, BNB, PAXG are NOT valid here), or passing exchange-pair strings.","solutions":["Use one of BTC, ETH, USDC, USDT, EURR, or the literal 'all' (case-insensitive).","For option underlyings like SOL/XRP, note the helper itself maps them to USDC where appropriate; do not pass them to get_instruments directly.","Validate currency against CURRENCIES before looping over currencies in batch scripts."],"exampleFix":"# before\ninstruments = await get_instruments(\"SOL\", \"future\")\n\n# after\ninstruments = await get_instruments(\"all\", \"future\")  # or \"BTC\", \"ETH\", \"USDC\", \"USDT\", \"EURR\"","handlingStrategy":"validation","validationCode":"CURRENCIES = {\"BTC\", \"ETH\", \"USDC\", \"USDT\", \"EURR\", \"all\"}\ncur = cur.strip()\nassert cur.upper() in CURRENCIES or cur == \"all\", f\"currency must be one of {sorted(CURRENCIES)}\"","typeGuard":"from typing import Literal, TypeGuard\nCurrency = Literal[\"BTC\", \"ETH\", \"USDC\", \"USDT\", \"EURR\", \"all\"]\n\ndef is_deribit_currency(s: str) -> TypeGuard[Currency]:\n    return s in {\"BTC\", \"ETH\", \"USDC\", \"USDT\", \"EURR\", \"all\"} or s.upper() in {\"BTC\", \"ETH\", \"USDC\", \"USDT\", \"EURR\", \"ALL\"}","tryCatchPattern":null,"preventionTips":["Remember option underlyings (SOL/XRP/BNB/PAXG) are NOT valid currencies here.","Use 'all' when unsure — it queries every currency."],"tags":["deribit","validation","currency","instruments","allow-list"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}