Skip to main content

Documentation 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.

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. The 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

RegimeConditionsImplication
bull_euphoriaGraduation rate >8% (2h window), >100 tokens created/hr, >500 SOL/hr volumeHigh confidence; thresholds can be loosened
bull_normalGraduation rate >3% (2h window), >30 tokens created/hrStandard thresholds apply
transitionCreation or graduation rate diverges >50% from 7-day averageCaution; conditions are shifting, hold thresholds firm
bearGraduation rate below 2% (24h window), below 15 tokens created/hr, below 50 SOL/hr volumeTighten thresholds; reduce position sizing
transition is the regime that most often precedes a move in either direction. The system applies conservative thresholds during transition rather than guessing direction — a false optimism in a transition that resolves bearish is more costly than a missed opportunity.

Detection signals

The classifier uses 11 observable inputs computed from on-chain data. All inputs are derived from the trades 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.
RegimeConfidence method
bull_euphoriaScales with how far above each threshold the inputs are; maximum confidence at 2× each threshold
bearScales with how far below each threshold the inputs are; maximum confidence at 50% of each threshold
bull_normalFixed confidence of 0.6 — defined partly by exclusion from euphoria and bear
transitionFixed confidence of 0.6 — defined by rate divergence from 7-day average
The confidence value is included in the Redis cache and the ML feature vector, allowing downstream consumers to weight the regime signal appropriately when confidence is marginal.

How regime affects the system

The regime is encoded numerically and included in both the standard and genesis feature vectors:
RegimeEncoded value
bear0
transition1
bull_normal2
bull_euphoria3
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.

Redis caching

The regime is cached at market:regime with a 10-minute TTL and includes the full feature snapshot at the time of detection.
Redis key structure
market:regime → {
  regime: "bull_normal",
  confidence: 0.6,
  detectedAt: 1715000000000,
  features: {
    tokensCreatedLastHour: 47,
    gradRate2h: 0.041,
    gradRate24h: 0.038,
    gradRate7d: 0.035,
    solVolumeLastHour: 312.4,
    solVolume24h: 7841.2,
    activeWalletsLastHour: 283,
    signalHitRate2x6h: 0.31,
    avgPeakMultiple6h: 2.1
  }
}
Any service can call 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

The SignalCrowdingDetector 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 = tracked_wallet_sol_in_token / token_curve_sol_total
Crowding ratioScore penaltyInterpretation
< 0.100%Low crowding; ample room for additional buyers
0.10–0.2510–20%Moderate crowding; signal quality slightly reduced
0.25–0.5020–35%High crowding; significant score penalty applied
> 0.50Up to 50%Extreme crowding; signal severely penalised
The crowding ratio is cached in Redis at 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.
Crowding penalties compound with bear-regime penalties. A moderately crowded signal in a bear market can have its score reduced by up to 60–70% in total, effectively removing it from consideration. This is intentional — crowded signals in bad market conditions have historically poor outcomes.

Detection cadence summary

ComponentCadenceRedis keyPostgreSQL archive
MarketRegimeDetectorEvery 10 minutesmarket:regimemarket_regime_snapshots
SignalCrowdingDetectorEvery 60 secondscrowding:<mint>Written to signal record

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.

Build docs developers (and LLMs) love