bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.19k stars 679 forks source link

Deribit new instrument types causing exception (future_combo) #906

Closed vincentmele closed 1 year ago

vincentmele commented 1 year ago

Deribit has added a new symbol type, "future_combo" that is breaking a default configuration of cryptofeed. The /public/get_instruments API call now returns future_combo and option_combo in addition to future and option. I'm not suggesting that cryptofeed handle combo type instruments, only that it doesn't throw an exception.

See https://docs.deribit.com/#public-get_instruments

This leads to the exception thrown below:

2022-09-22 11:25:29,531 : INFO : Config: use file='/config/config.yaml' from CRYPTOFEED_CONFIG containing the following main keys: log, deribit
2022-09-22 11:25:30,424 : ERROR : DERIBIT: Failed to parse symbol information: Unsupported symbol type: future_combo
Traceback (most recent call last):
  File "/root/deps/cryptofeed/exchange.py", line 104, in symbol_mapping
    syms, info = cls._parse_symbol_data(data if len(data) > 1 else data[0])
  File "/root/deps/cryptofeed/exchanges/deribit.py", line 68, in _parse_symbol_data
    ret[s.normalized] = e['instrument_name']
  File "/root/deps/cryptofeed/symbols.py", line 89, in normalized
    raise ValueError(f"Unsupported symbol type: {self.type}")
ValueError: Unsupported symbol type: future_combo
Traceback (most recent call last):
  File "/cryptostore.py", line 124, in <module>
    main()
  File "/cryptostore.py", line 118, in main
    cfg = load_config()
  File "/cryptostore.py", line 113, in load_config
    return EXCHANGE_MAP[exchange](candle_intterval=candle_interval, symbols=symbols, channels=channels, config=config, callbacks=cbs)
  File "/root/deps/cryptofeed/feed.py", line 63, in __init__
    super().__init__(**kwargs)
  File "/root/deps/cryptofeed/exchange.py", line 48, in __init__
    self.symbol_mapping()
  File "/root/deps/cryptofeed/exchange.py", line 104, in symbol_mapping
    syms, info = cls._parse_symbol_data(data if len(data) > 1 else data[0])
  File "/root/deps/cryptofeed/exchanges/deribit.py", line 68, in _parse_symbol_data
    ret[s.normalized] = e['instrument_name']
  File "/root/deps/cryptofeed/symbols.py", line 89, in normalized
    raise ValueError(f"Unsupported symbol type: {self.type}")
ValueError: Unsupported symbol type: future_combo

My config.yaml for cryptofeed is:

log:
    filename: feedhandler.log
    level: WARNING
deribit:
    key_id: <key id redacted>
    key_secret: <key secret redacted>

Environment variables for cryptostore:

    "BACKEND": "TTY",
    "CHANNELS": "l2_book",
    "CRYPTOFEED_CONFIG": "/config/config.yaml",
    "EXCHANGE": "DERIBIT",
    "SYMBOLS": "BTC-USD-PERP,ETH-USD-PERP",
bmoscon commented 1 year ago

what version are you using? This has been fixed

vincentmele commented 1 year ago

You're right :-) Apologies. I am running on Kubernetes and it didn't pull my latest built Docker image with the latest cryptofeed. Thought I had checked that but on second pass I see I missed it.

Thanks as always for the product and your rapid response to issues.