Immediate-or-cancel and fill-or-kill specify what happens when an order cannot be completed immediately under its conditions. IOC can accept a partial execution and end the remainder; FOK requires the whole quantity immediately or no execution. Neither instruction selects a suitable price or guarantees the response will reach your device.
Hypothetical stable order book, a buy limit of 50 and no other constraints. Actual matching depends on the product and current market.
BTKWIN.COM · EDUCATIONAL EXAMPLEStart with the limit and the time condition
Time in force is one part of an order. First identify the pair, direction, quantity and acceptable execution price. A limit purchase cannot use an offer above its limit simply because the time condition requires immediate processing. The instruction governs the treatment of otherwise eligible liquidity rather than expanding the price range you accepted.
The Binance.US explanation of time-in-force options describes IOC and FOK alongside GTC. Product availability can differ by market and interface. Confirm support for the particular order type and instruction together; a field accepted by one API or screen may be unavailable in another.
Example one: seven units meet a ten-unit request
Assume a hypothetical limit purchase requests ten units at a maximum price of 50. At processing time, four units are offered at 49, three at 50 and further units at 51. Treat the book as unchanged during this illustration and ignore fees initially. Only seven units qualify because the offers at 51 exceed the limit.
An IOC order can buy those seven eligible units: four times 49 is 196 and three times 50 is 150. Total execution value is 346 and the weighted average is 346 ÷ 7, approximately 49.4286. The other three requested units do not remain resting in the book. The result is a real seven-unit purchase, even if the final label mentions expiry or cancellation.
Under the same assumptions, FOK does not buy the seven and then reverse them when the rest is unavailable. Its full-quantity condition prevents a partial result for this request. If ten cannot be executed immediately within the conditions, the example ends with zero filled and no waiting remainder.
| Instruction | Requested | Eligible now | Filled in this example | Waiting afterward |
|---|---|---|---|---|
| IOC | 10 | 7 | 7 | 0 |
| FOK | 10 | 7 | 0 | 0 |
| GTC comparison | 10 | 7 | May fill 7 | May leave 3 |
Example two: the entire quantity spans two levels
Change only the hypothetical book: four units remain offered at 49, but six are now available at 50. Both IOC and FOK can fill all ten when the other requirements are met. Total value is 196 + 300 = 496 and the average execution price is 49.6, before commissions.
FOK’s completeness requirement does not mean the order must use one seller, one individual fill or one price level. Multiple eligible levels can provide its full quantity. However, a displayed book is not reserved for your future submission. Orders can trade or be canceled before processing, so the screenshot does not guarantee this result.
If no units qualify at 50 or below, both instructions can instead finish with zero executed. Distinguish the three IOC possibilities: no fill, partial fill and full fill. A terminal status by itself does not tell you which happened. Read the executed quantity and value before drawing a conclusion about your holdings.
Do not change two variables in a comparison
If you increase the limit from 50 to 51 while switching from IOC to FOK, the additional execution cannot be attributed to time in force alone. You also accepted a more expensive price. Educational comparisons should keep the pair, quantity, limit and hypothetical book fixed, while acknowledging that two live submissions cannot freeze the actual market between them.
Likewise, IOC is not automatically an unconstrained market order. The Upbit create-order reference documents supported combinations and time-in-force parameters for its products. Check current regional and order-type requirements instead of copying an option across interfaces. Precision, minimum order size and other filters still matter to whether a request is accepted.
Full execution and net receipt are different quantities
Return to ten units bought for 496. Assume a hypothetical fee of 0.1% charged in quote currency. The fee is 0.496 and total quote-currency spending becomes 496.496, while ten asset units are credited under this assumption. The execution quantity and inclusive spending describe different dimensions of the result.
If instead a hypothetical commission deducts 0.01 units of the purchased asset, net receipt is 9.99 even though the gross order quantity filled completely. FOK therefore does not, by its name alone, guarantee a particular net wallet receipt after every charge. Record the commission currency and actual balance movement.
A subsequent withdrawal has additional rules and potentially another fee. Use the transfer fee calculator to examine that step independently. Keep trading execution, net exchange credit and eventual wallet receipt as separate quantities so a downstream deduction is not mistaken for an unfilled portion of the original order.
Read terminal status together with fill records
Track status, cumulative executed quantity and the remaining active quantity. In the first IOC example, three units were not purchased, but they are no longer an active request. That differs from a GTC order still waiting for three. For the unsuccessful FOK example, no quantity filled and no part remains queued.
The Binance order-status definitions illustrate why expiry can describe an order that partially executed under its rules. Avoid translating every terminal label into zero execution. Unique fill identifiers and quantities provide clearer evidence of what traded.
When importing events, distinguish a new fill quantity from a cumulative total. An update showing four executed followed by one showing seven may mean seven overall, not eleven. Deduplicate by execution identifiers where available and preserve the field definitions in your record. Adding cumulative snapshots together inflates purchases and produces an incorrect remaining target.
Check before resending after a connection problem
A lost response does not establish a failed order. The server may have processed the request while the confirmation never reached the app. Look up its identifier and execution history before submitting another ten units. If the earlier IOC bought seven and the target is ten overall, the remaining target is three.
The same uncertainty applies to FOK: absence of a response does not prove zero execution, because the full quantity might have filled. Read the service’s client-identifier and duplicate-handling rules rather than assuming automatic prevention. Save order identifiers, pair, timestamps and results together to support reconciliation.
Choose the operational condition you actually require
Decide whether a partial quantity is useful for the task, how fees affect a later step and whether any unfilled amount should remain active. Then verify the supported combination, submit only the intended instruction and reconcile the final result before retrying. FOK describes completeness at processing, not faster internet or a faster confirmation.
For learning, begin with written examples or a documented test environment. The watchlist can monitor an asset without placing a real order, but watching its price does not demonstrate executable liquidity. The useful question after any attempt is concrete: how much filled, what did it cost, and what remains of the overall target?
Continue reading
English content and examples reviewed: 27 October 2026. Read the Arabic edition.