MorphIQ LabsResearch
Quant Research15 min read

Building a Trustworthy SPY 0DTE Pricing Engine

The engineering and assurance practices behind Gamma Foundry: explicit pricing contracts, traceable evidence, deterministic replay and disciplined model qualification.

By MorphIQ Labs Research Notes

A useful SPY 0DTE pricing engine must keep pace with two markets: the underlying and the options on it. Their quotes arrive independently. Between option updates, a strategy still needs a coherent view of volatility, Greeks and aggregate exposure—and a clear account of the observations and assumptions behind that view.

Gamma Foundry builds that view once and shares it with strategies and the cockpit. On a recorded 302-contract SPY chain, the complete core context refreshed in 0.74–0.75 ms median across five repetitions using MorphIQ Risk 0.43.5 (afc298d5). That context includes contract pricing, aggregate exposures, walls, the gamma flip, volatility vitals and pricing coverage. Below, we explain the model, the update schedule and the evidence behind those measurements.

Start with market-implied volatility

Gamma uses a European Black–Scholes–Merton baseline with volatility inferred from option quotes. At each strike, it solves IV from the out-of-the-money side and uses that volatility to evaluate the paired call and put. Quote-quality checks establish whether the observation supports an update.

Consider an illustrative same-day SPY 775 call with the underlying near 770 and a bid/ask of 2.10/2.12. Its midpoint is 2.11 dollars per share. The first question is how well that market determines volatility. Gamma estimates the IV range implied by the spread using price sensitivity to volatility. This first-order estimate makes quote uncertainty visible alongside the point estimate; a quote with very little vega can imply a wide IV range even when its dollar spread looks small.

SPY's American exercise right remains part of the contract. MorphIQ Risk provides American valuation models; Gamma chooses the European baseline to keep repeated chain calculations inexpensive. For same-day contracts away from material dividend effects and early-exercise boundaries, the exercise premium can be small. This gives a practical basis for the approximation within that scope. The model-specific benchmarks measure computational cost; they do not establish a numerical bound on Gamma's European-versus-American pricing or Greek error. Exercise-sensitive contracts and discrete cash-dividend cases require their own qualification.

Time to expiry is calculated from the nanosecond difference to the configured option last-trading instant, expressed in ACT/365 years. This preserves intraday resolution all the way to the boundary. Rates, continuous dividend yield and the expiry calendar are explicit inputs to the calculation.

Reprice when the underlying moves

Now suppose SPY moves from 770 to 770.10 before a new usable quote arrives for our 775 call. Gamma can refresh its valuation and Greeks using the existing volatility information. The question is which volatility to use at the new spot.

Gamma's held-smile rule selects IV by forward moneyness as the underlying moves. This is a sticky-moneyness convention: the relationship between moneyness and volatility guides the reprice. Derman's Regimes of Volatility provides background on this family of smile-dynamics assumptions.

For the call, that means the new valuation reflects the updated underlying and the selected smile IV, while the option observation supporting the smile remains older. When a new eligible option quote arrives, the next solve updates the volatility estimate from that observation. Pricing state and observation age therefore travel together through both steps.

The reported Greeks are fixed-IV BSM partial derivatives, evaluated at the selected volatility. The spot-scenario profile reselects smile IV at each hypothetical underlying price, then evaluates fixed-IV gamma there. It is a profile of local sensitivities under that smile convention; it does not report total derivatives of the smile-adjusted valuation with respect to spot.

Build one context with explicit exposure assumptions

MorphIQ Feed supplies equity and option observations with contract identity and timing context. Gamma Core owns pricing and the resulting analytical state. Strategies and the cockpit consume that shared context, so they work from the same calculations and assumptions.

MorphIQ Feed supplies Gamma Core, which publishes a completed context snapshot to strategies and Gamma view. Strategy proposals pass to Crucible; analytics and aligned execution state reach the cockpit. Crucible exchanges orders and observations through a broker interface with a local simulator or IBKR adapter.
Data flow from independent market observations to a shared analytical snapshot, strategy evaluation and broker-independent execution. The cockpit combines analytics with execution state at the corresponding runtime cutoff; arrows represent information flow, not code dependencies.

Execution is pluggable through broker-independent interfaces. The local paper simulator supplies execution for the replay shown here. Crucible also includes a concrete Interactive Brokers (IBKR) adapter for TWS/IB Gateway, implementing contract resolution, order submission, broker callbacks and account observations used in reconciliation. The interface describes broker facts and operations; Crucible owns the runtime's risk, order lifecycle and reconciliation, while Gamma supplies analytics and strategy evaluation. This separation lets the shared Gamma context serve both simulated and broker-connected compositions.

Aggregate exposure requires an additional positioning model. Gamma's default uses the squeezemetrics sign convention: positive for calls and negative for puts. Its default flow weight is the absolute net classified intraday volume for each contract. Opposing classified trades offset before Gamma takes the absolute value: 120 buy-classified contracts and 80 sell-classified contracts yield a weight of 40. The call/put convention then supplies the exposure sign; the net trade direction does not. A contract with no classified flow has zero flow weight.

For each contract, the GEX contribution is the sign multiplied by the flow weight, option gamma, the 100-share multiplier and spot² × 0.01. Contributions are summed by strike and across the chain, giving dollar gamma exposure per 1% spot move under those conventions.

Two different profiles answer different questions. The strike exposure distribution groups current-spot GEX by option strike: the call wall is the strike with the most positive aggregate, and the put wall the most negative. The spot-scenario profile varies the underlying price and recalculates chain-wide GEX at each point. The gamma flip is a zero crossing interpolated from that profile; if no crossing exists within its range, the flip is unavailable.

These are model-conditioned estimates of exposure. The context identifies both the sign and weighting conventions so a consumer can interpret them. Observed open interest has its own availability and provenance and can support a strategy's liquidity policy. It is separate from the default flow weighting; neither OI nor classified flow reveals the actual dealer inventory.

Recorded SPY replay at 09:32:20 ET showing positive gamma under the squeezemetrics sign and flow weighting conventions, spot at 771.31, call wall at 775, put wall at 765, gamma flip at 769.91 and volatility vitals.
SPY replay, October 28, 2026 at 09:32 ET. Gamma's shared context shows the gamma regime, spot, walls, estimated gamma flip and volatility vitals under the displayed sign and flow-weighting conventions. Local paper replay.

Open the full-size context summary.

SPY strike ladder from the same replay tick, showing positive GEX in green, negative GEX in red, the call wall at 775, spot at 771.31, the estimated gamma flip at 769.91 and the put wall at 765.
The strike exposure distribution at the same replay tick. Bars group current-spot GEX by option strike under the displayed sign and flow conventions. The gamma flip is calculated separately from the spot-scenario profile and overlaid here as an underlying-price reference.

Open the full-size strike ladder.

Turn independent events into a coherent decision context

Gamma is event-driven. Equity quotes, option quotes, trades and open-interest observations arrive independently, each with its own identity and timing. The engineering task is to turn that asynchronous stream into a coherent set of inputs a strategy can evaluate together.

At each analytical cutoff, Gamma applies the admitted events in their defined order, updates the affected market state, and completes pricing and aggregation. A new option quote can change a strike's IV estimate; an underlying move can reprice existing volatility information; classified trades can change the exposure weights. Those effects are brought together before the completed context is published.

The result is a stable snapshot: spot, contract pricing, exposures, walls, the gamma flip, vitals and pricing evidence for one analytical cutoff. A strategy reads that completed context while the engine continues receiving events. Its inputs stay fixed during the evaluation; the next publication supplies a new snapshot. Strategies and presentation layers share the same calculated state.

For example, a strategy assessing a gamma-flip crossing can read spot relative to the flip, the exposure regime, a candidate option's valuation and Greeks, and its quote age and pricing state from that snapshot. Its eligibility rules then operate on one completed set of calculations. A later quote may change the next snapshot, but cannot change half of the inputs during this evaluation.

Coherence does not require every instrument to quote at the same instant. Each observation keeps its own timestamp, provenance and quality state. A Greek can be repriced against a newer spot using earlier IV information, with that relationship visible in the snapshot. This preserves the distinction between when the context was assembled and how current its market evidence is.

Publish on change, refresh on a timer

Changed data drives publication. Coalescing groups bursts of observations into analytical passes, avoiding a complete context rebuild for every message. A periodic timer also refreshes the context when the market is quiet, so the passage of time remains part of pricing. Changed-data publications leave that timer's cadence intact.

The engine service supports millisecond-resolution configuration for both the coalescing window and publication timer. The timer aligns with the coalescing grid. The replay shown here uses a 250 ms window and a one-second timer: a window with new data can produce a completed context before the periodic refresh is due. Those settings describe the example, rather than the time required to calculate its context. Realized-volatility and volatility-of-volatility history are sampled on the timer; intervening publications read that history without adding samples.

Each pass targets contracts marked for evaluation by quote changes. Existing IV-bearing contracts are repriced when spot has moved sufficiently or the repricing timer is due. Reusing available volatility information avoids redundant inversions. Rendering and view conversion consume completed snapshots in the background, independently of analytical processing.

Measure the work behind each snapshot

We measured the full update using MorphIQ Risk 0.43.5 (afc298d5) and a recorded 302-contract SPY chain from October 28, 09:30–09:35 ET. The release build ran on an Intel Core i9-10920X with 64 GiB RAM, pinned to CPU 2 on a shared host. The November 3 measurement uses this exact development commit, whose package version remains 0.43.5. Earlier events established state before the timed interval.

Each snapshot includes more than pricing at the current spot. Gamma also builds an exposure profile across 21 hypothetical underlying prices, spanning ±3% around spot. At each scenario, it selects volatility from the held smile at the scenario's moneyness, evaluates contract gamma and aggregates signed, position-weighted gamma exposure. The resulting curve locates the zero-gamma crossing; current-spot exposures also identify the call and put walls.

In the measured interval, 88–96 contracts carried the retained-volatility inputs needed by the scenario path. Across 21 hypothetical spot prices, that produced 1,848–2,016 contract–scenario requests per snapshot, totaling 2,420,544 requests across 1,201 snapshots. A separate counting replay produced the same snapshot transcript as the timed run. The 302-contract chain would represent 6,342 requests per snapshot if every contract supplied those inputs; the reported timings reflect the actual admitted workload above.

The IV solve pass includes volatility inversion, full-Greeks evaluation and Gamma’s acceptance checks for contracts affected by new quotes. Ordinary held-IV repricing evaluates the current spot. The spot-scenario profile repeats gamma evaluation across the hypothetical underlying-price grid.

The scenario path requests gamma directly from MorphIQ Risk's scalar kernel, matching the calculation to the quantity the exposure curve needs. Within each pass, Gamma prepares time to expiry, dated rates, contract terms and dividend support once per contract. Each scenario selects its own spot and smile IV; Risk still validates the complete inputs for every scenario.

Positioning factors are resolved once, and each gamma contribution is accumulated directly into its scenario total. Contract identities are borrowed from the chain; intermediate contract lists are unnecessary. Current-spot pricing retains the complete Greek vector used by strategies and vitals. The design keeps all 21 scenarios while concentrating numerical work and memory movement on the outputs each consumer uses.

Measured implementation: MorphIQ Risk 0.43.5 (afc298d5), scalar release build.

WorkRange of run mediansRange of run p99sWorst observed
Complete context update0.74–0.75 ms1.39–1.42 ms1.72 ms
IV solve and Greeks pass55–57 µs414–428 µs610 µs
Held-IV repricing pass103–106 µs124–127 µs276 µs
21-scenario exposure profile and aggregation302 µs316–320 µs476 µs
Vitals80–81 µs87–91 µs266 µs
Snapshot-state construction65–66 µs82–85 µs290 µs

Across five repetitions, each measured interval contained 1,201 context updates and 162,600 event admissions. Every retained snapshot matched the uninstrumented warm-up exactly. Committed replay fixtures also compare the gamma-only path with full-vector evaluation, checking gamma bits, refusal counts and exposure results. The separate counting replay reproduced the timed run's retained snapshot transcript byte for byte.

The worst observed complete update used about 0.69% of the 250 ms interval, leaving substantial compute headroom within this replay's configured cadence.

These are core-compute measurements on a shared host, including snapshot construction and timing instrumentation; input decoding, strategy evaluation, broker execution and display are outside the boundary. Stage percentiles are reported independently because their triggers differ. The measurement receipt records every repetition, maximum, source and input identity, and host conditions. It scopes the result to this workload; a faster cadence or a live quote-to-order latency claim requires its own composed measurement. Separate Feed transport measurements and the Risk benchmarks characterize those components.

Three properties make this useful to a trading system: a coherent snapshot for each decision, measured compute headroom for choosing an update cadence, and a broker-independent analytical context. The same Gamma calculations serve the local simulator and the concrete IBKR composition; execution adapters do not redefine the pricing or exposure model.

Make analytical quality available to the strategy

Return to the 775 call. Its new quote can be pending while older Greeks remain available. A successful solve can establish accepted pricing; a subsequent smile reprice can refresh those Greeks while retaining the earlier IV evidence. A strategy needs both the pricing state and the observation timestamps to decide how to use that result.

Gamma publishes a mutually exclusive coverage partition:

StateMeaning
AcceptedGreeks exist and the latest solve gate passed; intervening repricing may reuse IV information.
HeldPrevious Greeks are retained when the latest evaluation does not support an accepted update.
PendingA quote awaits evaluation.
UnpricedNo usable Greeks are available, without an explicit capability refusal.
RefusedThe pricing path reports unsupported capability.
ExpiredThe contract has crossed the analytics expiry boundary.
Illustrative coverage for 302 contracts: 240 accepted, 24 held, 12 pending, 18 unpriced, 6 refused and 2 expired. Quote age and IV uncertainty remain separate from these counts.
Illustrative coverage, separate from quote freshness. Each of the 302 contracts occupies exactly one evidence category.

Every represented contract belongs to exactly one category. Source provenance, quote age, IV uncertainty and engine health accompany that classification. This lets a strategy express its own eligibility policy while preserving a common meaning for the underlying analytical facts.

Verify the context from calculation to consumption

Gamma's assurance combines three forms of evidence. Machine-checked state models establish properties such as coverage conservation and precedence. Rust conformance checks connect those properties to implementation behavior. Recorded replay and empirical studies exercise outputs under declared workloads and market conditions.

The analytics core uses injected event time and performs no terminal or network I/O. Replay follows the same analytical schedule, even when playback runs faster than real time. In the cockpit, Gamma analytics, Feed source context and Crucible execution context are sampled from one completed runtime tick; retained analytics keep their own timestamps visible.

A bounded display handoff allows a slow screen to skip a view while market-data processing and execution continue. Assurance checks deliberately stall that handoff and compare execution outcomes and replay results with an unobserved run. This tests the isolation contract directly.

Expiry and execution have distinct owners. Gamma's calendar governs its pricing time boundary. Exchange trading hours and a broker's exercise-instruction cutoff are separate facts, documented by the exchange calendar and the Options Industry Council. Crucible owns execution and reconciliation: a strategy's exit request completes through execution observations and reconciled position state. Expiring an analytical contract is a separate event from confirming a flat account.

Model selection follows the same discipline: declare the baseline, separate calibration from validation, freeze candidates before scoring, and examine condition-specific errors alongside compute cost. State proofs and replay agreement establish their named contracts; pricing and hedge accuracy require independent empirical comparisons.

For our 775 call, the result is a continuous chain of interpretable updates: a quote supports an IV estimate, a spot move triggers a reprice under a declared smile convention, and a later quote refreshes the market evidence. Strategies receive those results together with exposures, vitals and quality information. That is the unit Gamma is engineered to deliver—and the complete unit whose refresh cost we measure.

More from Quant Research

August 6, 2026 · 11 min

Advanced Signal Decompositions Need the Right Test

SWT, synchrosqueezing, EMD, VMD, and EWT are often placed in the same comparison table because they all decompose a signal. That makes them look like interchangeable candidates for one job. They are not.

August 6, 2026 · 9 min

Evaluating Market Regime Detectors with Held-Out Evidence

A useful regime benchmark starts with a defined target, independently known state changes and measurements that separate responsiveness from stability. Those choices make the comparison reproducible and its conclusion…