Skip to content

Time in force explained: GTC, IOC, FOK and post-only

Team Hippo · PUBLISHED · 4 MIN READ

Time in force decides how long an order stays live, and what happens to the part that does not fill straight away. Good-til-cancelled (GTC) rests until it fills or you cancel it. Immediate-or-cancel (IOC) takes what it can at once and drops the rest. Fill-or-kill (FOK) fills completely at once or not at all. Post-only only ever rests on the book.

Choosing the setting is part of choosing the order. This guide works each option against the same order book. Examples use illustrative prices.

The sample order book

All examples below use this BTC book. Asks are sell orders waiting above the price; bids are buy orders waiting below.

Side Price Quantity
Ask $60,050.00 0.5 BTC
Ask $60,020.00 0.3 BTC
Ask $60,010.00 0.2 BTC
Bid $60,000.00 0.4 BTC
Bid $59,990.00 0.6 BTC

The best ask is $60,010.00 and the best bid is $60,000.00. The spread is $10.00. For more on reading this layout, see how to read an order book.

GTC: good-til-cancelled

A GTC order stays on the book until it fills completely or you cancel it. It can rest for minutes, days or weeks.

Example. A limit buy for 0.5 BTC at $59,950.00. No one is selling that low, so nothing fills. The order rests on the bid side below $59,990.00. If sellers later reach $59,950.00, it fills, possibly in pieces over time.

GTC suits orders where the price matters more than the timing. The risk is forgetting about it. A resting order from last week can fill today, in conditions you are no longer watching.

IOC: immediate-or-cancel

An IOC order fills whatever it can immediately, at its limit price or better, and cancels the rest. It never rests on the book.

Example. A limit buy for 0.6 BTC at $60,020.00, IOC.

  1. It takes 0.2 BTC at $60,010.00.
  2. It takes 0.3 BTC at $60,020.00.
  3. The next ask is $60,050.00, above the limit. The remaining 0.1 BTC is cancelled.

Filled: 0.2 + 0.3 = 0.5 BTC. Cancelled: 0.6 − 0.5 = 0.1 BTC.

Average price: (0.2 × $60,010.00 + 0.3 × $60,020.00) ÷ 0.5 = ($12,002.00 + $18,006.00) ÷ 0.5 = $30,008.00 ÷ 0.5 = $60,016.00.

IOC suits traders who want a quick fill with a price cap, and who accept a partial fill. Market orders on many venues behave like IOC by default.

FOK: fill-or-kill

A FOK order must fill in full, immediately, at its limit price or better. If the whole quantity is not available, nothing fills.

Example 1. A limit buy for 0.6 BTC at $60,020.00, FOK. Only 0.5 BTC is available at $60,020.00 or better. The order cannot fill completely, so it is killed. Nothing trades.

Example 2. A limit buy for 0.5 BTC at $60,020.00, FOK. Exactly 0.5 BTC is available (0.2 + 0.3). It fills in full at the same $60,016.00 average as above.

FOK suits cases where a partial fill is worse than no fill. One example is one leg of a two-part trade, where half a position would leave unwanted exposure.

Post-only

A post-only order is a limit order that must rest on the book as a maker order. If it would match immediately, it is cancelled instead of filling as a taker.

Example 1. A post-only buy for 0.3 BTC at $60,010.00. That price meets the best ask, so it would fill at once. The venue rejects it. Some venues instead reprice it to just below the best ask; this varies by venue.

Example 2. A post-only buy for 0.3 BTC at $60,005.00. Nothing is offered at that price or lower, so it rests. It becomes the new best bid, inside the old spread.

Traders use post-only to make sure an order pays the maker fee rather than the taker fee. See maker vs taker fees for why that matters.

GTD: good-til-date

Where offered, a GTD order works like GTC but expires at a time you set. For example, a limit buy at $59,950.00 set to expire at 18:00 UTC rests until then, and is cancelled automatically if unfilled.

GTD suits orders tied to a time window, such as a level you only care about for one session. Not every venue offers it. Check your venue’s order form.

Side by side

Setting Rests on book? Partial fill allowed? Unfilled part Typical use
GTC Yes Yes Stays live until cancelled Price matters more than timing
GTD Yes, until expiry Yes Cancelled at the set time Time-limited resting order
IOC No Yes Cancelled at once Quick fill with a price cap
FOK No No Whole order cancelled All-or-nothing fills
Post-only Yes Yes, once resting Stays live (as GTC on most venues) Making sure of the maker fee

How time in force combines with order type

Time in force is a setting on an order, not an order type by itself. The common combinations:

  • Limit + GTC: the standard resting limit order.
  • Limit + IOC or FOK: a limit price with no resting.
  • Market: usually treated as IOC; it takes what is available and cancels the rest.
  • Stop or stop-limit: the trigger waits, then the resulting order follows its own time in force once placed.

For the order types themselves, see market, limit, stop and stop-limit orders explained.

Common mistakes

  • Using IOC in a thin book and missing the partial fill. Check the filled quantity, not just the order status.
  • Expecting FOK to fill gradually. It never rests. If the size is not there now, it is gone.
  • Post-only rejections in fast markets. When the price moves toward your limit, a post-only order can be rejected repeatedly.
  • Stale GTC orders. Review resting orders before stepping away for a long period.

Every IOC example above is a small case of slippage: the average fill sat above the best ask. For derivatives exits, read take-profit and stop-loss orders on perpetuals.

Frequently asked questions

What is the difference between IOC and FOK?

Both act immediately and never rest on the book. An immediate-or-cancel order fills whatever quantity is available at its price or better and cancels the remainder. A fill-or-kill order fills only if the whole quantity is available at once; otherwise nothing fills.

What does post-only mean?

A post-only order is a limit order that must rest on the book as a maker order. If it would match an existing order the moment it arrives, the venue cancels it, or on some venues reprices it, instead of letting it fill as a taker.

Is GTC the default time in force?

On many venues a plain limit order defaults to good-til-cancelled, while market orders behave like immediate-or-cancel. Defaults and available options vary by venue, so check the order form.

Do GTC orders ever expire?

A GTC order is meant to stay live until it fills or is cancelled. Some venues still set a maximum lifetime, or cancel resting orders during maintenance or contract changes. Check your venue's rules.

Hippo provides information, not investment advice.

NEWSLETTER

Conversational trading, in your inbox

New guides and research from Team Hippo. No spam; unsubscribe from any email.

By subscribing you agree to receive emails from Ask the Hippo.

Trading concepts, explained · 4 MIN

Isolated vs cross margin, explained with examples

How isolated and cross margin work on perpetual futures, how a loss on one position affects each mode, and the trade-offs between them, with a worked example.