Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[phemex] fix symbol parsing #916

Merged
merged 1 commit into from
Oct 19, 2022
Merged

Conversation

GuillaumeDSM
Copy link
Contributor

Description of code - what bug does this fix / what feature does this add?

Phemex has a symbol that is incompatible and makes the feed constructor crash:

 2022-10-20 00:33:10,002 ERROR    WebSocket - CryptofeedWebSocketExchange not enough values to unpack (expected 2, got 1)
Traceback (most recent call last):
  File "C:\Users\gdsm\TradingBots\0.4\OctoBot-Trading\octobot_trading\exchanges\implementations\cryptofeed_websocket_exchange.py", line 38, in create_feeds
    connector = self.websocket_connector(config=self.config, exchange_manager=self.exchange_manager)
  File "C:\Users\gdsm\TradingBots\0.4\OctoBot-Trading\octobot_trading\exchanges\connectors\cryptofeed_websocket_connector.py", line 148, in __init__
    self.cryptofeed_exchange = cryptofeed_exchanges.EXCHANGE_MAP[self.get_feed_name()](
  File "C:\Users\gdsm\TradingBots\0.4\OctoBot\venv\lib\site-packages\cryptofeed\exchanges\phemex.py", line 65, in __init__
    super().__init__(**kwargs)
  File "C:\Users\gdsm\TradingBots\0.4\OctoBot\venv\lib\site-packages\cryptofeed\feed.py", line 63, in __init__
    super().__init__(**kwargs)
  File "C:\Users\gdsm\TradingBots\0.4\OctoBot\venv\lib\site-packages\cryptofeed\exchange.py", line 49, in __init__
    self.symbol_mapping()
  File "C:\Users\gdsm\TradingBots\0.4\OctoBot\venv\lib\site-packages\cryptofeed\exchange.py", line 105, in symbol_mapping
    syms, info = cls._parse_symbol_data(data if len(data) > 1 else data[0])
  File "C:\Users\gdsm\TradingBots\0.4\OctoBot\venv\lib\site-packages\cryptofeed\exchanges\phemex.py", line 53, in _parse_symbol_data
    base, quote = entry['displaySymbol'].split(" / ")
ValueError: not enough values to unpack (expected 2, got 1)
 2022-10-20 00:33:10,002 ERROR    WebSocket - CryptofeedWebSocketExchange Fail to create feed : not enough values to unpack (expected 2, got 1) (ValueError)

image

  • [x ] - Tested
  • [x ] - Changelog updated
  • - Tests run and pass
  • - Flake8 run and all errors/warnings resolved
  • - Contributors file updated (optional)

@bmoscon bmoscon merged commit d848744 into bmoscon:master Oct 19, 2022
shaunc pushed a commit to shaunc/cryptofeed that referenced this pull request May 27, 2023
Co-authored-by: Guillaume De Saint Martin <guillaume.minette_de_saintmartin@insa-rouen.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants