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.
Alpha Leak runs as a single process hosting 30+ concurrent background services, coordinated through a database and cache layer. Events are handled inline as they arrive — there is no queue between ingestion and processing, which keeps latency minimal and the operational footprint simple. The system is divided into four named phases, each building on the data produced by the one before it.
Pipeline overview
On-chain Events (real time)
│
▼
┌───────────────────┐
│ EventProcessor │ Decodes raw events into typed signals.
│ │ Fan-out: routes each event to relevant services.
└────────┬──────────┘
│ trade | create | complete
│
├──────────────────────────────────────────────────┐
│ │
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ CORE SERVICES │ │ GENESIS WATCHER │
│ │ │ │
│ CurveManager │ │ 60s observation │
│ TradeWriter │ │ 75-feature vector │
│ VelocityTracker │ │ ONNX inference │
│ CandleAggregator │ │ genesis_signal → │
│ WalletDiscovery │ │ signal channel │
│ WalletEnrichment │ └─────────────────────┘
│ OutcomeTracker │
│ CreatorTracker │
│ BotDetector │
│ RiskScorer │
│ DataArchiver │
│ MaintenanceService │
└─────────┬───────────┘
│
▼
┌─────────────────────────┐
│ PHASE 1 — SCORING │
│ │
│ PeakTracker │ Tracks 1h/4h/24h price peaks per signal.
│ PnlCalculator │ Realised PnL, win rate, hold times.
│ FeatureComputer │ 30-min feature roll-up per active wallet.
│ WalletScorer │ 7-component alpha score (0–100).
└─────────┬───────────────┘
│
▼
┌─────────────────────────┐
│ PHASE 2 — INTELLIGENCE │
│ │
│ SignalScorer │ Composite signal quality score.
│ TokenLifecycle │ 8-state lifecycle classifier (60s cadence).
│ BundleDetector │ 5s time-bucket cluster detection.
│ CreatorRiskScorer │ Rug rate, insider pct, serial detection.
│ CoOccurrence │ Wallet pair co-buy frequency graph.
│ GraphBuilder │ Graph analysis (hourly).
└─────────┬───────────────┘
│
▼
┌─────────────────────────────────────┐
│ PHASE 3 — ML & ADVANCED INTEL │
│ │
│ MlInference (5s cadence) │ 68-feature ONNX scoring.
│ AntiSignalEmitter (30s cadence) │ Multi-trigger adversarial detection.
│ DeepDiveWorker │ Enriched wallet analysis.
│ CopyTradeDetector (15m cadence) │ 3-type copy-trade classification.
│ OperatorDetector │ Coordinated operator identification.
│ AlphaDecayTracker (60m cadence) │ Per-wallet signal decay curves.
│ SignalCrowdingDetector (60s) │ Crowding ratio → score penalty.
│ MarketRegimeDetector (10m) │ 4-state regime classification.
│ ModelMonitor │ Live model drift detection.
└─────────┬───────────────────────────┘
│
│ signal channel (real time)
▼
┌─────────────────────────┐
│ LIVE TRADER │
│ │
│ InlineScorer │ ONNX inference inline (no DB round-trip).
│ PortfolioManager │ Phase-gated positions + circuit breakers.
│ TradeExecutor │ Bonding curve execution, atomic bundles.
│ ExitMonitor │ 3s poll: TP / SL / timeout / anti-signal.
└─────────────────────────┘
Data stores
| Store | Role |
|---|
| Database | Primary store for all trades, signals, wallet profiles, ML scores, detected bundles, copy-trade pairs, regime snapshots, and live trade history. Trades table is monthly-partitioned for query performance. |
| Cache layer | Real-time pub/sub channel for signal fan-out to the live trader; key-value cache for wallet stats, crowding ratios, market regime, and bonding curve state. Also maintains the tracked wallet and known bot sets. |
| Long-term archive | Raw trade data older than 60 days is automatically archived for storage efficiency. |
| ONNX model files | Loaded at startup and hot-reloaded every 5 minutes. Stored alongside metadata files describing features, calibration parameters, and PR-AUC. |
Concurrency model
Every background service follows the same pattern: a timed loop that checks a running flag before each cycle, skipping if the previous run hasn’t finished. This prevents overlapping database queries under load without requiring a separate job queue. Memory usage is monitored and logged after every run.
Inter-service communication
Services communicate in two ways.
Database reads — most intelligence services read each other’s output from the database. For example, MlInference reads WalletScorer alpha scores; AntiSignalEmitter reads BundleDetector results.
Signal channel — the real-time bus for the live trader. SignalEmitter, AntiSignalEmitter, and GenesisWatcher all publish to it. The live trader subscribes to all three types. The API server streams the channel to connected clients via Server-Sent Events.