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

Kucoin false order created event #6890

Closed
usamike25 opened this issue Mar 3, 2024 · 2 comments
Closed

Kucoin false order created event #6890

usamike25 opened this issue Mar 3, 2024 · 2 comments

Comments

@usamike25
Copy link

Describe the bug

Upon initiating a buy order, I received a BuyOrderCreated event, indicating that the order had been successfully created. However, upon further inspection, it became evident that the order had not actually been created on the exchange. the order did not have an exchange order id. indicating that the order was never created.

Steps to reproduce

1.Execute a script to create an order on Kucoin.
2. Monitor for the BuyOrderCreated event to be triggered, indicating order creation.
3. Attempt to cancel the created order. At this point, an error is encountered, suggesting the order does not exist on the exchange

Release version

1.25

Type of installation

Docker

Attach required files

Bildschirm­foto 2024-03-03 um 10 17 40 Bildschirm­foto 2024-03-03 um 10 23 13 Bildschirm­foto 2024-03-03 um 10 30 20 Bildschirm­foto 2024-03-03 um 10 33 37
@usamike25 usamike25 added the bug label Mar 3, 2024
@rapcmia rapcmia added the kucoin label Mar 4, 2024
@rapcmia
Copy link
Contributor

rapcmia commented Mar 8, 2024

Issue reproduced when creating market order as well for v2 scripts.

# This is where SLMUT613256e6981c11091011461f21c03b0c06b market order created 
# Observed that it does not have exchange_order_id
2024-03-08 20:35:47,388 - 5370 - hummingbot.strategy.script_strategy_base - INFO - Creating LOOM-USDT sell order: price: NaN amount: 108.3916.
2024-03-08 20:35:47,390 - 5370 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing close order --> Filled amount: 108.3916 | TP Partial execution: 0
2024-03-08 20:35:47,712 - 5370 - hummingbot.connector.client_order_tracker - INFO - Created MARKET SELL order SLMUT613256e6981c11091011461f21c03b0c06b for 108.3916 LOOM-USDT.
2024-03-08 20:35:47,712 - 5370 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1709901347.0, "type": "OrderType.MARKET", "trading_pair": "LOOM-USDT", "amount": "108.3916", "price": "NaN", "order_id": "SLMUT613256e6981c11091011461f21c03b0c06b", "creation_timestamp": 1709901347.0, "exchange_order_id": "None", "leverage": 1, "position": "NIL", "event_name": "SellOrderCreatedEvent", "event_source": "kucoin"}
2024-03-08 20:35:47,716 - 5370 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Close Order Created

....

# Now getting error fetch data SLMUT613256e6981c11091011461f21c03b0c06b
2024-03-08 20:36:07,521 - 5370 - hummingbot.connector.exchange.kucoin.kucoin_exchange.KucoinExchange - WARNING - Error fetching status update for the active order SLMUT613256e6981c11091011461f21c03b0c06b: 'data'.

....

# Stop command initiated 
2024-03-08 20:38:35,149 - 5370 - hummingbot.client.hummingbot_application - INFO - stop command initiated.
2024-03-08 20:38:35,388 - 5370 - hummingbot.connector.exchange.kucoin.kucoin_exchange.KucoinExchange - ERROR - Failed to cancel order SLMUT613256e6981c11091011461f21c03b0c06b
Traceback (most recent call last):
  File "/Users/rapcomia/github/hummingbot/development/hummingbot/connector/exchange_py_base.py", line 520, in _execute_order_cancel
    cancelled = await self._execute_order_cancel_and_process_update(order=order)
  File "/Users/rapcomia/github/hummingbot/development/hummingbot/connector/exchange_py_base.py", line 540, in _execute_order_cancel_and_process_update
    cancelled = await self._place_cancel(order.client_order_id, order)
  File "/Users/rapcomia/github/hummingbot/development/hummingbot/connector/exchange/kucoin/kucoin_exchange.py", line 231, in _place_cancel
    if tracked_order.exchange_order_id in cancel_result["data"].get("cancelledOrderIds", []):
KeyError: 'data'
  • This cause the script to fail and letting us exit the client. Therefore we have to use exit -f

Steps to reproduce:

  • Setup any v2 scripts with kucoin spot connector
  • Setup asset with 0 base asset and start the script
  • Observe the logs files until you get Error fetching status update for the active order then execute stop command

logs_conf_v2_dman_v4_config_1.log

@rapcmia
Copy link
Contributor

rapcmia commented May 13, 2024

Fix has been deployed to development and will be part of version 1.28.0

@rapcmia rapcmia closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed
Development

No branches or pull requests

3 participants