Sub topic 9
Time in Force: GTC, IOC, and FOK
Assume you already understand bids, asks, limit orders, market orders, and the basic order lifecycle. This chapter focuses on time in force, the rule that tells an exchange how long an order may remain active and what to do with any unfilled quantity.
Time in force does not predict the market. It controls the order's behavior when available liquidity does not match your request.
The three main policies
GTC: Good ’Til Canceled
A GTC order remains on the order book until it fills completely or you cancel it. An exchange may also cancel it during maintenance, at contract expiry, or under another exchange-specific rule.
For example, suppose the ask side contains:
| Price | Available quantity |
|---|---|
| 100.00 USDT | 2 BTC |
| 100.50 USDT | 3 BTC |
You submit a GTC limit buy for 4 BTC at 100.50 USDT. The order immediately buys 2 BTC at 100.00 and 2 BTC at 100.50. If only 2 BTC were available at prices up to your limit, the remaining 2 BTC would rest as a bid. Later sellers could fill it.
GTC is useful when price matters more than immediate completion. Its risk is that the order can remain active after your trading idea is no longer valid. A stale order may fill during a later price move.
IOC: Immediate or Cancel
An IOC order must execute immediately against the liquidity currently available. Any quantity that cannot fill at once is canceled.
An IOC limit buy for 4 BTC at 100.50 USDT would consume up to 4 BTC at prices of 100.50 or lower. If only 2 BTC qualified, it would fill 2 BTC and cancel the remaining 2 BTC. This is called a partial fill.
IOC is useful when you want available liquidity now but do not want an order waiting on the book. It can reduce the risk of stale orders, but it does not guarantee that the full quantity will execute.
FOK: Fill or Kill
A FOK order must execute its entire quantity immediately, or the exchange cancels the entire order. It allows no partial fill.
Using the same book, a FOK buy for 4 BTC at 100.50 USDT succeeds only if at least 4 BTC are available at or below that price at the matching moment. If only 3 BTC qualify, none of the order fills.
FOK is useful when a partial position would be unacceptable. The trade-off is a higher chance of no execution, especially in a thin or rapidly changing market.
How the policies differ
| Policy | Must execute immediately? | Allows partial fill? | Can remain on book? |
|---|---|---|---|
| GTC | No | Yes | Yes |
| IOC | Yes | Yes | No |
| FOK | Yes | No | No |
The matching engine checks the order book when it receives the order. For a limit order, it first matches eligible prices. If quantity remains, the time-in-force rule determines whether that remainder rests, disappears, or causes the whole order to fail.
Choosing among GTC, IOC, and FOK
Choose GTC when you have a target price and can wait. Choose IOC when you want to take whatever qualifying liquidity exists now without leaving an order behind. Choose FOK when the trade has value only if the entire quantity executes immediately.
Before submitting, check the order's remaining quantity, price limit, and status. A successful submission does not necessarily mean a full fill. The exchange may report statuses such as partially_filled, filled, canceled, or expired.
Exercise
You need to buy 10 ETH at no more than 2,000 USDT each. You will accept 6 ETH now but do not want the remaining 4 ETH to rest on the book. Which time-in-force policy fits?
Show answer
IOC. It can fill the available 6 ETH immediately and cancel the remaining 4 ETH.