🔍 Introduction: What Is an IOC Order?
An IOC (Immediate-or-Cancel) order is a type of order that requires immediate execution of the entire order. Any portion of the order that cannot be filled immediately is canceled. Unlike a market order, which may leave an unfilled portion in the order book, an IOC order ensures that you do not have any residual order sitting in the book.
IOC orders are used by traders who need immediate execution and do not want to leave any unfilled portion in the order book. They are often used to test liquidity, execute large orders quickly, or to avoid partial fills.
IOC orders can be partially filled. If only part of your order is filled immediately, the unfilled portion is canceled. You may not get your desired position size.
⚙️ How an IOC Order Works
When you place an IOC order, the exchange attempts to fill it immediately at the best available price. Any portion that cannot be filled is immediately canceled. The order does not remain in the order book.
Example: You place an IOC order to buy 10 BTC. The order book has:
- 5 BTC available at $60,000
- 3 BTC available at $60,010
- 2 BTC available at $60,020
Your order will fill 5 BTC at $60,000, 3 BTC at $60,010, and 2 BTC at $60,020. The full order is filled. If only 8 BTC were available, 8 BTC would fill, and the remaining 2 BTC would be canceled.
IOC orders can be placed as either limit IOC (with a limit price) or market IOC (executed at the best available price).
Use a limit IOC order if you want to control the maximum price you're willing to pay (for buys) or the minimum price you'll accept (for sells).
✅ When to Use an IOC Order
IOC orders are ideal in the following scenarios:
IOC orders are useful for testing market depth without leaving a limit order that could be filled later.
When you need to buy or sell a large amount quickly, IOC ensures you get immediate execution without leaving a residual order.
If you don't want to hold a partial position, IOC ensures you either get the full fill or nothing remains.
IOC orders allow scalpers to enter and exit positions quickly without leaving open orders.
Use IOC orders when you are unsure about market liquidity and want to avoid having an unfilled order sitting in the book.
⚖️ IOC vs. Market vs. Limit vs. FOK Orders
Understanding the differences between these order types is essential:
| Feature | IOC | Market | Limit | FOK |
|---|---|---|---|---|
| Execution | Immediate (partial fill allowed) | Immediate | When limit price is reached | Immediate (all or none) |
| Unfilled Portion | Canceled | Remains (partial fill possible) | Remains in order book | Canceled (if not fully filled) |
| Price Control | Yes (with limit IOC) | No | Yes | Yes (with limit FOK) |
| Best For | Testing liquidity, fast execution | Urgent trades | Price control & saving fees | Full fill requirement |
Use IOC when you need immediate execution but are okay with partial fills. Use FOK (Fill-or-Kill) when you require the entire order to be filled.
⚖️ IOC vs. FOK (Fill-or-Kill)
IOC and FOK orders are often confused. Here's the key difference:
| Feature | IOC | FOK |
|---|---|---|
| Definition | Immediate-or-Cancel | Fill-or-Kill |
| Partial Fill | Allowed (unfilled portion canceled) | Not allowed (entire order must fill or it's all canceled) |
| Best For | Testing liquidity, partial execution acceptable | When you need the full order size |
| Price Control | Yes (if limit IOC) | Yes (if limit FOK) |
Choose FOK if you require the exact order size. Choose IOC if you are okay with a partial fill and want the rest canceled.
⚠️ Risks of Using IOC Orders
While IOC orders are useful, they come with some risks:
- Partial Fill: Your order may only be partially filled, leaving you with a smaller position than intended.
- Worse Average Price: In low-liquidity markets, the order may fill at multiple price levels, resulting in a higher average price (for buys) or lower average price (for sells).
- Missed Opportunities: If the market moves quickly, your IOC order may be canceled, and you may miss the trade.
- Not Suitable for Large Orders: In markets with low liquidity, large IOC orders may only fill a small portion.
You place an IOC order to buy 10 BTC at a limit price of $60,100. Only 5 BTC are available at your limit price. The order fills 5 BTC, and the remaining 5 BTC is canceled. You end up with a smaller position than expected.
📝 How to Set Up an IOC Order
Follow these steps to place an IOC order on most exchanges:
-
1
Choose your trading pair
Select the asset you want to trade (e.g., BTC/USDT).
-
2
Select order type
In the order entry panel, choose "IOC" or "Immediate-or-Cancel" as the order type.
-
3
Set your limit price (optional)
If using a limit IOC, enter the maximum price you're willing to pay (buy) or the minimum price you'll accept (sell).
-
4
Enter the amount
Specify the quantity you want to trade.
-
5
Review and place the order
Double-check your settings and click "Buy" or "Sell" to place the IOC order.
If you are using IOC with a limit price, ensure your limit price is realistic to avoid the entire order being canceled.
✅ Best Practices for IOC Orders
- Check order book depth: Before placing an IOC order, check the order book to estimate how much will fill.
- Use limit IOC for price control: If you care about the price, use a limit IOC order to cap your execution price.
- Avoid IOC during low liquidity: In low-liquidity markets, IOC orders may fill at unfavorable prices.
- Combine with other orders: Use IOC to test liquidity, then place a limit order for the remaining amount if needed.
- Monitor fill status: Check the fill status of your IOC order to know how much was executed.
IOC orders are powerful tools for immediate execution and liquidity testing. Use them wisely, and always consider the trade-off between speed and price control.