hummingbot: Bitmart - Getting unexpected errors after orders created

Describe the bug While testing Bitmart, we noticed that the bot returns a Unexpected error after orders are created. There are also instances that the orders failed to be cancelled resulting to error Failed to cancel order the order..

Tested on local connection: image

Tested on AWS: Screenshot 2022-03-09 153834

2022-03-09 15:13:50,054 - 26760 - hummingbot.connector.exchange.bitmart.bitmart_api_order_book_data_source - ERROR - Unexpected error.
Traceback (most recent call last):
  File "/home/rapcmia/github/dev/hummingbot/connector/exchange/bitmart/bitmart_api_order_book_data_source.py", line 168, in listen_for_trades
    async for raw_msg in ws.iter_messages():
  File "/home/rapcmia/github/dev/hummingbot/core/web_assistant/ws_assistant.py", line 63, in iter_messages
    response = await self._connection.receive()
  File "/home/rapcmia/github/dev/hummingbot/core/web_assistant/connections/ws_connection.py", line 60, in receive
    response = self._build_resp(msg)
  File "/home/rapcmia/github/dev/hummingbot/core/web_assistant/connections/ws_connection.py", line 120, in _build_resp
    data = msg.json()
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 95, in json
    return loads(self.data)
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)

Steps To Reproduce

  1. Create simple pure market making strategy
  2. Start the bot and monitor the log panel

Release version dev-1.2

Attachments pmm-bitmart.zip

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (5 by maintainers)

Most upvoted comments

I have gone through and fixed this issue on my repo fork. #5353 if someone can look into this that would be great. Thanks.

it works fine

hi @reubenyap I tried to change the WSS_URL to wss://ws-manager-compress.bitmart.com/api?protocol=1.1 and start a simple PMM strategy but still getting the unexpected errors on the client. I also informed our CMs about this update for Bitmart to follow up with the maintainer so they can fix it.

Here’s a recording what I did earlier:

https://user-images.githubusercontent.com/73840223/162408404-c0e2eb12-6968-4d0f-a0a0-6def13f89834.mp4