TradeViora AcademyLearn. Analyze. Practice. Trade Smarter.
Menu

FREE FINANCIAL EDUCATION

Immediate-or-cancel versus fill-or-kill

Calculate different fill outcomes under IOC and FOK instructions.

Learning objectives

  • Calculate different fill outcomes under IOC and FOK instructions.
  • Separate price eligibility from whole-order execution conditions.

Prerequisites: Understand limit prices and available quantity at multiple levels.

Mechanism and interpretation

An immediate-or-cancel instruction permits an immediate partial execution and cancels the unfilled remainder. A fill-or-kill instruction requires the entire order to execute immediately or the order receives no execution. Both can be combined with a price limit, so available quantity outside that limit does not satisfy the instruction. Exact routing and atomic evaluation remain venue-specific.

These instructions express different preferences about partial exposure. An IOC can leave a useful partial position or an unwanted hedge mismatch. A FOK can avoid that partial state but miss an opportunity when available eligible size is insufficient. Neither instruction guarantees that the snapshot seen before submission still represents liquidity at arrival. Evaluate the instruction against the arrival book and matching rules.

Worked case · synthetic data

A synthetic ask book contains 40 units at 100.00 and 30 at 100.05, with more at 100.10. A buy 80 capped at 100.05 has only 70 eligible units. IOC fills 70 and cancels 10 under the stated instantaneous book; weighted fill price=(40×100+30×100.05)/70≈100.0214. FOK 80 receives zero. A FOK 60 could fill 40 at 100 and 20 at 100.05 if the venue can satisfy the whole quantity atomically.

Failure modes and context

Hidden liquidity or routing can change eligible quantity, but cannot be assumed from a displayed snapshot. Minimum-quantity conditions are not always equivalent to FOK. Repeatedly probing with orders can create costs and information leakage. For multi-leg positions, an all-or-nothing instruction on one leg does not automatically make the entire strategy atomic across markets.

Practice assignment

Available asks are 25 at 50.00,35 at 50.02 and 50 at 50.05. Compare IOC 70 and FOK 70 with cap 50.02. Calculate IOC quantity, remainder and weighted price. Does the 50.05 quantity help satisfy either capped order?

Worked answer

Eligible quantity 60. IOC fills 60, cancels 10, and averages(25×50+35×50.02)/60≈50.011667. FOK 70 fills zero. The 50.05 offers exceed the 50.02 cap and cannot satisfy either order under these instructions. The calculations assume the stated book survives until arrival and there is no additional eligible hidden or routed liquidity.

Check your understanding

Question 1

What does IOC do with an immediate unfilled remainder?

  1. Cancels it
  2. Leaves it indefinitely
  3. Converts it to guaranteed profit
Reveal answer and reasoning

A. Cancels it

Immediate-or-cancel permits a partial fill and removes the rest.

Question 2

What does case FOK 80 execute with only 70 eligible?

  1. 70
  2. 80 at any price
  3. Zero
Reveal answer and reasoning

C. Zero

The entire quantity must be available within the order’s conditions.

Question 3

Can quantity above the buy cap count?

  1. Only if the order is large
  2. No, it is price-ineligible
  3. Yes, FOK ignores limits
Reveal answer and reasoning

B. No, it is price-ineligible

Time-in-force conditions do not remove the declared price constraint.

Sources and further reading

The explanations, operational rules, numerical cases and questions on this page are original TradeViora Academy educational material. Source documents support definitions or conventions; they do not establish the profitability of an illustrated rule.

Third-party rights remain with their owners. TradeViora Academy is not affiliated with these organizations. Examples are hypothetical and exclude real orders. Source review: 26 November 2026.

Continue learning

Open related learning tools · Practice library · Learning downloads