The approach in this post is perfect to get the price of a spot market order at the moment it is placed via the API.
Yet, it is sometimes required to retrieve this price for an existing market order, after the fact. There are several motivations for that:
- The order might have been placed by a different process (manually via the web application, by a different application, …)
- An application might crash after it sent the order via the REST API, but before it could get the response. At next start, the application might thus need to query the price for the order it sent before crashing. (Crashing might be due to a power or Internet outage, so better programmer discipline cannot eliminate this problem).
As far as we tested the query order endpoint:
- it always returns 0 for the
pricefield of market orders (even after they filled).
- it does not accept the
newOrderRespType = FULLparameter, and it does not return the
Is there currently a way to find the price of filled market order via the REST API?