|
| 1 | +`PendingOrder::quantity_request` separates an exit's original requested amount |
| 2 | +from the numeric reservation made for that request. It replaces two stored |
| 3 | +booleans that mixed those lifetimes. |
| 4 | + |
| 5 | +`QuantityIntent` contains exactly one of `Units(amount)`, |
| 6 | +`Fraction(numerator, denominator)` or `All`. Fractional requests retain their |
| 7 | +original representation; the Pine boundary supplies percentages as `P / 100` |
| 8 | +without a floating-point divide/multiply round trip. An absent request belongs |
| 9 | +to pending commands outside this exit-request contract. These are request |
| 10 | +descriptors, not an additional numerical-admission policy. |
| 11 | + |
| 12 | +`QuantityReservation` records admitted units and the exposure basis used when |
| 13 | +reserving them. A new request clears the old reservation; a reservation cannot |
| 14 | +exist without an original request. Deferred exits acquire this receipt when a |
| 15 | +live owner is bound. Additional per-entry bindings copy the original request |
| 16 | +and record their own admitted amount and basis. Copying is by value. |
| 17 | + |
| 18 | +`qty` and `qty_percent` retain their current executable/reserved meaning in the |
| 19 | +existing order paths. OCA can reduce executable quantity without changing |
| 20 | +the original intent or its prior reservation receipt. Whether that receipt |
| 21 | +covered less than its basis is a derived numerical comparison, using the |
| 22 | +existing caller-supplied tolerances. A deferred fraction can be classified |
| 23 | +before resolution; an unbound Units request cannot infer coverage without a |
| 24 | +numeric basis. |
| 25 | + |
| 26 | +Consequently, a half-position request rounded to a minimum one-unit slot may |
| 27 | +have `Fraction(50, 100)` intent and a full `1 / 1` reservation. Conversely an |
| 28 | +`All` request clipped behind another reservation may hold only `3 / 4` of its |
| 29 | +basis. Neither case can be represented correctly by one “partial” label. |
| 30 | + |
| 31 | +Deferred market-close instructions are another producer: `strategy.close` |
| 32 | +has already resolved its source amount to a placement target before |
| 33 | +`queue_deferred_close_order` runs. The request records that resolved source |
| 34 | +target as `Units(qty_to_close)`, without an exposure reservation until a later |
| 35 | +layered binding occurs. This is not a fixed executable-quantity promise: the |
| 36 | +preserved Pine ANY-relative rule can turn target 1 on E2 into reservation 2 |
| 37 | +with basis E4 after reversal. The initial target remains 1 while executable |
| 38 | +`qty` and the later reservation are 2. It does not claim to retain the original |
| 39 | +Pine percentage expression; that conversion already occurred. This preserves |
| 40 | +the old initial nonpartial classification without fabricating a basis. |
| 41 | + |
| 42 | +The Pine percentage rounding, minimum-slot, reservation retention, one-shot |
| 43 | +exit-ID and deferred/replacement policies remain explicit compatibility debt |
| 44 | +in their existing callers. This change does not generalize those policies or |
| 45 | +change their thresholds, financial assertions or execution order. |
| 46 | + |
| 47 | +The public `pf_pending_order_v1_t` retains its complete existing field prefix. |
| 48 | +Its `requested_partial` and `full_percent_exit_request` fields are deprecated |
| 49 | +read-only projections derived from the new authoritative values; native |
| 50 | +decisions never read those output fields. New fields append: |
| 51 | + |
| 52 | +- `quantity_intent_kind`: 0 absent, 1 Units, 2 Fraction, 3 All. |
| 53 | +- The relevant units or fraction numerator/denominator; inactive values are 0. |
| 54 | +- Reservation presence, admitted units and basis units. |
| 55 | + |
| 56 | +All new facts and optional-presence discriminators participate in broker |
| 57 | +hashing and mirror output. They are not waived. C ABI version 4 and stream |
| 58 | +API version 1 remain unchanged, and size-limited mirror reads preserve older |
| 59 | +callers. The internal C++ layout changes, so all consumers require a matching |
| 60 | +rebuild and the integrated representation change requires a new internal |
| 61 | +namespace/fingerprint epoch before publication. |
0 commit comments