Glossary

Fill or Kill (FOK)

Fill or kill is an order instruction requiring the entire order to be filled immediately and completely, or cancelled entirely.

Key Takeaways

  • Fill or kill (FOK) is a time-in-force instruction that demands the entire order be executed immediately at a specified price or better: if the full quantity cannot be filled at once, the order is cancelled with no partial execution.
  • FOK combines two constraints: the all-or-nothing requirement of an all-or-none order and the immediacy of an immediate-or-cancel order. This makes it the strictest standard order type used in both traditional and high-frequency trading.
  • In crypto markets, FOK semantics appear in OTC desk request-for-quote workflows, centralized exchange APIs, and decentralized protocols where atomic on-chain execution guarantees all-or-nothing settlement by default.

What Is Fill or Kill?

Fill or kill (FOK) is an order instruction used in financial markets that requires the entire order to be executed immediately and completely at a specified price or better. If the market cannot satisfy the full quantity in a single matching attempt, the order is cancelled entirely: no partial fills occur, and no portion of the order remains resting on the book.

The instruction originated in traditional equities and derivatives markets, where it is encoded as value 4 in the FIX protocol's TimeInForce field (Tag 59). FOK is classified as a time-in-force modifier rather than a standalone order type: it can be applied to limit orders, and on some venues to market orders, dictating how long the order remains active and what happens when it cannot be fully matched.

In practice, FOK orders are relatively rare compared to other time-in-force instructions like day orders or good-til-cancelled (GTC). They serve a specific purpose: ensuring that a trader either gets exactly the position they want or stays flat, with no in-between state.

How It Works

When a trader submits a fill-or-kill order, the matching engine evaluates whether sufficient liquidity exists at the limit price or better to satisfy the full order quantity. This evaluation happens in a single pass:

  1. The trader submits an order with a quantity, a limit price, and FOK as the time-in-force
  2. The matching engine checks the opposite side of the order book for available liquidity at the specified price or better
  3. If enough resting orders exist to fill the entire quantity, the engine executes the trade against those orders in a single match cycle
  4. If insufficient liquidity exists at the required price, the engine cancels the order immediately with no execution

The entire process completes in microseconds on modern electronic exchanges. The order never rests on the book, never appears in the public market depth, and never leaks information about the trader's intent if cancelled.

FIX Protocol Encoding

In the FIX (Financial Information eXchange) protocol used across most institutional trading venues, FOK is specified in the TimeInForce field:

// FIX Protocol Tag 59 (TimeInForce) values
0 = Day
1 = Good Till Cancel (GTC)
2 = At the Opening
3 = Immediate or Cancel (IOC)
4 = Fill or Kill (FOK)
6 = Good Till Date

A new order single message (MsgType=D) with Tag 59=4 instructs the venue to apply FOK semantics. Some venues implement FOK as a synthetic instruction: CME Group, for example, treats FOK as an immediate-or-cancel order where the minimum quantity (Tag 110) equals the total order quantity, achieving the same all-or-nothing behavior.

FOK is often confused with similar time-in-force instructions. The key differences come down to two dimensions: whether partial fills are allowed and whether the order can wait for liquidity.

Order TypePartial FillsImmediate ExecutionRests on Book
Fill or Kill (FOK)NoYesNo
Immediate or Cancel (IOC)YesYesNo
All or None (AON)NoNoYes
Good Till Cancelled (GTC)YesNoYes

FOK is sometimes described as the combination of IOC and AON: it demands both immediacy and completeness. An IOC order will take whatever liquidity is available and cancel the remainder. An AON order insists on full fills but can rest on the book and wait. FOK accepts neither compromise.

Use Cases

Large Block Trades

Institutional traders executing large positions often use FOK to avoid the risk of partial fills. A fund manager buying 50,000 shares to rebalance a portfolio needs the complete position: receiving only 30,000 shares would leave the portfolio misaligned. FOK ensures the trade either establishes the full position or leaves the portfolio unchanged.

When FOK orders fail due to insufficient book depth, traders typically turn to OTC desks or dark pools, where counterparties can source the full block without exposing order flow to the public market.

High-Frequency and Algorithmic Trading

High-frequency trading systems use FOK orders to capture fleeting arbitrage opportunities across venues. When a pricing discrepancy appears for milliseconds, the algorithm submits FOK orders simultaneously to multiple venues. The all-or-nothing constraint ensures each leg of the arbitrage either fills completely or not at all, avoiding the scenario where one leg executes but the other fails, leaving the firm with unwanted directional exposure.

Algorithmic trading strategies also use FOK when testing market depth: a rapid FOK probe reveals whether sufficient liquidity exists at a given price level without leaving any market footprint.

OTC and Request-for-Quote Workflows

Request-for-quote (RFQ) workflows on OTC desks operate with implicit FOK semantics. A client requests a price for a specific quantity, the desk quotes a firm price, and the client accepts or rejects. If accepted, the trade executes at the quoted price for the full quantity: there is no partial fill scenario. This matches the FOK model even when the term is not explicitly used.

In crypto markets, platforms like Paradigm and institutional OTC desks at major exchanges operate this way, quoting firm prices on large crypto derivatives blocks that execute as fill-or-kill.

Crypto Exchange Support

Major centralized crypto exchanges including Bitfinex and others support FOK as a time-in-force option on their trading APIs. Traders specify FOK alongside their limit price and quantity, and the matching engine applies the same all-or-nothing logic used in traditional markets:

// Example: FOK order via exchange REST API
{
  "symbol": "BTC-USD",
  "side": "buy",
  "type": "limit",
  "price": "67500.00",
  "quantity": "10.0",
  "timeInForce": "FOK"
}

If the exchange cannot fill all 10 BTC at $67,500 or better in a single match cycle, the order is rejected and the trader's balance remains unchanged.

FOK Semantics in Decentralized Markets

Decentralized exchanges and intent-based trading systems implement fill-or-kill guarantees through a fundamentally different mechanism: atomic on-chain execution. Rather than relying on a matching engine's time-in-force logic, the blockchain's transaction model provides the all-or-nothing guarantee natively.

Atomic Execution on DEXs

On automated market makers and DEX aggregators, a swap transaction either completes fully or reverts entirely. If the trade would result in slippage beyond the user's tolerance, the smart contract reverts, and the user retains all their tokens minus the gas fee. This provides FOK-equivalent behavior at the protocol level.

Smart order routers split large trades across multiple liquidity sources and execute the splits atomically within a single transaction. Each leg either fills at the expected rate or the entire transaction reverts: no partial state remains.

Intent-Based Systems and Solver Competition

Intent solvers and protocols like CoW Protocol take the FOK concept further. A user signs an off-chain intent specifying the asset, quantity, and minimum acceptable price. Solvers compete to fill the order, and the winning solver executes the trade atomically against their own inventory or through optimized routing. The user either receives the full fill at or above their specified price, or the intent expires unfilled.

This model provides FOK semantics without the information leakage of placing an order on a public book, combining the privacy advantages of dark pools with the all-or-nothing execution guarantee of FOK.

Why It Matters

Fill or kill addresses a fundamental problem in trading: market microstructure risk from incomplete execution. When a trader needs a specific position size, partial fills create operational complexity: tracking multiple fill fragments, managing residual orders, and dealing with the risk that unfilled portions execute at worse prices as the market moves.

For payment and settlement systems, the FOK principle maps to atomic settlement: a transfer either completes in full or does not happen at all. Bitcoin's UTXO model and Layer 2 protocols like Spark enforce this by design. A transaction is either valid and included, or it is not: there is no partial payment state. This all-or-nothing guarantee is what makes payment finality on blockchains fundamentally different from traditional settlement, where partial failures and reconciliation gaps are common.

Risks and Considerations

High Cancellation Rate

The strictness of FOK means many orders are cancelled without execution, especially for large orders in illiquid markets. If the bid-ask spread is wide or depth is thin, the matching engine consistently fails to find enough resting liquidity. Traders relying heavily on FOK may find that their execution rate drops significantly, forcing them to switch to IOC orders or negotiate block trades through OTC channels.

Information Leakage and Gaming

While FOK orders do not rest on the book, repeated FOK submissions and cancellations can reveal a trader's intent to sophisticated market makers monitoring order flow. A series of large FOK orders at the same price level signals demand, potentially causing market makers to widen spreads or adjust their quotes before the trader can execute.

Venue-Specific Behavior

Implementation varies across exchanges. Some venues match FOK orders only at a single price level, while others will sweep multiple price levels as long as the full quantity fills. Some exchanges implement FOK as a synthetic instruction (IOC with minimum quantity equal to total quantity) rather than a native order type. Traders should verify their venue's specific behavior, especially when executing strategies that depend on precise FOK semantics.

Gas Risk on DEXs

On decentralized exchanges, the FOK-like revert mechanism protects the trade amount but not the transaction fee. A reverted swap still costs gas, and in volatile markets or during congestion, repeated reverts can accumulate significant costs without any successful execution.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.