# Gross vs Net Intraday Pre-Trade Credit & Open-Order Math

> Exact pre-trade credit state-machine math for DMA brokers: worst-case directional open-order exposure, 35=G in-flight locks, and reduce-only gates.

Canonical: https://terminalledgerdesk.com/reports/gross-vs-net-intraday-credit-exposure-accounting-pending-order-var
Last updated: 2026-11-14T19:41:26.857Z

**Publication:** Terminal Ledger Desk
**Category:** Mifid Rts6 Pretrade Kill Switch Controls
**Published:** 2026-11-13T15:40:25.915Z
**Author:** Marcus Thorne, CQF (Certificate in Quantitative Finance (CQF), Low-Latency FIX & Matching Engine Architect)
**Reviewer:** Not recorded

## Answer-first summary

Counting only filled trades toward intraday credit limits invites clearing insolvency; counting naive sums of bids and offers starves market makers. Learn exact worst-case directional and in-flight 35=G credit accounting.

## Key takeaways

- Per-symbol worst-case directional exposure MAX(|Pos + OpenBuys|, |Pos - OpenSells|) captures exact physical sweep risk without double-penalizing two-sided market makers.
- Never release open-order credit when a client transmits Cancel (35=F); wait strictly for exchange confirmation (39=4 Canceled) so lost cancel races cannot multiply leverage.
- During Pending Replace (35=G), reserve MAX(Old_Exposure, New_Exposure) rather than Old + New to prevent artificial credit exhaustion.
- Always implement a verified Reduce-Only liquidation gate (Open_Same_Side + New_Qty <= |Pos|) so breached accounts can flatten risk safely.

## Related financial entities

- **Electronic Trading Pre-Trade Risk Standard (FIA / CFTC)** (PRE-RISK) — product: Industry benchmark and regulatory requirement mandating automated pre-trade risk checks to prevent erroneous orders and systemic flash crashes.
- **Financial Information eXchange (FIX) Protocol Standard** (FIX-STANDARD) — product: Universal electronic messaging standard that facilitates real-time communication of securities transactions and market data across global financial institutions.
- **Unified Multi-Asset Clearing Engine Standard** (UNIFIED-MARGIN) — product: Universal clearing engine that aggregates distinct financial asset classes into a single real-time valuation, netting collateral and exposures simultaneously.

## Analysis

Getting intraday pre-trade credit arithmetic wrong destroys a brokerage in one of two opposite ways: **under-counting** open unexecuted orders allows a market maker quoting `$40 million` across 50 instruments to get swept on every bid simultaneously during an FOMC shock (`10x` posted margin!), whereas **over-counting** two-sided quotes and in-flight `OrderCancelReplaceRequest (35=G)` updates falsely locks out profitable clients every afternoon. Mastering exact state-machine credit accounting is core to [SEC Rule 15c3-5](/reports/sec-rule-15c3-5-ban-on-unfiltered-naked-sponsored-market-access-dma) and [CFTC Reg 1.73](/reports/cftc-reg-1-73-fcm-automated-clearing-credit-screen-latency-mandates).

## Three Credit Aggregation Formulas: Pure Gross, Net-Position-Only & Worst-Case Directional

Within our [MiFID II RTS 6 & SEC 15c3-5 Architecture Hub](/reports/mifid-ii-rts-6-sec-rule-15c3-5-pretrade-risk-kill-switch-sla-guide) and [Unified Margin Clearing Engine](/engines/unified-margin-clearing-engine), pre-trade gateways evaluate exposure at two hierarchy levels (**Per-Symbol** and **Portfolio Aggregate**):
- **Flawed Model A — Executed-Only (`|Filled_Pos|`)**: Ignores `LeavesQty (Tag 151)` on resting limit orders completely. **Illegal under FINRA `15c3-5` examinations** because `500` resting buy orders can fill in `200 microseconds` before any post-trade monitor reacts!
- **Ultra-Conservative Model B — Naive Two-Sided Gross (`|Filled| + Open_Buys + Open_Sells`)**: Adds resting Bids AND resting Offers together on the same symbol. Safe for directional hedge funds, but punitive for a two-sided market maker quoting `$5M Bid / $5M Ask` on `ES` (a single market move cannot fill both `+5M` and `-5M` into a `$10M` directional position simultaneously!).
- **Institutional Standard Model C — Per-Symbol Worst-Case Directional Sum**: For each symbol `i`, computes `E_i = MAX( |Pos_i + OpenBuy_i|, |Pos_i - OpenSell_i| )`, then sums `Sum_i(E_i * Haircut_i)` across all symbols! Notice how offsetting reduce-only orders (`Pos = +$5M`, `OpenSell = $3M`) properly *do not* inflate worst-case long risk (`MAX(|+5|, |+5 - 3|) = $5M`), while an over-hedging `OpenSell = $12M` flips risk to `|+5 - 12| = $7M`!

![Order lifecycle credit reservation state machine from Outbound 35=D Reservation to Resting Open Exposure, In-Flight 35=G Envelope Max, Execution Fill Shift, and Terminal Release](/api/figure?type=flow&title=Exact%20Intraday%20Credit%20Reservation%20Lifecycle%20State%20Machine&subtitle=Reserve%20pre-wire%20-%3E%20Shift%20Open-to-Filled%20on%2039%3D1%2F2%20-%3E%20Release%20only%20on%20terminal%2039%3D4%2F8%2FC&steps=1.%20Pre-Wire%2035%3DD%3A%3AAtomically%20reserve%20Qty%20*%20Price%20*%20w_i%7C2.%20Pending%2035%3DG%3A%3AHold%20MAX%28Old_Exp%2C%20New_Exp%29%20envelope%7C3.%20Fill%20%28150%3DF%29%3A%3AMove%20LastQty%20from%20Open%20-%3E%20Executed%7C4.%20Terminal%2039%3D4%2F8%3A%3ARelease%20LeavesQty%3D0%20ONLY%20on%20venue%20ACK!&metrics=PRE-WIRE%20LOCK%3A%3AAtomic%20CAS%3A%3AZero%20race%20across%208%20FIX%20threads%7CEARLY%20RELEASE%3A%3AForbidden!%3A%3ANever%20free%20credit%20on%2035%3DF%20send%7C35%3DG%20OVERHEAD%3A%3ADelta%20Only%3A%3AAvoids%202x%20double-count%20lockout%7CREDUCE-ONLY%3A%3APermitted%3A%3ACapped%20at%20%20Pos%20%20-%20Open_Cover)

## The In-Flight `35=G` (`Cancel/Replace`) Reservation Trap

Suppose an algorithmic desk rests a `100-lot` Buy limit (`ClOrdID = A1`) and sends `OrderCancelReplaceRequest (35=G, OrigClOrdID = A1, ClOrdID = A2, OrderQty = 120, Price = +1 tick)`. During the `350 microseconds` while `A2` is **Pending Replace (`39=E`)** in flight to the exchange:
- What if `A1` (`100 lots`) was *already* filled at the matching engine 10 microseconds ago, and the exchange rejects or applies `A2` depending on `OrderQty` semantics?
- Under [FIX Protocol Messaging Standard](/engines/fix-protocol-messaging-standard) rules, `Tag 38 (OrderQty)` in `35=G` specifies the **new total chain quantity** (`CumQty + NewLeavesQty`), so exposure during `Pending Replace` must reserve **`MAX(Old_Price * Old_Remaining, New_Price * MAX(0, New_OrderQty - Known_CumQty))`**—never `Old + New` (`220 lots` double-count), and never dropping `Old` before `39=5 (Replaced)` arrives!

| FIX Lifecycle Event | Naive (Buggy) Gateway Action | Institutional State-Machine Action | Failure Prevented |
| :--- | :--- | :--- | :--- |
| **Client sends `Cancel (35=F)`** | Immediately frees resting order credit on outbound wire | **Hold 100% of reservation** until exchange returns `39=4 (Canceled)` or `39=2 (Filled)` | Prevents client sending `Cancel + New` 10x in flight when cancels lose race! |
| **Client sends `Replace (35=G)`** | Adds full `New_Qty` on top of `Old_Qty` (`200%` usage) | Reserve **`MAX(Old_Remaining_Notional, New_Remaining_Notional)`** until `39=5` or `434=2` (`35=9`) | Eliminates false credit starvation during rapid quote-price sliding |
| **Account hits `102%` Credit Cap** | Blanket-rejects **all** outbound `35=D` messages | Blocks risk-increasing orders; **allows verified `Reduce-Only` covers** where `Open_Cover + Qty <= |Pos|` | Prevents trapping bleeding positions unable to flatten during volatility! |
| **Exchange TCP Disconnects** | Clears open-order table immediately on socket EOF | Keep open-order credit locked until [COD](/reports/cancel-on-disconnect-cod-heartbeat-grace-windows-cme-nasdaq-eurex) verified via Drop-Copy / Out-of-Band check | Protects against fills occurring inside COD grace window |

## Pre-Trade Credit State-Machine Transition Reference Table

Exact credit reservation deltas across every outbound client request and inbound exchange ExecutionReport (`35=8`) state transition.

```formula
E_symbol_i = w_i * MAX( |Pos_i * P_mark_i + Sum_Open_Buys_i|, |Pos_i * P_mark_i - Sum_Open_Sells_i| )
Total_Portfolio_Credit_Used = Sum_{i = 1..N}( E_symbol_i ) + MAX( 0, -Intraday_Total_PnL_USD )

Worked Reduce-Only Liquidation Gate Verification (Symbol = NVDA, Executed Pos = -4,000 Shares Short):
 Resting Open Buy Limit Orders Already on Venue = 2,500 Shares
 Trader Submits Emergency Buy Order = 2,000 Shares
 Check: 2,500 + 2,000 = 4,500 > |-4,000| -> REJECT! (Would flip +500 shares Net Long!)
 Max Allowed Reduce-Only Clip = |-4,000| - 2,500 = 1,500 Shares -> PASS!
```

## Allowing Risk-Reducing Liquidation Orders When Credit Is 100% Breached

One of the deadliest coding bugs in homegrown risk gateways occurs when an intraday market rally pushes a short portfolio past `100%` of its `$20M` gross mark-to-market limit—and the risk gateway **blocks the trader Buy-to-Cover orders** because `Current_Exposure > Limit`!

Compliant [Pre-Trade Risk Control Standard](/engines/pretrade-risk-control-standard) engines implement a dedicated **`Reduce-Only Liquidation Bypass` invariant**: an inbound order on symbol `i` is permitted even during a credit freeze **if and only if**:
1. Its side strictly opposes `Executed_Position_i` (`Buy` when `Pos_i < 0`, `Sell` when `Pos_i > 0`), AND
2. **`Existing_Same_Side_Open_Orders_i + New_Order_Qty_i <= |Executed_Position_i|`**! (Checking existing open reduce orders prevents submitting ten `100-lot` Buy-to-Cover orders against a `-100-lot` short and flipping `+900 lots` net long!).

![Comparison of calculated credit utilization for a two-sided market maker ($5M long filled + $8M resting bids + $10M resting asks) across four accounting models](/api/figure?type=bars&title=Calculated%20Exposure%20on%20Two-Sided%20Book%20%28%245M%20Pos%2C%20%248M%20Bid%2C%20%2410M%20Ask%29&subtitle=Why%20Per-Symbol%20Worst-Case%20Directional%20%28%2413M%29%20beats%20Naive%20Sum%20%28%2423M%29%20and%20Filled-Only%20%28%245M%29&steps=Flawed%20Filled-Only%20%28Illegal%29%3A%3A%245.0M%20%28Misses%20%248M%20bid%20sweep%20-%3E%20%2413M!%29%7CPer-Symbol%20Worst-Case%20Directional%3A%3A%2413.0M%20%3D%20MAX%28%20%2B5%2B8%20%2C%20%20%2B5-10%20%29%20%5BExact!%5D%7CPending%2035%3DG%20Naive%20Double-Count%3A%3A%2421.0M%20%28False%20rejects%20during%20repricing%29%7CNaive%20Two-Sided%20Gross%20Sum%3A%3A%2423.0M%20%3D%205%20%2B%208%20%2B%2010%20%28Starves%20MM%20quotes%29&metrics=LONG%20SWEEP%20MAX%3A%3A%2413.0M%3A%3A%245M%20Pos%20%2B%20%248M%20All%20Bids%20Fill%7CSHORT%20SWEEP%20MAX%3A%3A%245.0M%3A%3A%245M%20Pos%20-%20%2410M%20All%20Asks%20Fill%7CWORST%20ENVELOPE%3A%3A%2413.0M%3A%3AExact%20physical%20upper%20bound%7CCUMULATIVE%20LOSS%3A%3ARealized%2BMTM%3A%3ATriggers%20auto-freeze%20on%20drawdown)

## Multi-Currency FX Haircuts & SPAN / VaR Margin Approximation in Hardware

Because full Monte Carlo or CME SPAN array convolutions take milliseconds, [inline cut-through FPGAs](/reports/inline-fpga-pretrade-risk-gateways-sub-microsecond-credit-collars) store pre-scaled **Per-Unit Risk Weights (`w_i` in USD)** inside BRAM—updated every 30 seconds by an asynchronous risk server running full portfolio covariance and FX spot cross-rates (`EURUSD`, `USDJPY` plus a `2%` FX volatility buffer).

Compute exact parametric and historical Expected Shortfall weights for `w_i` in our [Terminal Margin VaR & ES Calculator](/calculators/terminal-margin-var-es-calculator) and size multi-strategy capital envelopes in the [Algorithmic Kelly Allocation Calculator](/calculators/algorithmic-kelly-allocation-calculator).

## Frequently asked questions

### Why must credit reservation never be released when the client sends OrderCancelRequest (35=F)?

In fast markets, 40% to 70% of cancel requests aimed at near-touch quotes arrive Too Late To Cancel (returning OrderCancelReject 35=9 because the resting order already filled). Releasing credit on outbound 35=F would allow an algorithm to cycle New -> Cancel -> New ten times in 1 millisecond and accumulate 10x its capital limit!

### Can portfolio-level cross-margining (e.g., Long ES vs Short SPY) be used inside a 310ns FPGA gate?

Pure hardware Layer-1/2 FPGAs typically enforce fast additive worst-case symbol weights (conservatively ignoring fragile cross-asset correlations during tail breaks), while a companion microsecond C++ / Drop-Copy risk server periodically recalculates SPAN/TIMS correlation offsets and refreshes the FPGA net headroom register.

### How does intraday realized and unrealized PnL interact with pre-trade gross credit caps?

Best-practice gateways pair Exposure Caps with an Intraday Max Drawdown ("Stop-Loss") Gate: any net mark-to-market loss (Realized + Unrealized < -$500k) directly reduces available credit dollar-for-dollar and triggers an automatic Soft Freeze + Risk Alert once 80% and 100% of daily loss limits breach.

### How are multi-leg futures calendar spreads or options iron condors credited pre-trade?

When submitted as native exchange-recognized spread instruments (e.g., CME Globex ES Calendar Spread or Cboe Complex Order Book), the venue guarantees atomic legged execution (zero leg risk), allowing the gateway to apply the spread-specific margin weight rather than summing outright notional legs.


## Source URLs

- https://www.finra.org/rules-guidance/notices/15-09
- https://www.cmegroup.com/confluence/display/EPICSANDBOX/CME+Globex+Credit+Controls
- https://www.fixtrading.org/online-specification/order-state-change-matrices/

## Citation

- APA: Marcus Thorne, CQF. (2026). Gross vs Net Intraday Pre-Trade Credit Accounting: Open-Order Exposure & Cancel-Replace Inflation. Terminal Ledger Desk. https://terminalledgerdesk.com/reports/gross-vs-net-intraday-credit-exposure-accounting-pending-order-var
- Canonical article: [Gross vs Net Intraday Pre-Trade Credit Accounting: Open-Order Exposure & Cancel-Replace Inflation](https://terminalledgerdesk.com/reports/gross-vs-net-intraday-credit-exposure-accounting-pending-order-var)
- Site research index: [Terminal Ledger Desk](https://terminalledgerdesk.com/llms-full.txt)
