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

Okx - Failed to place orders due to LIMIT_MAKER not supported #7019

Closed
denghanjie opened this issue May 8, 2024 · 3 comments
Closed

Okx - Failed to place orders due to LIMIT_MAKER not supported #7019

denghanjie opened this issue May 8, 2024 · 3 comments
Assignees

Comments

@denghanjie
Copy link

Describe the bug

After connecting okx exchange, pmm strategy fails to place orders automatically. The log says

2024-05-08 11:44:35,006 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - NETWORK - Error submitting buy LIMIT_MAKER order to Okx for 10.00 DOGE-USDC 0.14463.
Traceback (most recent call last):
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
await self._place_order_and_process_update(order=order, **kwargs,)
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
exchange_order_id, update_timestamp = await self._place_order(
File "/home/hummingbot/hummingbot/connector/exchange/okx/okx_exchange.py", line 191, in _place_order
"ordType": CONSTANTS.ORDER_TYPE_MAP[order_type],
KeyError: <OrderType.LIMIT_MAKER: 3>

I tried using different APIs and different IPs, still don't work. Apart from the OrderType.LIMIT_MAKER KeyError, it also reports another error, namely Private websocket connection authentication failed.

2024-05-08 11:08:33,580 - 15 - hummingbot.connector.exchange.okx.okx_api_user_stream_data_source.OkxAPIUserStreamDataSource - ERROR - Unexpected error while listening to user stream. Retrying after 5 seconds...
Traceback (most recent call last):
File "/home/hummingbot/hummingbot/core/data_type/user_stream_tracker_data_source.py", line 45, in listen_for_user_stream
self._ws_assistant = await self._connected_websocket_assistant()
File "/home/hummingbot/hummingbot/connector/exchange/okx/okx_api_user_stream_data_source.py", line 55, in _connected_websocket_assistant
raise IOError("Private websocket connection authentication failed")
OSError: Private websocket connection authentication failed

Steps to reproduce

  1. connect okx, entering api key, secret and passphrase
  2. create pmm strategy
  3. start

Release version

dev-1.28.0

Type of installation

Docker

Attach required files

services:
bot_1:
container_name: bot_1
image: hummingbot/hummingbot:development
volumes:
- ./credentials/master_account:/home/hummingbot/conf
- ./credentials/master_account/connectors:/home/hummingbot/conf/connectors
- ./instances/bot_1/logs:/home/hummingbot/logs
- ./instances/bot_1/data:/home/hummingbot/data
- ./conf/strategies:/home/hummingbot/conf/strategies
- ./conf/scripts:/home/hummingbot/conf/scripts
- ./conf/controllers:/home/hummingbot/conf/controllers
environment:
- CONFIG_PASSWORD=a
- CONFIG_FILE_NAME=v2_generic_with_controllers.py
- SCRIPT_CONFIG=conf_v2_generic_with_controllers_1.yml
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: 5
tty: true
stdin_open: true

2024-05-08 11:44:31,320 - 15 - hummingbot.client.hummingbot_application - INFO - Creating the clock with tick size: 1.0
2024-05-08 11:44:31,323 - 15 - hummingbot.client.hummingbot_application - INFO - start command initiated.
2024-05-08 11:44:32,050 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2024-05-08 11:44:32,060 - 15 - hummingbot.core.api_throttler.async_request_context_base - INFO - API rate limit on WSConnection (1 calls per 1s) has almost reached. Limits used is 1 in the last 1 seconds
2024-05-08 11:44:32,428 - 15 - hummingbot.core.data_type.order_book_tracker - INFO - Initialized order book for DOGE-USDC. 1/1 completed.
2024-05-08 11:44:33,723 - 15 - hummingbot.connector.exchange.okx.okx_api_order_book_data_source.OkxAPIOrderBookDataSource - INFO - Subscribed to public order book and trade channels...
2024-05-08 11:44:34,638 - 15 - hummingbot.connector.exchange.okx.okx_api_user_stream_data_source.OkxAPIUserStreamDataSource - INFO - Subscribed to private account and orders channels...
2024-05-08 11:44:35,004 - 15 - hummingbot.strategy.pure_market_making.pure_market_making - INFO - (DOGE-USDC) Creating 1 bid orders at (Size, Price): ['1E+1 DOGE, 0.14463 USDC']
2024-05-08 11:44:35,006 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - NETWORK - Error submitting buy LIMIT_MAKER order to Okx for 10.00 DOGE-USDC 0.14463.
Traceback (most recent call last):
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
await self._place_order_and_process_update(order=order, **kwargs,)
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
exchange_order_id, update_timestamp = await self._place_order(
File "/home/hummingbot/hummingbot/connector/exchange/okx/okx_exchange.py", line 191, in _place_order
"ordType": CONSTANTS.ORDER_TYPE_MAP[order_type],
KeyError: <OrderType.LIMIT_MAKER: 3>
2024-05-08 11:44:35,010 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - WARNING - Failed to submit BUY order to Okx. Check API key and network connection.
2024-05-08 11:44:35,022 - 15 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1715168675.0, "order_id": "93027a12dac34fBCBDEUC34e53e56208", "order_type": "OrderType.LIMIT_MAKER", "event_name": "MarketOrderFailureEvent", "event_source": "okx"}
2024-05-08 11:44:35,023 - 15 - hummingbot.connector.client_order_tracker - INFO - Order 93027a12dac34fBCBDEUC34e53e56208 has failed. Order Update: OrderUpdate(trading_pair='DOGE-USDC', update_timestamp=1715168675.0, new_state=<OrderState.FAILED: 6>, client_order_id='93027a12dac34fBCBDEUC34e53e56208', exchange_order_id=None, misc_updates=None)
2024-05-08 11:44:36,042 - 15 - hummingbot.core.rate_oracle.rate_oracle - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2024-05-08 11:45:36,003 - 15 - hummingbot.strategy.pure_market_making.pure_market_making - INFO - (DOGE-USDC) Creating 1 bid orders at (Size, Price): ['1E+1 DOGE, 0.14418 USDC']
2024-05-08 11:45:36,006 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - NETWORK - Error submitting buy LIMIT_MAKER order to Okx for 10.00 DOGE-USDC 0.14418.
Traceback (most recent call last):
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
await self._place_order_and_process_update(order=order, **kwargs,)
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
exchange_order_id, update_timestamp = await self._place_order(
File "/home/hummingbot/hummingbot/connector/exchange/okx/okx_exchange.py", line 191, in _place_order
"ordType": CONSTANTS.ORDER_TYPE_MAP[order_type],
KeyError: <OrderType.LIMIT_MAKER: 3>
2024-05-08 11:45:36,009 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - WARNING - Failed to submit BUY order to Okx. Check API key and network connection.
2024-05-08 11:45:36,017 - 15 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1715168736.0, "order_id": "93027a12dac34fBCBDEUC7c2dfe57b56", "order_type": "OrderType.LIMIT_MAKER", "event_name": "MarketOrderFailureEvent", "event_source": "okx"}
2024-05-08 11:45:36,018 - 15 - hummingbot.connector.client_order_tracker - INFO - Order 93027a12dac34fBCBDEUC7c2dfe57b56 has failed. Order Update: OrderUpdate(trading_pair='DOGE-USDC', update_timestamp=1715168736.0, new_state=<OrderState.FAILED: 6>, client_order_id='93027a12dac34fBCBDEUC7c2dfe57b56', exchange_order_id=None, misc_updates=None)
2024-05-08 11:45:39,006 - 15 - hummingbot.client.hummingbot_application - INFO - stop command initiated.
2024-05-08 11:46:30,647 - 15 - hummingbot.client.hummingbot_application - INFO - Creating the clock with tick size: 1.0
2024-05-08 11:46:30,651 - 15 - hummingbot.client.hummingbot_application - INFO - start command initiated.
2024-05-08 11:46:31,384 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2024-05-08 11:46:31,396 - 15 - hummingbot.core.api_throttler.async_request_context_base - INFO - API rate limit on WSConnection (1 calls per 1s) has almost reached. Limits used is 1 in the last 1 seconds

2024-05-08 11:08:33,580 - 15 - hummingbot.connector.exchange.okx.okx_api_user_stream_data_source.OkxAPIUserStreamDataSource - ERROR - Unexpected error while listening to user stream. Retrying after 5 seconds...
Traceback (most recent call last):
File "/home/hummingbot/hummingbot/core/data_type/user_stream_tracker_data_source.py", line 45, in listen_for_user_stream
self._ws_assistant = await self._connected_websocket_assistant()
File "/home/hummingbot/hummingbot/connector/exchange/okx/okx_api_user_stream_data_source.py", line 55, in _connected_websocket_assistant
raise IOError("Private websocket connection authentication failed")
OSError: Private websocket connection authentication failed
2024-05-08 11:08:34,002 - 15 - hummingbot.strategy.pure_market_making.pure_market_making - INFO - (PEPE-USDT) Creating 1 bid orders at (Size, Price): ['1E+6 PEPE, 0.000007667 USDT']
2024-05-08 11:08:34,006 - 15 - hummingbot.strategy.pure_market_making.pure_market_making - INFO - (PEPE-USDT) Creating 1 ask orders at (Size, Price): ['1E+6 PEPE, 0.000007983 USDT']
2024-05-08 11:08:34,007 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - NETWORK - Error submitting buy LIMIT_MAKER order to Okx for 1000000 PEPE-USDT 0.000007667.
Traceback (most recent call last):
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
await self._place_order_and_process_update(order=order, **kwargs,)
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
exchange_order_id, update_timestamp = await self._place_order(
File "/home/hummingbot/hummingbot/connector/exchange/okx/okx_exchange.py", line 191, in _place_order
"ordType": CONSTANTS.ORDER_TYPE_MAP[order_type],
KeyError: <OrderType.LIMIT_MAKER: 3>
2024-05-08 11:08:34,008 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - WARNING - Failed to submit BUY order to Okx. Check API key and network connection.
2024-05-08 11:08:34,009 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - NETWORK - Error submitting sell LIMIT_MAKER order to Okx for 1000000 PEPE-USDT 0.000007983.
Traceback (most recent call last):
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
await self._place_order_and_process_update(order=order, **kwargs,)
File "/home/hummingbot/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
exchange_order_id, update_timestamp = await self._place_order(
File "/home/hummingbot/hummingbot/connector/exchange/okx/okx_exchange.py", line 191, in _place_order
"ordType": CONSTANTS.ORDER_TYPE_MAP[order_type],
KeyError: <OrderType.LIMIT_MAKER: 3>
2024-05-08 11:08:34,010 - 15 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - WARNING - Failed to submit SELL order to Okx. Check API key and network connection.
2024-05-08 11:08:34,019 - 15 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1715166514.0, "order_id": "93027a12dac34fBCBPEUT9d956b907ee", "order_type": "OrderType.LIMIT_MAKER", "event_name": "MarketOrderFailureEvent", "event_source": "okx"}
2024-05-08 11:08:34,020 - 15 - hummingbot.connector.client_order_tracker - INFO - Order 93027a12dac34fBCBPEUT9d956b907ee has failed. Order Update: OrderUpdate(trading_pair='PEPE-USDT', update_timestamp=1715166514.0, new_state=<OrderState.FAILED: 6>, client_order_id='93027a12dac34fBCBPEUT9d956b907ee', exchange_order_id=None, misc_updates=None)
2024-05-08 11:08:34,024 - 15 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1715166514.0, "order_id": "93027a12dac34fBCSPEUTf2a4b5cdae2", "order_type": "OrderType.LIMIT_MAKER", "event_name": "MarketOrderFailureEvent", "event_source": "okx"}
2024-05-08 11:08:34,024 - 15 - hummingbot.connector.client_order_tracker - INFO - Order 93027a12dac34fBCSPEUTf2a4b5cdae2 has failed. Order Update: OrderUpdate(trading_pair='PEPE-USDT', update_timestamp=1715166514.0, new_state=<OrderState.FAILED: 6>, client_order_id='93027a12dac34fBCSPEUTf2a4b5cdae2', exchange_order_id=None, misc_updates=None)

@denghanjie denghanjie added the bug label May 8, 2024
@rapcmia rapcmia added the okx label May 8, 2024
@nikspz
Copy link
Contributor

nikspz commented May 9, 2024

reproduced on latest dev-1.28.0

logs_conf_pure_mm_1.log

2024-05-09 12:48:05,893 - 1703175 - hummingbot.client.hummingbot_application - INFO - start command initiated.
2024-05-09 12:48:06,164 - 1703175 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2024-05-09 12:48:06,170 - 1703175 - hummingbot.core.api_throttler.async_request_context_base - INFO - API rate limit on WSConnection (1 calls per 1s) has almost reached. Limits used is 1 in the last 1 seconds
2024-05-09 12:48:06,426 - 1703175 - hummingbot.connector.exchange.okx.okx_api_order_book_data_source.OkxAPIOrderBookDataSource - INFO - Subscribed to public order book and trade channels...
2024-05-09 12:48:07,525 - 1703175 - hummingbot.connector.exchange.okx.okx_api_user_stream_data_source.OkxAPIUserStreamDataSource - INFO - Subscribed to private account and orders channels...
2024-05-09 12:48:08,002 - 1703175 - hummingbot.strategy.pure_market_making.pure_market_making - INFO - (DOGE-USDT) Creating 1 bid orders at (Size, Price): ['1E+1 DOGE, 0.14555 USDT']
2024-05-09 12:48:08,004 - 1703175 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - NETWORK - Error submitting buy LIMIT_MAKER order to Okx for 10.000000 DOGE-USDT 0.14555.
Traceback (most recent call last):
  File "/home/nikita/backt7004/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
    await self._place_order_and_process_update(order=order, **kwargs,)
  File "/home/nikita/backt7004/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
    exchange_order_id, update_timestamp = await self._place_order(
  File "/home/nikita/backt7004/hummingbot/connector/exchange/okx/okx_exchange.py", line 191, in _place_order
    "ordType": CONSTANTS.ORDER_TYPE_MAP[order_type],
KeyError: <OrderType.LIMIT_MAKER: 3>
2024-05-09 12:48:08,008 - 1703175 - hummingbot.connector.exchange.okx.okx_exchange.OkxExchange - WARNING - Failed to submit BUY order to Okx. Check API key and network connection.
2024-05-09 12:48:08,019 - 1703175 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1715258888.0, "order_id": "93027a12dac34fBCBDEUTeaddfdef64c", "order_type": "OrderType.LIMIT_MAKER", "event_name": "MarketOrderFailureEvent", "event_source": "okx"}
2024-05-09 12:48:08,020 - 1703175 - hummingbot.connector.client_order_tracker - INFO - Order 93027a12dac34fBCBDEUTeaddfdef64c has failed. Order Update: OrderUpdate(trading_pair='DOGE-USDT', update_timestamp=1715258888.0, new_state=<OrderState.FAILED: 6>, client_order_id='93027a12dac34fBCBDEUTeaddfdef64c', exchange_order_id=None, misc_updates=None)

image

@nikspz
Copy link
Contributor

nikspz commented May 9, 2024

@cardosofede

@nikspz nikspz changed the title Okx Api connection issue Okx - Failed to place orders due to OSError: Private websocket connection authentication failed May 15, 2024
@nikspz nikspz changed the title Okx - Failed to place orders due to OSError: Private websocket connection authentication failed Okx - Failed to place orders due to LIMIT_MAKER not supported May 16, 2024
@nikspz
Copy link
Contributor

nikspz commented May 16, 2024

Fix merged to latest development (dev-1.28.0),

will be available in 1.28.0 Release

@nikspz nikspz closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants