Closed micant closed 3 years ago
Bump. Any help with this issue?
I've worked around this by requesting trades associated with the order and running calculations from there.
Hi @micant
Thanks for your message and sorry for the delay in response.
The price in an order record is an instruction to execute an order if that price is available. For market orders this may be different at the time of execution (e.g. compared to time that a client initiates the request).
Even for limit orders the execution price might be different due to multiple executions and in some cases the market has better price (in the case of a buy, the order may execute lower if there are available orders) compared to price in the order.
So in all cases, the price in order is an instruction to execute whereas the actual order execution is in trade record and an order may have multiple trade records with different prices.
So depending on your use case trade records can be used to determine actual order executions if actual prices are needed.
I hope this helps.
Regards, Martin
env: node api: v3
When placing a market buy or sell order via api the price property returned is, often but not always, incorrect. The trades associated with the order either don't match the order price, or don't average to equal the order price. When calculating the cost (price * volume) of a trade, this has caused some incorrect calculations at my end.
Should the order price be disregarded and underlying trade prices be used instead? Is this by design or an issue with the API - or am I getting something wrong?
Appreciate your help, thanks.
Example order price - $45796.45 trade price - $45634.03
fetch order:
fetch trade: