L2 Order-Book Reverse-Engineering & State-Space Methodology
How the 5-stage QuantFlow execution engine extracts structural market-maker inventory imbalances from transparent native-token Level-2 order books.
Conventional retail trading relies on OHLCV candlestick indicators (RSI, MACD, Bollinger Bands), which are mathematical transformations of already-executed historical trades. By the time a candlestick closes, the underlying institutional liquidity shift has already cleared. Kernovra replaces backward-looking price charts with real-time Level-2 (L2) order-book tomography—reverse-engineering market-maker inventory constraints and queue depletion across 15 to 20 resting limit-order tiers before price displacement occurs.
Avellaneda-Stoikov Market-Maker Reservation Price Inversion
Automated market makers (AMMs and designated liquidity providers) continuously quote bid and ask layers around an internal reservation price r(s, q, t) governed by their net inventory q, risk aversion γ, and short-horizon variance σ². When a market maker accumulates excessive long or short inventory while absorbing retail flow, their internal risk engine asymmetrically skews their resting quotes and replenishment speed to offload inventory.
By sampling full 15-level bid/ask depth frames at sub-second intervals, our engine solves the inverse problem: observing the asymmetric elasticity of quote replenishment and touch-spread skew to infer the market maker's hidden inventory pressure q̂(t). When the market maker is mathematically forced to mark price upward or downward to rebalance inventory, the engine identifies the exact limit-order entry corridor before the mark-up phase begins.
In simple terms: Market makers cannot hide their inventory on a transparent order book. When they hold too much or too little of a token, they must shift their buy and sell walls to rebalance. Our code reads those wall shifts in real time and enters alongside the market maker before the chart moves.
Cont-Kukanov-Stoikov Multi-Level Order-Flow Imbalance (L5 OFI)
Following Cont, Kukanov, and Stoikov (2014), short-horizon price changes are driven linearly by net Order-Flow Imbalance (OFI) rather than raw trade volume. We extend single-touch OFI to a 5-level distance-weighted queue derivative across levels L1 through L5, normalized against rolling book thickness.
Crucially, the engine differentiates between passive limit-order cancellation (a whale pulling a spoof bid without a trade occurring) and aggressive queue consumption (market orders eating through an ask wall). Only genuine liquidity absorption accompanied by replenishment on the opposing side contributes positive weight to the execution vector.
In simple terms: The algorithm watches the top 5 buy and sell queues tick-by-tick and knows the difference between a fake wall being canceled and a real wall being bought up by real money.
Kyle’s Lambda (λ) Weighted Least-Squares (WLS) Depth Slope
Based on Albert Kyle’s (1985) continuous auction model, price impact per unit of order flow is governed by the slope parameter λ. Our engine computes λ_bid and λ_ask separately across all 15 depth tiers using Weighted Least-Squares (WLS) regression of cumulative depth against log-price distance from the mid-price.
The log-ratio skew ln(λ_ask / λ_bid) measures the structural mechanical resistance of the order book. When ask-side resistance collapses (a thin overhead vacuum) while bid-side density hardens into an absorption floor, upward price displacement requires minimal capital inflow.
In simple terms: We measure how 'thick' the buy floor is compared to the sell ceiling across 15 price levels. When the ceiling becomes paper-thin and the floor becomes concrete, price takes the path of least resistance.
Stoikov VAMP Lead-Lag & 2D Huber-Robust Kalman Filter
Raw microstructure feeds contain high-frequency noise and deliberate 1-tick spoofing flashes designed to trick naive trading bots. We first compute Stoikov’s Volume-Adjusted Mid-Price (VAMP), which weights best bid and ask prices by the inverse of their opposing queue sizes and consistently leads the classical mid-price by 300–900ms.
The composite z-score of Kyle’s λ skew, L5 OFI, and VAMP lead is then fed into a 2-Dimensional State-Space Kalman Filter tracking both hidden Alpha Level (α_t) and Alpha Velocity (α̇_t). By wrapping the Kalman innovation residual in Peter Huber’s M-Estimator influence function ψ_c(r), any sudden 1-tick spoof spike is mathematically clipped to a bounded constant—rendering the engine immune to flash-spoofing.
In simple terms: Spoofers flash huge fake orders for one second to trick ordinary bots. Our Huber-Kalman filter requires sustained velocity over time and mathematically ignores sudden 1-second fake flashes.
Abraham Wald’s Sequential Probability Ratio Test (CUSUM-SPRT) & 60 bps Fee Audit
Even when Kalman alpha is positive, the engine does not guess. It runs Abraham Wald’s Sequential Probability Ratio Test (SPRT), accumulating log-likelihood evidence tick-by-tick until the cumulative sum Λ_t crosses the strict statistical decision boundary A (±5.10 LLR).
Once triggered, the ticket must pass a mandatory institutional fee audit: deducting 30 bps entry fee + 30 bps exit fee (0.60% round-trip) upfront and verifying that the structural liquidity wall supports a dynamic +0.30% to +0.60% net profit target. Only one signal can exist at a time (Strict Single-Position Policy), and every signal is held inside a verified Limit-Order Entry Corridor with a live Entry Opportunity Radar so members never chase late fills.
In simple terms: A signal is only emitted when statistical certainty crosses the finish line AND the projected net profit clears +0.30% to +0.60% AFTER subtracting 0.60% in exchange fees. Plus, our live Entry Opportunity Radar tracks price excursion in real time and tells you instantly if the limit entry price is still valid or already missed.
Inspect the Live 15-Level Order Book & Audited Signal Ledger Yourself
Every closed ticket, MFE/MAE excursion, fee deduction, and limit-order fill corridor is audited in real time on the QuantFlow L2 Desk. Invite active traders to unlock +3 Levels per subscribed referral and scale your daily bandwidth up to 50 signals/day.