You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
Using CCXT for KuCoin spot trading, I've noticed that the watchOrders() order event data that is received when an order is closed, does NOT contain the actual price at which the order was filled. Example:
I'm creating an order: XRP/USDT limit sell at a price of $0.495 (placing it below the current price on purpose to see what happens)
In the KuCoin order history, I see the order got filled with an average price of $0.49548
The data in the order event only has the price at which I placed the order ($0.495). There is no data, not even in the raw response (info object), that can be used to determine the actual/average price.
Now, since the relevant data is not in the raw response either, I first thought this was a problem on the KuCoin side. However, the API does return the relevant information at one point, see (using verbose logging):
In the first event, you can see the matchPrice, which is the correct price. Interestingly, the matchPrice is no longer visible in the second event. Perhaps that's why things fail?
Also, in the matchPrice is actual visible in the CCXT order data when the order is opened (and immediately filled):
Note: also the cost is incorrect, but it seems CCXT calculates that by just multiplying price and filled, so if the price is correct, I would assume cost will be correct as well (?).
Based on the above, it seems to me that the problem is probably (partially) on the KuCoin side, as the relevant data is missing from the 'closed' event.
The text was updated successfully, but these errors were encountered:
Using CCXT for KuCoin spot trading, I've noticed that the
watchOrders()
order event data that is received when an order is closed, does NOT contain the actual price at which the order was filled. Example:I'm creating an order: XRP/USDT limit sell at a price of $0.495 (placing it below the current price on purpose to see what happens)
In the KuCoin order history, I see the order got filled with an average price of $0.49548
The data in the order event only has the price at which I placed the order ($0.495). There is no data, not even in the raw response (info object), that can be used to determine the actual/average price.
Now, since the relevant data is not in the raw response either, I first thought this was a problem on the KuCoin side. However, the API does return the relevant information at one point, see (using verbose logging):
In the first event, you can see the
matchPrice
, which is the correct price. Interestingly, thematchPrice
is no longer visible in the second event. Perhaps that's why things fail?Also, in the
matchPrice
is actual visible in the CCXT order data when the order is opened (and immediately filled):For completeness, this is the 'closed' event returned by CCXT:
Note: also the cost is incorrect, but it seems CCXT calculates that by just multiplying price and filled, so if the price is correct, I would assume cost will be correct as well (?).
Based on the above, it seems to me that the problem is probably (partially) on the KuCoin side, as the relevant data is missing from the 'closed' event.
The text was updated successfully, but these errors were encountered: