Earnings releases compress expectations into a very short window. A price that appears to move on “the headline” may actually be the final stage of a much more mechanical process: liquidity providers withdraw, displayed depth disappears, spreads widen, and market orders begin to traverse multiple price levels.
For technical researchers, the useful question is therefore not simply, “Did the stock gap after earnings?” It is:
How fragile was the order book before the volatility began, and what did its depth, pressure, and replenishment behavior look like as the market absorbed the release?
This article develops a depth-based framework for identifying those conditions. It focuses on the information contained in order-book snapshots, while emphasizing why no single metric—spread, imbalance, or depth alone—can be treated as a reliable announcement predictor.
1. What “order-book collapse” actually means
An order-book collapse is usually visible through several related changes:
- The best bid and ask move farther apart.
- Size at the top of the book falls sharply.
- Depth disappears across several price levels, not just at the touch.
- Canceled or consumed liquidity is replenished more slowly.
- Aggressive orders cross multiple levels rather than interacting mainly with the best quote.
- The remaining book becomes increasingly one-sided.
This is different from a normal reduction in displayed size. In a healthy book, an aggressive order may temporarily consume the best level, but market makers replenish nearby liquidity within milliseconds. The market remains executable even though the immediate best quote changes.
In a liquidity vacuum, consumption and cancellation occur with little replenishment. The cost of executing a given quantity rises because the available market moves farther through the book.
A robust detector should therefore measure both the amount of liquidity present and the speed with which liquidity returns.
2. Why earnings releases are a special event
An earnings announcement is an information shock with an externally defined timestamp. That makes it useful for event studies, but it also creates several methodological traps.
First, the relevant liquidity deterioration may begin before the official release timestamp. Informed traders, options flow, or algorithmic position adjustment can affect the book before the public announcement.
Second, the reaction may occur in a different trading session. For companies reporting after the close, the meaningful event window may begin at the next regular-session open rather than at the release time.
Third, average conditions around an announcement can hide the transition that actually matters. A book that is thin for the entire day is different from a normally liquid book that becomes unusually fragile in the final seconds before the announcement.
Fourth, the first aggressive trade is not necessarily the cause of the liquidity collapse. A large market order can cause displayed depth to disappear, but the disappearance may also reflect market makers canceling ahead of an anticipated wave of orders.
The correct framing is therefore probabilistic:
Earnings-related depth deterioration is not a deterministic prediction of the next price move. It is a measure of how much execution cost and price discontinuity the market can absorb if information arrives unexpectedly.
3. The raw data required
For microstructure research, a useful depth dataset contains at least:
| Field | Description |
|---|---|
event_time |
Exchange or feed timestamp for the snapshot |
symbol |
Security identifier |
side |
Bid or ask |
level |
Price level within each side |
price |
Limit price |
size |
Displayed quantity |
sequence_number |
Feed sequence, when available |
update_type |
Snapshot, add, modify, delete, or trade indicator |
If available, order identifiers or a market-by-order feed provide more accurate attribution of cancellations and replenishment. With aggregated level-2 data, a reduction in size at an unchanged price can only be treated as an approximation of cancellation and execution.
The distinction matters. If 1,000 shares disappear from the best bid, the dataset may not reveal whether they were:
- canceled,
- sold aggressively,
- reinserted at another price,
- or hidden behind a feed update.
Depth features are still valuable, but they should not be interpreted as order-level facts when the source data cannot support that conclusion.
TickDB-based research workflow
If the research environment already uses TickDB for tick and order-book data, the practical workflow is:
- Identify the authoritative earnings-release timestamp.
- Retrieve depth snapshots and trades around the release and the next eligible trading session.
- Normalize timestamps into a common event-time domain.
- Preserve the raw snapshot sequence rather than pre-aggregating it into bars.
- Compute features snapshot by snapshot.
- Compare the event window with a same-symbol baseline.
- Validate the resulting signal out of sample.
Because TickDB deployments can expose data through different interfaces and table configurations, the extraction layer should be kept separate from the feature calculations. The code below uses a normalized long-format schema and does not depend on a particular TickDB table layout.
4. The three core depth features
4.1 Liquidity depth
The most intuitive feature is the amount of displayed liquidity available near the midpoint.
Let:
- (P_b) be the best bid,
- (P_a) be the best ask,
- (M=(P_b+P_a)/2) be the midpoint,
- (Q_b(d)) be total bid size within (d) basis points of (M),
- (Q_a(d)) be total ask size within (d) basis points of (M).
Then:
[
D(d)=Q_b(d)+Q_a(d)
]
It is often useful to calculate this for several distance bands:
- 1 basis point,
- 5 basis points,
- 10 basis points,
- 25 basis points.
A narrow band measures immediate execution capacity. Wider bands reveal whether the book has a stable reservoir behind the touch.
Depth should usually be normalized by an instrument-specific scale such as:
[
D^*(d)=\frac{D(d)}{\operatorname{median}(D(d)\text{ over the baseline window})}
]
A normalized value of 0.1, for example, means the book contains only 10% of its typical displayed depth. Comparing raw share counts across symbols is less meaningful because share price, float, average daily volume, and typical spread differ substantially.
4.2 Order-side depth pressure
The buy/sell pressure ratio can be expressed in several ways. A bounded and numerically stable measure is the order-book imbalance:
[
OBI=\frac{Q_b(d)-Q_a(d)}{Q_b(d)+Q_a(d)}
]
Under this definition:
- (OBI=1): all displayed depth is on the bid side;
- (OBI=0): displayed depth is balanced;
- (OBI=-1): all displayed depth is on the ask side.
A complementary ratio is:
[
PR=\frac{Q_b(d)}{Q_a(d)}
]
with special handling required when ask depth is zero. For modeling, the bounded imbalance is usually easier to use.
Depth pressure does not necessarily represent aggressive buying or selling. It represents the resting liquidity available on each side. A rising positive imbalance can indicate support below the market, but it can also mean that sellers have withdrawn while buyers are not replenishing the book.
That distinction is central during earnings events. A large bid imbalance caused by ask-side cancellation is less reassuring than the same imbalance accompanied by bid-side replenishment.
4.3 Replenishment and cancellation velocity
A static snapshot cannot reveal how quickly liquidity returns. For that, compare consecutive snapshots at the same price level.
Let (q_{i,t}) be displayed size at price (p) at time (t), and define an approximate same-level reduction:
[
R_{i,t}=\max(q_{i,t-1}-q_{i,t},0)
]
The reduction may reflect cancellation, aggressive execution, or both. Labeling it “cancellation” without order-level information would overstate what level-2 data proves.
A practical replacement feature is the gross displayed-size reduction rate:
[
RR_{i,t}=
\frac{\sum_i \max(q_{i,t-1}-q_{i,t},0)}
{\Delta t}
]
The inverse measure—quantity added at previously visible prices—can serve as a rough replenishment proxy:
[
AR_{i,t}=
\frac{\sum_i \max(q_{i,t}-q_{i,t-1},0)}
{\Delta t}
]
A liquidity vacuum often appears as a sharp increase in displayed-size reduction, a decline in additions, and widening spread. The price move itself may occur only after these changes are already underway.
5. Computing the features from depth snapshots
The following Python example assumes one row per side and price level:
import numpy as np
import pandas as pd
def order_book_features(
snapshots: pd.DataFrame,
depth_bps: tuple[float, ...] = (1, 5, 10),
) -> pd.DataFrame:
"""
Expected columns:
event_time, symbol, side, level, price, size
Returns one feature row per symbol and snapshot.
"""
df = snapshots.copy()
df["event_time"] = pd.to_datetime(df["event_time"], utc=True)
df["price"] = pd.to_numeric(df["price"])
df["size"] = pd.to_numeric(df["size"])
records = []
for (symbol, event_time), group in df.groupby(
["symbol", "event_time"], sort=False
):
bids = (
group[group["side"].eq("bid")]
.sort_values("price", ascending=False)
.reset_index(drop=True)
)
asks = (
group[group["side"].eq("ask")]
.sort_values("price", ascending=True)
.reset_index(drop=True)
)
if bids.empty or asks.empty:
continue
best_bid = float(bids.iloc[0]["price"])
best_ask = float(asks.iloc[0]["price"])
midpoint = (best_bid + best_ask) / 2.0
row = {
"symbol": symbol,
"event_time": event_time,
"best_bid": best_bid,
"best_ask": best_ask,
"midpoint": midpoint,
"spread": best_ask - best_bid,
"spread_bps": (best_ask - best_bid) / midpoint * 10_000,
}
for band in depth_bps:
lower_bound = midpoint * (1 - band / 10_000)
upper_bound = midpoint * (1 + band / 10_000)
bid_depth = bids.loc[
bids["price"].ge(lower_bound), "size"
].sum()
ask_depth = asks.loc[
asks["price"].le(upper_bound), "size"
].sum()
total_depth = bid_depth + ask_depth
row[f"bid_depth_{band:g}bps"] = bid_depth
row[f"ask_depth_{band:g}bps"] = ask_depth
row[f"total_depth_{band:g}bps"] = total_depth
row[f"depth_pressure_{band:g}bps"] = (
(bid_depth - ask_depth) / total_depth
if total_depth > 0
else np.nan
)
row[f"depth_ratio_{band:g}bps"] = (
bid_depth / ask_depth if ask_depth > 0 else np.inf
)
if bids.iloc[0]["size"] + asks.iloc[0]["size"] > 0:
row["microprice"] = (
best_ask * bids.iloc[0]["size"]
+ best_bid * asks.iloc[0]["size"]
) / (
bids.iloc[0]["size"] + asks.iloc[0]["size"]
)
else:
row["microprice"] = midpoint
records.append(row)
return pd.DataFrame(records)
This calculation is deliberately snapshot-based. It should be applied to the original depth events rather than to bars containing only the final book state. Aggregating first can remove the cancellation and replenishment sequence that distinguishes a temporary disturbance from a true vacuum.
6. Approximating replenishment velocity
The next example compares consecutive snapshots and estimates gross displayed-size reductions and additions at unchanged price levels.
def approximate_book_flow(
snapshots: pd.DataFrame,
interval: str = "100ms",
) -> pd.DataFrame:
"""
Approximate displayed-size flow at unchanged price levels.
This does not distinguish cancellations from aggressive executions.
"""
df = snapshots.copy()
df["event_time"] = pd.to_datetime(df["event_time"], utc=True)
# Preserve the original snapshot identity.
df["snapshot_id"] = df["event_time"].astype("int64")
# In production, use the actual source update ID if available.
# For this example, rows sharing symbol and event_time form a snapshot.
keys = ["symbol", "event_time", "side", "price"]
df = df.sort_values(keys).reset_index(drop=True)
previous = df[keys + ["size"]].copy()
previous["event_time"] = previous["event_time"] + pd.Timedelta(interval)
previous = previous.rename(columns={"size": "previous_size"})
merged = df.merge(
previous[keys + ["previous_size"]],
on=keys,
how="left",
)
merged["size_change"] = merged["size"] - merged["previous_size"]
merged["gross_reduction"] = (-merged["size_change"]).clip(lower=0)
merged["gross_addition"] = merged["size_change"].clip(lower=0)
flows = (
merged.groupby(["symbol", "event_time"], as_index=False)
.agg(
gross_reduction=("gross_reduction", "sum"),
gross_addition=("gross_addition", "sum"),
)
)
flows["reduction_rate"] = flows["gross_reduction"] / pd.Timedelta(
interval
).total_seconds()
flows["addition_rate"] = flows["gross_addition"] / pd.Timedelta(
interval
).total_seconds()
flows["net_displayed_flow"] = (
flows["gross_addition"] - flows["gross_reduction"]
)
return flows
The interval used to align “previous” and “current” snapshots must match the source-update process. Assuming a fixed interval when updates are irregular can produce incorrect results. A better implementation uses source sequence numbers or actual update timestamps.
7. Turning raw features into an event-study dataset
A practical event window might use the following structure:
- Baseline: the 20 regular trading sessions before the announcement;
- Pre-event window: from 60 seconds to 1 second before the release;
- Initial reaction: from the release to 5 seconds afterward;
- Confirmation window: from 5 to 30 seconds afterward;
- Recovery window: from 30 to 300 seconds afterward.
For an after-hours release, the event time should be remapped to the next regular-session open or to the period in which the market first receives the information.
At each event time, calculate:
[
z_{depth}(t)=
\frac{D(t)-\mu_D(t)}{\sigma_D(t)}
]
[
z_{spread}(t)=
\frac{S(t)-\mu_S(t)}{\sigma_S(t)}
]
where (\mu) and (\sigma) come from a same-symbol, same-time-of-day baseline rather than from the announcement window itself.
A useful fragility profile may contain:
Normalized 5-bps depth
Normalized spread
Order-side depth pressure
Gross displayed-size reduction rate
Displayed-size addition rate
Book imbalance change
Trade imbalance
Realized spread and execution slippage
Trade data should be included where possible. Book imbalance indicates where displayed liquidity sits; trade imbalance helps identify whether aggressive orders are actually consuming it.
A hypothetical transition
The following values illustrate the intended interpretation and are not empirical results:
| Stage | Spread | 5-bps depth | Depth pressure | Replenishment |
|---|---|---|---|---|
| Normal baseline | 3 cents | 84,000 shares | +0.08 | Rapid |
| Final pre-release seconds | 8 cents | 31,000 shares | +0.34 | Slow |
| First reaction | 17 cents | 12,000 shares | +0.61 | Very slow |
| Following 20 seconds | 24 cents | 7,000 shares | +0.72 | Minimal |
The rising pressure ratio alone might look bullish. The complete picture is different: spread expansion, falling depth, and weak replenishment indicate that the remaining bid is fragile. A sufficiently large sell order can traverse that apparently supportive book.
This is why depth pressure should be interpreted jointly with absolute depth and replenishment.
8. Detecting a liquidity vacuum without hindsight leakage
A model intended to warn of unstable liquidity should only use information available at the decision timestamp.
Avoid features that implicitly reveal the future, including:
- the maximum depth reached during the next several seconds;
- the lowest ask price after the announcement;
- the final size of an aggressive trade;
- event-window labels calculated from post-event data;
- bars that contain both pre-release and post-release snapshots.
A more defensible label can be based on future execution conditions:
[
y(t)=
\mathbf{1}
\left[
\text{future spread or slippage} > q
\right]
]
where (q) is estimated from a historical baseline. The label is used for training and evaluation, not as an input feature.
For example, a target might ask whether, over the next five seconds:
- the spread crosses the 95th percentile of its normal distribution;
- executed slippage for a fixed order size doubles;
- the midprice traverses more than one predefined depth band;
- or a liquidity-provider-style replenishment threshold fails.
These definitions are more operational than labeling every large price move as “collapse.”
9. What the signal can—and cannot—tell you
Depth deterioration can provide several useful warnings:
It identifies execution fragility
When displayed depth collapses while replenishment remains weak, a fixed-size order can have an outsized price impact. This is directly relevant to execution and risk systems.
It separates one-sided books from balanced books
Pressure measures show which side holds the visible liquidity. A book with low total depth and a large imbalance is usually more fragile than a balanced book with similar directional pressure.
It reveals transition before the final price jump
The collapse often develops progressively. Spread widening, depth loss, and reduced replenishment can appear before the most violent print.
It helps distinguish information absorption from simple illiquidity
A low-depth book that remains stable may simply be a thin instrument. A book that loses depth, widens, and fails to replenish around the release is undergoing a structural deterioration.
However, the signal does not establish a trade direction. The following interpretations are unsafe:
- “Positive depth pressure guarantees an upward move.”
- “A size reduction proves cancellation.”
- “A thin book necessarily means a large move will follow.”
- “The first snapshot after the release can explain the release reaction.”
Displayed liquidity can be canceled quickly, replaced at a different price, or remain as a temporary barrier. It can also be deliberately posted without an intention to trade. The signal is about market quality and execution risk, not guaranteed price prediction.
10. Validation design
A rigorous study should evaluate the depth signal separately from the announcement event itself.
Build a matched baseline
Compare the announcement window with the same time of day on nearby non-earnings days. This controls for:
- the normal opening and closing liquidity patterns;
- scheduled macro announcements;
- index rebalancing;
- options expiration;
- recurring institutional order flow.
Separate event regimes
Analyze at least:
- pre-market and post-market releases;
- large-cap and small-cap issuers;
- high- and low-liquidity names;
- positive and negative earnings surprises;
- regular trading hours and extended hours.
A threshold learned from liquid large-cap stocks may not transfer to smaller issuers.
Measure both predictive and execution outcomes
Relevant outcomes include:
- spread expansion;
- depth depletion;
- realized slippage;
- price impact per unit of aggressive volume;
- replenishment latency;
- probability of crossing multiple levels;
- adverse-selection cost for passive orders.
A model may forecast volatility without improving execution. These outcomes should be evaluated separately.
Use walk-forward or out-of-sample testing
Tune thresholds and model weights only on earlier events. Earnings behavior changes with market structure, participation, and volatility regimes, so a static full-sample optimization is likely to overstate performance.
11. Implementation details that often cause errors
Timestamp consistency
Use exchange event time for alignment and retain the source timestamp separately from the time at which your system received the message. Network and processing delay can otherwise be mistaken for market behavior.
Snapshot completeness
A depth snapshot may omit levels beyond a fixed number. Ensure that the comparison distance does not exceed the available range.
Price and size conventions
Confirm whether size is in shares, contracts, lots, or another unit. Convert it consistently before aggregating across symbols.
Stock splits and corporate actions
Adjust historical prices before applying basis-point depth bands. A split can create an artificial discontinuity in prices and depth if left untreated.
Symbols and listings
Use a stable security identifier rather than relying only on a mutable ticker. Multiple venues may need aggregation rules based on the research question.
Data quality
Detect crossed books, stale quotes, duplicate updates, and out-of-order sequence numbers. A “liquidity collapse” caused by a dropped feed packet is not a market event.
Low-liquidity artifacts
A large percentage change in depth can be caused by a tiny absolute baseline. Evaluate both normalized and absolute measurements.
12. A practical decision rule
Rather than reducing the analysis to one opaque “collapse score,” a transparent rule can combine several normalized features.
For example, a research system might flag fragile liquidity when:
- 5-basis-point depth is below the 10th percentile of the baseline;
- spread is above the 90th percentile;
- gross displayed-size reduction rate is elevated;
- displayed-size addition rate is depressed; and
- the book remains one-sided for at least several consecutive updates.
The thresholds should be calibrated by symbol and time-of-day regime. The rule can then be used to:
- reduce order size before a release;
- switch to more passive or randomized execution;
- widen internal slippage limits;
- suppress strategies that assume immediate two-sided liquidity;
- trigger deeper event monitoring.
The purpose is not to predict every earnings gap. It is to recognize when the market’s execution capacity is deteriorating and the cost of being wrong is rising.
Conclusion
The earliest warning of an earnings-related liquidity vacuum is usually not a single unusual price print. It is a combination of falling depth, widening spread, one-sided pressure, and weakening replenishment.
Depth snapshots make this transition observable, but they do not make it deterministic. The strongest research framework treats them as indicators of execution fragility and tests their value out of sample against spread, slippage, depth depletion, and price-impact outcomes.
For teams working with US equities, the key requirement is access to timestamped trade and depth data at a resolution fine enough to preserve the sequence of cancellations, consumption, and replenishment. TickDB can be used as the tick-data foundation for this workflow, with the earnings calendar, baseline construction, and validation logic kept as explicit research layers rather than hidden assumptions.
Next step: explore TickDB’s depth-data and tick-retrieval capabilities, then build a small event study around one liquid US stock and one thinly traded US stock. Comparing their depth, pressure, and replenishment trajectories will make the mechanism easier to see than any headline-based price chart alone.