What you need to know about crypto immediate or cancel orders in 2026
An immediate or cancel order (IOC) is an instruction to buy or sell that must fill right away at your specified price or better. Any part that cannot execute immediately is canceled. In crypto trading this matters for controlling execution quality in fast markets, especially when you care more about price than about getting the full size filled.
IOC orders are a core tool in more advanced trading strategies and automated workflows. They help market makers limit exposure, let arbitrage bots control slippage, and give active traders precise control over how their orders interact with on-chain liquidity. They also serve as a building block for complex strategies that combine multiple order types and venues.
This guide explains how IOC orders work, when to use them, their pros and cons, how they fit into automated trading, how they compare with other order types, and practical tips for using them in crypto markets.
Understanding how an immediate or cancel order works
An immediate or cancel order tells the trading venue to execute as much of the order as possible right away, then cancel whatever remains unfilled. If the market has enough liquidity at your limit price or better, you may get a full fill. If there is only partial liquidity, you get a partial fill and the rest disappears. If there is no available liquidity at your price, the entire order is canceled instantly.
On centralized exchanges, IOC behavior is handled by the exchange’s matching engine. The engine checks the order book, matches against resting orders up to your limit price, and cancels any leftover quantity. The unfilled portion never becomes a resting limit order in the book.
On decentralized exchanges and protocols, implementation depends on the design. On on-chain order books, an IOC order is typically a transaction that specifies price and quantity plus a time-in-force flag set to IOC. The smart contract tries to match your trade against existing orders within that same transaction. Anything that cannot be matched at your price is not stored on-chain as a new resting order.
On automated market maker (AMM) style DEXs and aggregators, IOC behavior is usually achieved through slippage and routing controls. You submit a swap through a router, possibly via a protocol like CoW Swap or another aggregator, with strict maximum slippage or price constraints. The transaction must execute at or better than your target rate. If the protocol cannot find enough liquidity within those constraints in that block or batch, the transaction reverts. The effect is the same as an IOC: immediate execution or nothing.
The key difference from other order types is that IOC never leaves any unfilled remainder waiting in the market. That contrasts with a standard limit order that can sit on the book until canceled or expired, and with market orders that aim to fill the full size regardless of the price drift, within any configured slippage settings.
When to use an immediate or cancel order
IOC orders work best when you care about price and timing more than about guaranteed full size. They are useful when you need instant feedback on whether liquidity is available under strict conditions.
Active traders use IOC orders to probe order books on both centralized and decentralized venues. For example, a trader might place an IOC buy slightly below the best offer to see how much size is actually available without signaling future interest by leaving a resting order.
Institutions and professional desks often use IOC orders to control execution during fast markets or event-driven trades. If they cannot get the desired size at their price, they prefer to stay flat rather than chase the market.
Many trading bots rely on IOC logic. Arbitrage bots that operate across CEXs and DEXs use IOC-like behavior to ensure that partial or bad fills do not break their hedging or cross-venue strategy. Market making bots may submit IOC orders to quickly adjust inventory without adding visible resting orders that can be picked off.
Common parameters associated with IOC behavior include a limit price, a maximum acceptable slippage, a time-in-force flag set to IOC, and sometimes minimum fill quantity. In on-chain contexts you also need to consider gas price, as slow confirmation can undermine the "immediate" aspect in volatile conditions.
Advantages and trade‑offs
The main advantage of an IOC order is control over execution quality. You know that you only trade if the market can fill you right away at your defined price conditions. You avoid the risk of leaving stale limit orders on the book that might get filled later at a bad moment.
IOC orders also reduce exposure to adverse selection. Because the order does not rest, other traders have less time to react to your intentions. In crypto, where information can move very fast, this can matter a lot.
The trade-offs are clear. You may not get your full size, or you may not trade at all. In thin or fragmented markets, IOC orders can result in frequent cancellations and missed opportunities. You also lose the benefit of passively providing liquidity and possibly earning maker rebates on some centralized exchanges.
Compared to market orders, IOC orders are safer in terms of price control but less reliable for full execution. Compared to resting limit orders, they are faster and safer against long-term risk but offer less flexibility for capturing future liquidity. The choice depends on whether you value certainty of fill or certainty of price more in a given situation.
How immediate or cancel orders fit into automated trading
In algorithmic strategies, IOC behavior often appears as a core primitive. A typical trading bot does not send "fire and forget" orders. Instead it evaluates current order books or on-chain quotes, sends IOC-like orders, then re-evaluates and resubmits if needed. This loop lets the system adapt to changing prices with tight risk control.
On centralized exchanges, APIs support IOC via explicit time-in-force settings. Bots construct a limit order with time-in-force set to IOC and a price that reflects the latest quote, possibly adjusted for fees and slippage. If the order fails to fill, the bot can try again with updated parameters.
On DEXs and aggregators IOC behavior is often tied to transaction-level guarantees. A bot can use routers, including CoW Swap or other aggregators, to request a trade with strict bounds. The protocol routes across liquidity sources like AMMs, order books, and market makers. If the required amount at the defined price is not available in the current block or batch, the trade is not executed.
Time-in-force, price triggers, and liquidity routing all matter here. Strategies may combine IOC orders with conditional triggers, such as "submit an IOC only when the spread tightens below a threshold" or "only trade when funding or basis makes an arbitrage profitable." The automated system treats IOC fill or cancel outcomes as signals to adjust size, direction, or routing.
Comparing immediate or cancel orders to other order types
IOC orders sit in a broader ecosystem that includes market, limit, fill or kill, good‑til‑canceled, and various conditional orders.
A market order tries to fill the entire size immediately, accepting whatever price the market offers within slippage settings. An IOC order also aims for immediate execution, but it will accept a partial fill and then cancel the rest.
A standard limit order with good‑til‑canceled or day time‑in‑force can remain open, waiting for liquidity to arrive at your price. It trades off immediate certainty for the chance of future execution. IOC orders remove that waiting period.
A fill or kill order is stricter than IOC. It must fill the entire size immediately or cancel the whole thing. IOC is more flexible because it allows partial fills.
Understanding these distinctions helps you choose the right tool. Use market orders when you must be in or out now and can tolerate some price slippage. Use resting limit orders when you are patient and want to provide liquidity. Use IOC when you want immediacy with price control and are comfortable with partial or zero fills.
Practical tips for using immediate or cancel orders effectively
Set realistic prices. If your limit price is far from the current market, your IOC order will cancel every time. In crypto this often means anchoring your price to the best bid or offer plus a small margin.
Watch liquidity and depth, not just last traded price. An IOC order that is larger than available depth at your price will only get a small partial fill. For larger trades, consider splitting orders or combining IOC with other strategies.
Manage gas and confirmation times on-chain. An IOC-style transaction that confirms late can experience price drift. Use appropriate gas settings for the urgency and size of your trade.
Log and analyze your outcomes. Track fill ratios, slippage, and cancellation rates. If most of your IOC orders fail, you may be using overly strict parameters or trading in illiquid pairs.
For beginners, start with small IOC sizes on liquid pairs to understand how often you get full, partial, or zero fills. For advanced users, integrate IOC logic into bots, hedging systems, or cross‑venue strategies, and test heavily in paper or sandbox environments before committing real capital.
Conclusion
An immediate or cancel order is a simple but powerful tool that demands immediate execution at your price and cancels anything the market cannot fill. It helps you control slippage, manage risk, and interact more intelligently with both centralized and decentralized liquidity.
Mastering IOC and other order types improves execution quality and avoids many common trading mistakes. Once you are comfortable with IOC behavior, it is worth exploring related tools like fill or kill, stop and conditional orders so you can tailor your execution to each market condition.
FAQ
What is an immediate or cancel (IOC) order?
An immediate or cancel order is an instruction to buy or sell that must fill right away at your specified price or better. Any part that cannot execute immediately is canceled. The key difference from other order types is that IOC never leaves any unfilled remainder waiting in the market.
When should I use IOC orders instead of regular market or limit orders?
IOC orders work best when you care about price and timing more than guaranteed full size. Use them when you need instant feedback on whether liquidity is available under strict conditions, want to probe order books without signaling future interest, or need to control execution during fast markets. They're particularly useful for trading bots and when you prefer to stay flat rather than chase the market.
What are the main advantages and disadvantages of IOC orders?
The main advantages are control over execution quality and reduced exposure to adverse selection since orders don't rest on the book. However, you may not get your full size or may not trade at all. In thin markets, IOC orders can result in frequent cancellations and missed opportunities, and you lose the benefit of earning maker rebates on some exchanges.
How do IOC orders work differently on centralized exchanges versus decentralized exchanges?
On centralized exchanges, IOC behavior is handled by the exchange's matching engine which checks the order book and cancels unfilled portions. On DEXs with order books, IOC orders use a time-in-force flag and smart contracts match trades within the same transaction. On AMM-style DEXs, IOC behavior is achieved through slippage and routing controls where transactions revert if liquidity constraints cannot be met.
What practical tips should I follow when using IOC orders?
Set realistic prices. If your limit price is far from the current market, your IOC order will cancel every time. In crypto this often means anchoring your price to the best bid or offer plus a small margin.
Watch liquidity and depth, not just last traded price. An IOC order that is larger than available depth at your price will only get a small partial fill. For larger trades, consider splitting orders or combining IOC with other strategies.
Manage gas and confirmation times on-chain. An IOC-style transaction that confirms late can experience price drift. Use appropriate gas settings for the urgency and size of your trade.
Log and analyze your outcomes. Track fill ratios, slippage, and cancellation rates. If most of your IOC orders fail, you may be using overly strict parameters or trading in illiquid pairs.
For beginners, start with small IOC sizes on liquid pairs to understand how often you get full, partial, or zero fills. For advanced users, integrate IOC logic into bots, hedging systems, or cross‑venue strategies, and test heavily in paper or sandbox environments before committing real capital.


