mean-reversionlisted
Install: claude install-skill agiprolabs/claude-trading-skills
# Mean Reversion
Mean reversion is the statistical tendency for prices, spreads, or other financial variables to return toward a long-run average after deviating from it. A mean-reverting series overshoots its mean, then corrects back -- creating predictable oscillations that can be traded.
## When Mean Reversion Works
- **Ranging markets**: Sideways price action with clear support/resistance
- **Pairs spreads**: Spread between cointegrated assets reverts to equilibrium
- **Oversold/overbought extremes**: RSI, Bollinger Band, or z-score extremes in stationary series
- **Funding rate arbitrage**: Perpetual funding rates revert to baseline
- **Stablecoin depegs**: Classic mean-reversion opportunity (peg = known mean)
- **Post-dump recovery**: Brief mean-reversion windows after initial PumpFun dumps
## When Mean Reversion Fails
- Strong trending markets (most crypto most of the time)
- Regime changes: what was stationary becomes non-stationary
- Structural breaks: token migration, protocol upgrade, delistings
- Low liquidity: wide spreads consume mean-reversion profits
---
## Testing for Mean Reversion
Before trading mean reversion, you must statistically confirm the series is mean-reverting. Three complementary tests:
### 1. Augmented Dickey-Fuller (ADF) Test
Tests the null hypothesis that a series has a unit root (non-stationary).
```python
from scipy import stats
import numpy as np
def adf_test(series: np.ndarray, max_lag: int = 0) -> dict:
"""Run ADF test. Re