What causes IOC orders to be canceled?

An immediate-or-cancel (IOC) or a fill-or-kill (FOK) order will be canceled if it arrives at the matching engine when there is no liquidity on the opposite side of the order book at, or better than, the limit price specified. The question then becomes what causes there to be no matching liquidity when an IOC or FOK arrives at the exchange?

There are many different possible causes for this, but they can be summarized under three different immediate causes:

  • The order was sent at a price that was not available at the time it was generated [related: What causes an IOC order to be sent at an unmarketable price?]
  • The liquidity at the target price was already lifted by another aggressive order by the time the order in question arrived
  • The resting order or quote at the target price was already pulled by the provider of that liquidity by the time the order arrived.