Immediate or cancel (IOC) is a time-in-force instruction that allows an order to fill immediately, including partially, but prevents its unfilled remainder from waiting on the order book. It answers how long the order may remain active, rather than setting its price by itself.
A limit still applies
Consider an IOC limit order to buy 20 tokens at no more than $5 each. Suppose six tokens are available at $4.99 and four at $5, with all other offers above the limit. Assuming that liquidity remains available when matching occurs, ten tokens execute and the other ten are canceled. The purchase costs $49.94 before fees. If no acceptable liquidity exists, none executes.
Partial execution is intentional
IOC suits an instruction to trade the amount available now without leaving an outstanding remainder. By contrast, FOK requires the entire requested quantity immediately, while GTC can leave a remainder active.
IOC does not mean one fill, one price, or guaranteed execution. Verify the filled quantity and actual average price before retrying: a canceled final status may coexist with completed partial trades. Supported order combinations and matching rules vary by venue.