Not all market conditions are equal. A token that comfortably hits 2× in a bull market may barely move in a bear one. Running the same signal thresholds regardless of market context means over-trading in bad conditions and under-trading in good ones. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/alphaleaks60-maker/docs2/llms.txt
Use this file to discover all available pages before exploring further.
MarketRegimeDetector classifies the current state of the Pump.fun market every 10 minutes using observable on-chain signals and publishes the result to Redis — where it is consumed by the ML model, the Genesis Watcher, and the live trader.
The four regime states
| Regime | Conditions | Implication |
|---|---|---|
bull_euphoria | Graduation rate >8% (2h window), >100 tokens created/hr, >500 SOL/hr volume | High confidence; thresholds can be loosened |
bull_normal | Graduation rate >3% (2h window), >30 tokens created/hr | Standard thresholds apply |
transition | Creation or graduation rate diverges >50% from 7-day average | Caution; conditions are shifting, hold thresholds firm |
bear | Graduation rate below 2% (24h window), below 15 tokens created/hr, below 50 SOL/hr volume | Tighten thresholds; reduce position sizing |
Detection signals
The classifier uses 11 observable inputs computed from on-chain data. All inputs are derived from thetrades and tokens tables without external price feeds.
Token creation rate
Tokens created in the last 1 hour, last 24 hours, and the 7-day rolling average. Creation rate is the leading indicator — it rises before graduation rate and falls before it.
Graduation rates
2-hour, 24-hour, and 7-day rolling graduation rates. The 2-hour rate captures current momentum; the 24-hour and 7-day rates provide baseline context.
SOL volume
Total SOL volume traded in the last 1 hour and 24 hours. Volume confirms the graduation rate signal — high graduation with low volume can indicate easy graduation conditions rather than genuine demand.
Active wallets
Distinct wallets that have traded in the last hour. High wallet activity with low graduation rate indicates broad participation without quality outcomes — a common bear-market pattern.
Signal hit rates
Average peak multiple and 2× hit rate from live trading over the last 6 hours. This is the most direct feedback signal — it captures whether the current market is rewarding signals with actual returns.
The classification is rule-based, not ML-based. This is deliberate: regime classification needs to be fast, transparent, and robust in edge cases. An ML model would perform similarly on this problem but would be far harder to debug when it misclassifies during novel market conditions.
Confidence scoring
Each regime classification includes a confidence value between 0 and 1.| Regime | Confidence method |
|---|---|
bull_euphoria | Scales with how far above each threshold the inputs are; maximum confidence at 2× each threshold |
bear | Scales with how far below each threshold the inputs are; maximum confidence at 50% of each threshold |
bull_normal | Fixed confidence of 0.6 — defined partly by exclusion from euphoria and bear |
transition | Fixed confidence of 0.6 — defined by rate divergence from 7-day average |
How regime affects the system
- ML feature vector
- Genesis Watcher
- Live trader thresholds
The regime is encoded numerically and included in both the standard and genesis feature vectors:
This encoding allows the ML model to condition its predictions on market context. A 3× prediction in euphoria requires different supporting evidence than the same prediction in a bear market — and the model learns this distinction from the training data.
| Regime | Encoded value |
|---|---|
bear | 0 |
transition | 1 |
bull_normal | 2 |
bull_euphoria | 3 |
Redis caching
The regime is cached atmarket:regime with a 10-minute TTL and includes the full feature snapshot at the time of detection.
Redis key structure
MarketRegimeDetector.getRegime() to get the current regime without a database query. The 10-minute TTL matches the reclassification cadence — the cached value is always within one classification interval of current.
Every detection cycle also writes a full snapshot to the market_regime_snapshots table for historical analysis and model training. These snapshots enable the ML training pipeline to match historical signals to the regime that was active at the time they fired.
Signal crowding detection
TheSignalCrowdingDetector runs every 60 seconds and measures the ratio of tracked-wallet SOL exposure on a token relative to the token’s total bonding curve SOL. When a disproportionate fraction of the curve is held by tracked wallets, the signal is crowded — there are fewer remaining buyers to drive the price.
Crowding ratio
| Crowding ratio | Score penalty | Interpretation |
|---|---|---|
| < 0.10 | 0% | Low crowding; ample room for additional buyers |
| 0.10–0.25 | 10–20% | Moderate crowding; signal quality slightly reduced |
| 0.25–0.50 | 20–35% | High crowding; significant score penalty applied |
| > 0.50 | Up to 50% | Extreme crowding; signal severely penalised |
crowding:<token_mint> with a 60-second TTL and is included as crowding_ratio in the ML feature vector. The live trader also reads it directly when sizing positions — extreme crowding reduces the position size independent of the ML score.
Detection cadence summary
| Component | Cadence | Redis key | PostgreSQL archive |
|---|---|---|---|
MarketRegimeDetector | Every 10 minutes | market:regime | market_regime_snapshots |
SignalCrowdingDetector | Every 60 seconds | crowding:<mint> | Written to signal record |
Related subsystems
Genesis Watcher
How market regime is encoded as a genesis feature and conditions genesis model predictions.
ML features
Where
market_regime_encoded and crowding_ratio appear in the full 68-feature standard vector.Live trader strategies
How regime-aware threshold adjustments are applied in strategy selection and position sizing.
Pipeline phase 3
The broader Phase 3 context: ML inference, anti-signal emission, and all advanced intelligence services.