Not all market conditions are equal. A token that would comfortably hit 2× in a bull market might 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/0xW1re/solvedocs/llms.txt
Use this file to discover all available pages before exploring further.
MarketRegimeDetector classifies the current market state every 10 minutes using observable on-chain signals and publishes the result to Redis, where it is consumed by the ML models, the Genesis Watcher, and the live trader.
The four regimes
| Regime | Definition | Implication |
|---|---|---|
bull_euphoria | Graduation rate >8% (2h window), >100 tokens created/hr, >500 SOL/hr | High confidence market — thresholds can be loosened |
bull_normal | Graduation rate >3% (2h), >30 tokens/hr | Standard conditions, standard thresholds |
transition | Creation or graduation rate diverges >50% from 7-day average | Conditions shifting — elevated uncertainty, trade with caution |
bear | Graduation rate <2% (24h), <15 tokens/hr, <50 SOL/hr | Thin market — tighten thresholds, reduce position size |
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.
Confidence scoring
Each regime classification includes a confidence value (0–1).bull_euphoria— confidence scales with how far above each threshold the metrics are.bear— confidence scales with how far below the thresholds the metrics are.bull_normalandtransition— fixed confidence of 0.6 applies, because these states are defined partly by exclusion rather than by exceeding a clear threshold.
How regime feeds into the system
ML feature vector
Regime is encoded numerically (bear=0, transition=1, bull_normal=2, euphoria=3) and included in both the standard 68-feature and genesis 75-feature vectors. This allows the models to condition their predictions on market context — a 3× prediction in a bull market requires different evidence than one in a bear market.
Genesis Watcher
The regime is included in the genesis feature vector under
market_regime_encoded. Tokens launching during euphoria have a meaningfully different base rate of success than tokens launching during a bear.Live trader thresholds
The live trader reads the current regime from Redis when evaluating whether to enter a position. In bear conditions, the ML probability threshold can be raised to require higher conviction before deployment.
Redis caching
The regime is cached at
market:regime with a 10-minute TTL, including the full feature snapshot at detection time. Every cycle also writes a snapshot to market_regime_snapshots for historical analysis and model training.Reading the current regime
The current regime is available underregime in the /api/stats endpoint response:
/api/stats endpoint always reflects the latest classification without requiring a database query — it reads directly from the Redis cache.
Graduation rate as a leading indicator
Graduations appear on the live SSE feed asgraduation events. Tracking the graduation rate — graduations per hour relative to token creations per hour — gives an independent view of market quality that can lead the official regime reclassification by a few minutes. A rising graduation rate that the regime hasn’t yet reclassified is a useful early signal of improving conditions.