The status of an order can be queried by using Fetch User's Orders api.
Note that orders can have one of the following three statuses:
Open
- Description: The order is still open and partially filled.
- Condition: filled amount > 0
- Example: If you placed an order to sell 100 tokens and 50 tokens have been sold, the order status would be Active.
Completed
- Description: The order has been fully executed.
- Condition: filled amount = order amount
- Example: If you placed an order to buy 200 tokens and all 200 tokens have been purchased, the order status would be Completed.
Cancelled
- Description: The order has been cancelled either by the user or the system.
- Condition: filled amount > 0
- Example: If you placed an order to buy 150 tokens and the system or you cancel it after 75 tokens have been bought, the order status would be Cancelled.
Order Cancellation Reasons
An order can be cancelled for several reasons, identified by specific codes:
611 User Cancel
- Description: The order was manually cancelled by the user.
- Example: You decide to cancel your open order to adjust the price or quantity.
711 Insufficient Funds
- Description: The order was cancelled by the system due to insufficient token balance in the user’s wallet at the time of order execution.
- Example: You placed a maker order to sell 100 tokens but only have 50 tokens in your wallet at the time of order execution.
712 Insufficient Allowance
- Description: The order was cancelled by the system because the user did not provide enough token allowance for the exchange contract at the time of order execution.
- Example: You placed a maker order to sell 100 tokens but did not approve enough allowance for the exchange contract to transfer the tokens on your behalf.
811 Auto Cancel Due to Min Match
- Description: The order was cancelled by the system because, after partial execution, the remaining balance of the order was less than $2.
- Example: Your order was partially matched, and the remaining order value was less than $2, prompting the system to automatically cancel the remaining order.
Understanding these order states and cancellation reasons will help you manage your trading activity effectively on our decentralized exchange. If you have any further questions or need assistance, please refer to our support section.