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.

The ingestion layer is Alpha Leak’s entry point for all on-chain data. A persistent WebSocket connection to the Solana network subscribes to the Pump.fun program account, decodes every log into one of three typed event shapes, and fans each event out to the relevant downstream services — all without a message queue or intermediate store between receipt and processing.

WebSocket subscription

Chainstack RPC pool with automatic failover and per-key rate limits.

Event processing

EventProcessor fan-out routing for trade, create, and complete events.

Velocity tracking

Rolling Redis counters for 60s and 300s buy velocity per token.

WebSocket subscription

The WsSubscriber connects to a pool of Chainstack RPC endpoints and subscribes to the Pump.fun program at address 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P. Each key in the pool carries its own rate limit budget, and connections are automatically rotated when a key is exhausted or an endpoint becomes unhealthy.
ParameterValue
Program address6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
Rate limit per key3,000,000 RU / key
Max requests per second per key25 RPS
Failover behaviourAutomatic rotation to next healthy endpoint
Proxy supportPer-key geographic proxy layering
Incoming log messages are decoded from Pump.fun’s binary log format into one of three strictly typed event shapes before any downstream processing occurs.

Event types

Event typeTriggerKey fields
tradeAny buy or sell on a bonding curvemint, wallet, solAmount, tokenAmount, isBuy, virtual reserves
createA new token is launchedmint, name, symbol, uri, bondingCurve, creator
completeA token graduates to Raydium or PumpSwapmint, bondingCurve
If the pending backpressure counter exceeds 10, the subscriber logs a backlog warning and records the event in pipeline_stats. The metrics interval reports the current pending count every 30 seconds, making sustained throughput pressure easy to observe.

Event processing

The EventProcessor is the fan-out hub. Every decoded event passes through it, and it dispatches to the relevant services based on event type. There is no queue between the subscriber and the processor — dispatch happens inline.
When a new token is launched, three services are notified:
1

CurveManager initialises curve state

An in-memory bonding curve state object is created for the new mint address, ready to accept trade updates.
2

TradeWriter persists the token record

The token metadata (name, symbol, uri, creator, bondingCurve) is written to PostgreSQL immediately.
3

GenesisWatcher opens an observation window

A 60-second observation window starts for the new token. All trades during this window are captured for genesis ML scoring.

CurveManager

The CurveManager maintains a real-time in-memory state object for every active bonding curve token, keyed by mint address. This state is the authoritative source of truth for bonding curve prices during the pre-graduation phase — no database query is needed. Each state object tracks the following fields:
FieldDescription
Real SOL reservesActual SOL held in the bonding curve
Virtual SOL reservesVirtual reserve used for price calculation
Real token reservesActual tokens remaining in the curve
Virtual token reservesVirtual reserve used for price calculation
Buy / sell countsRunning totals of buy and sell transactions
Unique buyer countNumber of distinct buyer wallets
Total SOL volumeCumulative SOL traded
First buy walletWallet address of the earliest buyer
First buy timestampBlock time of the first buy
Graduation statusWhether the token has crossed the 85 SOL threshold
Curve state is mirrored into Redis at token:<mint> so the live trader’s exit monitor can read real-time prices without a database round-trip. The exit monitor polls every 3 seconds, so this mirror must stay current.
When a token’s real SOL reserves cross 85 SOL, CurveManager emits a graduation event, which triggers wallet discovery and, optionally, Birdeye token promotion.

Trade batching

The TradeWriter accumulates trades in an in-memory buffer rather than writing each one individually. The buffer is flushed to PostgreSQL when either condition is met:
  • The buffer reaches 200 events, or
  • 1 second has elapsed since the last flush
This batching strategy reduces database round-trips significantly during burst periods — for example, when a token goes viral and receives hundreds of trades per second — without adding perceptible latency from the perspective of the signal pipeline.
During sustained high-velocity events, the 1-second flush cadence means trade records are available in PostgreSQL within approximately 1 second of on-chain confirmation. Downstream services that read from the database (such as FeatureComputer) operate on 30-minute intervals and are not sensitive to this sub-second delay.

Backpressure handling

The WsSubscriber tracks a pending counter representing the number of events that have been received from the WebSocket but not yet fully processed by EventProcessor. If this counter exceeds 10, a backlog warning is logged and the event is recorded in pipeline_stats. The metrics reporting interval fires every 30 seconds and includes the current pending value, making it straightforward to identify whether the pipeline is keeping up with on-chain event volume or whether the processing chain has a bottleneck.
A sustained pending count above 10 indicates that the processing chain cannot keep up with inbound event volume. This is most likely caused by a slow database write or a downstream service holding the processing thread. Check pipeline_stats and the service timing logs if this condition persists.

Velocity tracking

The VelocityTracker maintains rolling counters in Redis, updated on every trade event. These counters are attached to every signal payload and are among the most important features in both the rule-based signal scorer and the ML models.
Redis keyDescription
buysLast60sNumber of distinct buy transactions in the last 60 seconds
buysLast300sNumber of distinct buy transactions in the last 300 seconds
solLast60sSOL volume bought in the last 60 seconds
A sharp spike in buysLast60s combined with a rising solLast60s is frequently the first observable signal that a token is gaining momentum. The TokenLifecycle classifier in Phase 2 uses these same counters to assign lifecycle states such as momentum and euphoria.

Phase 1: Wallet scoring

See how trade data feeds into feature computation and the 7-component alpha score.

Architecture overview

Full pipeline map from WebSocket ingestion to live on-chain execution.

Build docs developers (and LLMs) love