Skip to main content

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

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

RegimeDefinitionImplication
bull_euphoriaGraduation rate >8% (2h window), >100 tokens created/hr, >500 SOL/hrHigh confidence market — thresholds can be loosened
bull_normalGraduation rate >3% (2h), >30 tokens/hrStandard conditions, standard thresholds
transitionCreation or graduation rate diverges >50% from 7-day averageConditions shifting — elevated uncertainty, trade with caution
bearGraduation rate <2% (24h), <15 tokens/hr, <50 SOL/hrThin market — tighten thresholds, reduce position size
The classifier uses 11 observable inputs computed from on-chain data: token creation rate over 1 hour, 24 hours, and the 7-day average; graduation rates over 2 hours, 24 hours, and 7 days; SOL volume over 1 hour and 24 hours; active wallets in the last hour; and recent signal hit rates from live trading (average peak multiple and 2× hit rate over the last 6 hours).
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_normal and transition — 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 under regime in the /api/stats endpoint response:
const stats = await fetch('/api/stats').then(r => r.json());

console.log(stats.regime.state);      // e.g. "bull_normal"
console.log(stats.regime.confidence); // e.g. 0.6
The regime is updated every 10 minutes. The /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 as graduation 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.
let creates = 0;
let grads = 0;

es.addEventListener('signal', (e) => {
  const d = JSON.parse(e.data);
  if (d.type === 'signal' && d.data.action === 'create') creates++;
});

es.addEventListener('graduation', () => { grads++; });

// Log graduation rate every minute
setInterval(() => {
  const rate = creates > 0 ? (grads / creates * 100).toFixed(1) : '—';
  console.log(`Grad rate: ${rate}% (${grads}/${creates} last minute)`);
  creates = 0;
  grads = 0;
}, 60_000);
A regime reclassification to bull_euphoria is one of the strongest confirming signals you can have before loosening strategy thresholds. The graduation rate tracker above lets you see it coming before the next 10-minute reclassification cycle fires.

Build docs developers (and LLMs) love