Skip to main content

Market Toxicity Regime

Quick Reference

PropertyValue
Dimensionregime
Categorymarket_regime
Versionv0.9.0 (Beta)
Output Columntoxicity_score

Market toxicity regime score - identifies periods of high adverse selection risk using order flow, spread, and volatility

Formula

decay_accum(((abs(order_flow_imbalance) * spread) * volatility), alpha, 0)

CDM Inputs

ColumnCDM TableDescription
order_flow_imbalancecdm_*CDM source table
spreadcdm_*CDM source table
volatilitycdm_*CDM source table

Parameters

ParameterTypeDefaultDescription
alphafloat [0.0, 1.0]0.9Smoothing factor for toxicity accumulation
threshold_highfloat [0.0, 10.0]0.7Threshold for high toxicity regime classification
threshold_lowfloat [0.0, 10.0]0.3Threshold for low toxicity regime classification

Output

Column: toxicity_score

Composite toxicity score (higher = more toxic market conditions)

Market Intuition & Trading Rationale

Market toxicity regime combines three stress signals into a composite toxicity score: decay_accum(|OFI| × spread × volatility, alpha). Each component captures a different dimension of toxicity: OFI magnitude measures directional aggression (are traders pushing in one direction?), spread measures liquidity cost (are providers demanding higher compensation?), and volatility measures uncertainty (how fast are prices moving?). When all three are elevated simultaneously, the market is toxic — informed trading is likely.

The multiplicative combination creates an AND-gate effect: all three components must be elevated for the score to rise. High OFI with tight spreads and low vol is just active trading, not toxicity. High vol with neutral OFI is just uncertainty, not toxicity. Only when aggression, cost, and uncertainty align does the toxicity score increase — this is the signature of informed traders pushing through a stressed market.

The decay_accum state function gives the score persistence: toxicity that's sustained over minutes is far more significant than a momentary spike. The alpha parameter controls the memory decay rate — higher alpha gives more weight to recent observations.

Usage Cases

  • Toxicity-based trading halt: When toxicity_score exceeds threshold_high (default 0.7), stop providing liquidity and reduce directional position sizes. The market is too toxic for reliable signal generation.
  • Regime rotation: High toxicity favors momentum strategies (ride the informed flow). Low toxicity favors mean-reversion and market-making strategies (fade extremes, capture spreads).
  • VPIN complement: Pair with vpin (signal dimension). VPIN measures the probability of informed trading from volume imbalance; toxicity_score measures the market impact of that informed trading. High VPIN + high toxicity = strongly informed, high-impact flow — the most dangerous regime for liquidity providers.

YAML Definition

name: market_toxicity_regime
description: Market toxicity regime score - identifies periods of high adverse selection
risk using order flow, spread, and volatility
category: market_regime
version: v0.9.0 (Beta)
dimension: regime
status: Pre-release
required_inputs:
- order_flow_imbalance
- spread
- volatility
output_column: toxicity_score
output_description: Composite toxicity score (higher = more toxic market conditions)
parameters:
alpha:
type: float
description: Smoothing factor for toxicity accumulation
required: false
default: 0.9
constraints:
min: 0.0
max: 1.0
threshold_high:
type: float
description: Threshold for high toxicity regime classification
required: false
default: 0.7
constraints:
min: 0.0
max: 10.0
threshold_low:
type: float
description: Threshold for low toxicity regime classification
required: false
default: 0.3
constraints:
min: 0.0
max: 10.0
formula: decay_accum(((abs(order_flow_imbalance) * spread) * volatility), alpha, 0)