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 lost order error #6968
Comments
Found this issue happened when testing xemm script using kucoin as maker exchange on #6946
|
The fix has been deployed to development and will be part of version 1.28.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using Kucoin, the bot sometimes returns an error during order cancellation, and then this order is considered lost. It subsequently tries to cancel it multiple times and prints the 'Error fetching status update for the lost order' error.
The reason for this is that when an order is placed on Kucoin, the exchange sometimes returns an error, such as 'Insufficient balance' or similar, especially during high volatility market events. So, the order is not actually placed on Kucoin, but the bot changes its status to 'Open' and assumes it was successfully opened. In the database, such orders have a None value in the exchange_order_id field
Steps to reproduce
To reproduce you can simulate insufficient balance error:
simple_pmm_example.py
scriptself.place_orders(proposal_adjusted)
toself.place_orders(proposal)
exchange = "kucoin"
kucoin_exchange.py
to log the response from KuCoin after it placed the order:After this section of code:
add
self.logger().info(f"response = {exchange_order_id}")
7. Run the script and you should see that the order is considered opened and tracked.
The problem could be fixed by checking the response from Kucoin. If the reply doesn't contain the exchange order_id, then do not trigger order creation.
In this screenshot, I have two orders placed: the SELL order is ok, while the BUY order has not opened, but is considered as opened by Hummingbot
The database exchange_order_id is None
Release version
1.27
Type of installation
Source
Attach required files
No response
The text was updated successfully, but these errors were encountered: