# Stochastic invariants: holding under noise, not just at the average

> Canonical: https://blazephoenix.xyz/learn/stochastic-invariants
> License: CC BY 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-08-05



BlazePhoenix V2 is pre-deployment and under audit; this is design intent. Markets are noisy: reserves jitter, blocks reorder, thin pools swing. A guarantee that holds only at the mean is a guarantee that fails exactly when it is stress-tested. V2 states its invariants stochastically — they must hold across the distribution of states an attacker can steer toward, not just the average one.

## Designing for the tail

This is why pricing uses a median rather than a mean, why the floor is a hard clamp rather than an expectation, and why capacity is checked against live balances rather than a snapshot. Each choice trades a little theoretical tightness for robustness in the tail, where real losses happen. The median-4% band is the concrete expression of this idea applied to price.

**Verify it yourself:** Simulate a pair under random reserve shocks and confirm the median-based price and the hard floor stay within band while a mean-based one drifts

Related: https://blazephoenix.xyz/learn/median-4-percent-invariant · https://blazephoenix.xyz/learn/invariants-and-time · https://blazephoenix.xyz/learn/execution-risk-distribution · https://blazephoenix.xyz/learn/v2-redesign-overview
