Skip to content

Realtime mempool signal analyzer (NEW_ACCOUNT_VALUE) with Redis streaming.

Notifications You must be signed in to change notification settings

kyunghoon02/mempool-radar-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Mempool Radar Engine (The Brain)

Mempool Radar Engine is the central analysis hub of the Mempool Radar Ecosystem. It polls real-time transaction data from the custom Geth sensor (mempool-radar-core) and performs threat detection and network pressure calculations.

✅ Key Roles

  1. Data Aggregation: Polls the txpool_getMempoolTraffic RPC from the Core node every 500ms.
  2. Threat Detection (Primary Signal): Flags high-value transfers from newly seen accounts by combining mempool data with Indexer reputation checks.
  3. Gas Estimation: Calculates a percentile-based recommended fee using a rolling window of recent mempool samples.
  4. Pub/Sub Messaging: Broadcasts processed analytics to Redis channels for real-time dashboards.

🚨 Alert Types

Type Trigger Description
HIGH_TPS_SPAM Same address sends ≥ 50 tx/min Potential spam/DDoS behavior
MEV_BOT_ACTIVITY Gas fee cap == 0 Likely private relay or MEV bot
NEW_ACCOUNT_VALUE New account + value ≥ NEW_ACCOUNT_MIN_WEI High-value transfer from newly seen address

✅ Primary Signal

New Account + High-Value Transfer

  • Uses real-time mempool data (txpool_getMempoolTraffic)
  • Verifies "new account" via Indexer reputation (/api/reputation/:address)
  • Triggers when value >= NEW_ACCOUNT_MIN_WEI

🧰 Tech Stack

  • Language: Go 1.24
  • Communication: JSON-RPC (Core)
  • Messaging: Redis (Pub/Sub & Lists)

⚙️ Configuration (Environment Variables)

Variable Description Default
GETH_URL URL of the Geth node http://localhost:8545
REDIS_ADDR Redis connection string localhost:6379
INDEXER_URL URL of the Indexer API (optional) http://localhost:8081
GAS_WINDOW_SECONDS Rolling window size for gas estimation 60
GAS_PERCENTILE Percentile used for recommendation (0-1) 0.8
NEW_ACCOUNT_MIN_WEI Minimum transfer value to flag new accounts (wei) 1000000000000000000
SPAM_COOLDOWN_SECONDS Cooldown per address for HIGH_TPS_SPAM alerts 120
SPAM_THRESHOLD_PER_MIN Transactions/min threshold for HIGH_TPS_SPAM 200
SPAM_ENABLED Enable/disable HIGH_TPS_SPAM alerts true

About

Realtime mempool signal analyzer (NEW_ACCOUNT_VALUE) with Redis streaming.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors