Client Toxicity Scoring
Determines A-book vs B-book routing based on trader profitability signals
Toxicity Score Formula
T = w₁·WinRate + w₂·Expectancy + w₃·NewsRatio + w₄·ScalpRatio
Where weights w₁=0.30, w₂=0.35, w₃=0.20, w₄=0.15 (sum to 1.0)
T > 0.65 → A-book route · T < 0.35 → B-book safe · 0.35–0.65 → partial hedge
T > 0.65 → A-book route · T < 0.35 → B-book safe · 0.35–0.65 → partial hedge
Input Trader Metrics
Toxicity Calculation
Win Rate Score (×0.30)
—
Expectancy Score (×0.35)
—
News Ratio Score (×0.20)
—
Scalp Ratio Score (×0.15)
—
Expectancy ($/trade)
—
TOXICITY SCORE (T)
—
—
How to read this: Expectancy = (WinRate × AvgWin) − (LossRate × AvgLoss). A positive expectancy trader is dangerous on your B-book — they extract money from you consistently. News ratio captures latency arbitrage and macro scalpers. Scalp ratio >40% often signals algo or HFT activity. Route scores >0.65 to A-book immediately.
Example Trader Profiles
| Trader | Win% | Expectancy | News% | Scalp% | T Score | Routing |
|---|---|---|---|---|---|---|
| Retail Joe | 42% | -$12/trade | 8% | 5% | 0.18 | B-Book ✓ |
| Swing Trader | 55% | +$8/trade | 15% | 3% | 0.48 | Partial Hedge |
| News Scalper | 71% | +$34/trade | 82% | 67% | 0.81 | A-Book ⚠ |
| Algo HFT | 63% | +$2/trade | 45% | 91% | 0.74 | A-Book ⚠ |
Net Delta & Gamma Exposure
Real-time P&L sensitivity of your B-book portfolio to price moves
Core Exposure Formulas
ΔP&L ≈ NetDelta × Δprice + ½ × NetGamma × (Δprice)²
NetDelta = Σ (position_i × lots_i × contract_size × direction_i)
NetGamma = dDelta/dPrice (sensitivity of delta to price change)
Direction: +1 for client SHORT (you are long), −1 for client LONG (you are short)
B-Book Position Inputs (EUR/USD)
Exposure Output
Client Net Long (lots)
—
Client Net Short (lots)
—
Your Net Delta (units)
—
Your Net Delta (lots)
—
1st Order P&L (Delta × Move)
—
2nd Order P&L (½ Gamma × Move²)
—
Total Estimated P&L Impact
—
—
Why Gamma matters: Most risk managers only watch delta (linear exposure). But as price moves, your delta changes — this is gamma. If you're net short gamma (clients hold options or you have convex stop-cluster risk), large moves hurt you disproportionately. The ½·Gamma·(Δprice)² term becomes significant after moves >30 pips. Always run scenarios at 50, 100, and 200 pip moves.
Value at Risk & Expected Shortfall
Maximum expected loss at a given confidence level; CVaR captures tail beyond VaR
Historical VaR & CVaR (Expected Shortfall)
VaR₉₉ = −Percentile(P&L returns, 1%)
CVaR₉₉ = −Mean(returns below VaR threshold)
Parametric VaR = μ − zα × σ × √T
z₉₉ = 2.326 · z₉₅ = 1.645 · T = holding period in days · μ = mean daily P&L · σ = daily P&L std dev
B-Book Portfolio Parameters
Risk Calculations
Selected z-score
—
Daily VaR
—
CVaR / Expected Shortfall
—
VaR as % of Risk Limit
—
Stress Loss (3σ event)
—
Sharpe-like B-book ratio (μ/σ)
—
Headroom remaining
—
—
VaR vs CVaR in plain english: VaR₉₅ of $7,000 means "on 95% of days, you won't lose more than $7,000." But CVaR tells you: on the worst 5% of days, you'll lose on average $X. CVaR is always bigger and more honest. Regulators and sophisticated prop desks use CVaR precisely because VaR ignores the shape of the tail. If your CVaR >2× VaR, your return distribution has fat tails — common in FX around news events.
Optimal Hedge Ratio
Minimises basis risk when partially hedging B-book positions to market
Minimum Variance Hedge Ratio
h* = ρ × (σclient / σmarket)
Hedged P&L Variance = σ²client × (1 − ρ²)
Hedge Effectiveness = ρ² × 100%
ρ = correlation between client flow P&L and market price move · σ = standard deviations of each
Hedge Ratio Inputs
Hedge Output
Optimal Hedge Ratio (h*)
—
Notional to Hedge
—
Notional to B-Book (retain)
—
Unhedged Variance (σ²)
—
Hedged Variance (σ²)
—
Hedge Effectiveness
—
Daily Hedge Cost
—
—
Practical meaning: h* = 0.78 means hedge 78% of the notional exposure, keep 22% on B-book. You're not hedging 100% because basis risk (ρ < 1) means a perfect hedge doesn't exist — over-hedging creates more variance than it removes. The hedge effectiveness of ρ² tells you what % of variance you've eliminated. At ρ=0.72, you eliminate ~52% of variance. If ρ < 0.5, the hedge is weak and the cost may not justify it.
VPIN — Volume-Synchronized Probability of Informed Trading
Detects toxic order flow in real time by measuring buy/sell imbalance per volume bucket
VPIN Formula
VPIN = (1/n) × Σ |Vbuy,τ − Vsell,τ| / Vτ
τ = volume bucket (fixed volume interval) · n = number of buckets (typically 50) · V = volume in bucket
VPIN > 0.5 → high toxicity · VPIN < 0.25 → normal balanced flow · Classify volume using tick rule or bulk classification
VPIN > 0.5 → high toxicity · VPIN < 0.25 → normal balanced flow · Classify volume using tick rule or bulk classification
Volume Bucket Data (Last 10 Buckets)
Click "Generate Buckets" or adjust scenario
VPIN Results
Number of Buckets
—
Average |Imbalance| per bucket
—
VPIN Score
—
Flow Regime
—
Recommended Action
—
—
Response thresholds:
VPIN < 0.25 → B-book normally, tight spread
0.25–0.50 → Monitor, consider widening spread 20%
0.50–0.70 → Widen spread, partial A-book routing
> 0.70 → Full A-book, refuse scalper trades
VPIN < 0.25 → B-book normally, tight spread
0.25–0.50 → Monitor, consider widening spread 20%
0.50–0.70 → Widen spread, partial A-book routing
> 0.70 → Full A-book, refuse scalper trades
Stop-Loss Cluster Heatmap
Maps open client stop orders to identify cascade risk zones on your B-book
Cascade Risk at Price Level p
CascadeRisk(p) = Σ LotSizei × 1{Stopi = p±threshold}
GammaSpike(p) = dDelta/dp ≈ CascadeRisk(p) / Δp
When price sweeps through a stop cluster, your B-book delta suddenly shifts — this is a gamma event. Pre-hedge before price reaches cluster zones.
Stop Distribution Generator
Largest cluster above price
—
Largest cluster below price
—
Total B-book lots at risk (±50 pips)
—
Cascade P&L impact (estimate)
—
Stop Cluster Heatmap (±80 pips from current price)
■ Long stops (client take profit → your loss)
■ Short stops (client stop loss → your gain)
How to act on this: When price is within 15 pips of a large cluster (>50 lots), pre-hedge that incremental delta to the market before the cascade. You know exactly what will happen — the cluster will trigger stop fills, suddenly shifting your net position. Gamma is highest near these zones. Post-cascade, your delta resets and you can re-evaluate B-book exposure.