Immediate does not mean one price level

For an illustrative purchase of 25 shares, suppose 5 are offered at 0.37 and 20 at 0.40. Total cost is 9.85 and the average is 0.394. The first row’s 0.37 does not describe the cost of the full quantity.

This practice book is unchanged and excludes expenses. Offers disappearing between estimation and matching change the result. Record the preliminary calculation separately from actual fills rather than treating a pre-execution number as evidence that the entire operation has completed.

FAK and FOK handle insufficient quantity differently

FAK fills available interest and cancels the remainder. FOK requires immediate full execution or no fill. The distinction concerns whether a partial result is acceptable; it says nothing about which event outcome will eventually be correct after resolution.

Suppose a practice request covers 25 shares while suitable interest totals only 15. A FAK result can contain a filled portion and canceled remainder; FOK requires the complete quantity. A rejection does not represent acquiring the missing shares or a position of 25.

Price boundaries and estimate freshness

A maximum buy price and minimum sell price constrain acceptable levels. A changing book can then cause partial execution or no execution. Price protection cannot create opposing interest that is absent within the permitted range of the current book.

Compare estimate time, price boundary and actual filled prices when interpreting the result. Do not label every difference from the first row a fee: several consumed levels, changes in the book or both can explain the average-price difference.

Buying amount versus selling shares

In the current SDK, a market-buy amount represents currency notional while a sell quantity is expressed in shares. When reading an API example, retain the units instead of transferring a number between fields. The same 10 can describe different operations.

Record resulting quantity, cost, expenses and unconfirmed portions separately. Continue with limit orders and liquidity: they explain alternative execution conditions without claiming which approach is appropriate for a particular reader or predicting the outcome of any subsequent transaction.

FAQ /

Common questions

Does FAK leave the remainder in the book?

No. Any remainder after available immediate execution is canceled. Do not confuse that remainder with an active GTC order.

Does a market order guarantee a fill?

No. Suitable liquidity, current price constraints and an accepted request are required. Actual fills establish the resulting execution.