Every order starts PENDING. A resting order is OPEN. The right column holds the three final states.
openmeans the order is resting. Any fills that matched when it entered the book arrive first.- A partial
fillkeeps the orderOPENand shrinksremaining. cancelmeans you canceled the order, it expired, or we voided it. AnIOCorder that fills in part cancels the rest.rejectmeans we refused the order after accepting it. AnIOC,FOK, orPOorder that fills nothing is rejected.
There’s no
PARTIALLY_FILLED status. Track remaining instead.Track order state
1
Subscribe first
Subscribe to orders on the private stream before you place an order.
2
Take a snapshot
Take a snapshot of your open orders and its sequence number,
seq.3
Apply events in order
Apply events in
seq order. If you see a gap, take a new snapshot.4
Key on orderId
Key your state on
orderId.
