Order Quantity Models
| Model | Meaning | Behavior |
|---|---|---|
| Modern (Default) | Quantity = max total fill | Send same total each time (e.g. 100 → fill 25 → replace 100 = 25 filled / 75 remaining) |
| Traditional | Quantity = remaining | Replace sets remaining directly (e.g. 100 → fill 25 → replace 75); subscriber tracks state |
| Cancel-on-Fill | No persistent quantity | Any fill cancels the order; new order required for additional quantity |
OpenYield supports two interpretations of quantity on order updates. The distinction is whether quantity represents the total intended fill, or the currently remaining (displayed) size.
In the modern model (default), quantity represents the maximum total quantity to be filled over the lifetime of the order. Fills accumulate against this maximum value. For example, an order created with 100 that receives a 25 fill will have 75 remaining; a replace with 100 preserves this state (25 filled, 75 remaining). The same total quantity is expected on replaces unless the intended maximum changes. This model avoids the need to track remaining quantity client-side and behaves consistently under latency. This is what is used in Equity, Futures, Options and FX markets where the market is low-latency and firm, just like OpenYield.
In the traditional model, quantity represents the current remaining (or displayed) size. Replace requests set the remaining quantity directly, and filled quantity is inferred. Using the same example, after a 25 fill the replace would carry 75. This requires the subscriber to track remaining quantity. Because of latency differences, OpenYield uses a rules-based model to deal with additional fills while waiting for the new replaced quantity. There exists a very rare scenario under which cumulative quantity may exceed the order quantity and remaining quantity may become negative if the new quantity is below previously filled amounts (usually caise by a latency race condition).
Some subscribers prefer cancel-on-fill, where any fill cancels the order and a new order needs to be submitted if additional quantity is desired. This removes the need to maintain order state, but reduces continuity and may result in missed executions.
In summary, the modern model treats quantity as total intended size, while the traditional model treats it as current remaining size (and provides best effort under latency differences). Cancel-on-fill avoids state entirely by terminating the order on each fill.