Skip to content

A TypeScript application that monitors Solana MEV bot purchase transactions in real-time and extracts token addresses and SOL amounts.

Notifications You must be signed in to change notification settings

echandsome/MEV-Bot-Transaction-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Solana MEV Bot Transaction Monitor

A TypeScript application that monitors Solana MEV bot purchase transactions in real-time and extracts token addresses and SOL amounts.

πŸ“‹ Table of Contents

✨ Features

🎯 Core Features

  • Real-time Monitoring: Detects all transactions from MEV bot addresses in real-time
  • Purchase Transaction Detection: Accurately identifies BUY transactions using various methods
  • Data Extraction: Automatically extracts token addresses, SOL amounts, and transaction signatures
  • CSV Storage: Automatically saves all data to CSV files
  • Stability: Efficient polling method to avoid RPC request limits

πŸ” Monitoring Targets

Currently monitoring the following MEV bots:

  • 4vJfp62jEzcYFnQ11oBJDgj6ZFrdEwcBBpoadNTpEWys
  • E6YoRP3adE5XYneSseLee15wJshDxCsmyD2WtLvAmfLi

πŸ“Š Detection Methods

  1. Token Transfer Detection: Tokens received by the bot (high confidence)
  2. SOL Transfer Detection: SOL paid by the bot (medium confidence)
  3. DEX Swap Detection: Jupiter, Raydium, Orca, Whirlpool transactions
  4. Program Call Analysis: Other purchase-related program calls

πŸ›  Installation

Prerequisites

  • Node.js 16.0.0 or higher
  • npm or yarn

Installation Steps

  1. Clone Repository
git clone https://github.com/echandsome/MEV-Bot-Transaction-Monitor.git
cd MEV-Bot-Transaction-Monitor
  1. Install Dependencies
npm install
  1. Build (Optional)
npm run build

πŸš€ Usage

Basic Execution

npm start

Development Mode

npm run dev

Connection Test

npm run debug

Execution Example

$ npm start

πŸš€ Starting Improved MEV Bot Monitor...
πŸ“‘ Using polling method to avoid rate limits
🎯 Monitoring addresses: [
  '4vJfp62jEzcYFnQ11oBJDgj6ZFrdEwcBBpoadNTpEWys',
  'E6YoRP3adE5XYneSseLee15wJshDxCsmyD2WtLvAmfLi'
]
πŸ“Š CSV output file: D:\Workspace\2025\06\MEV-Bot-Transaction-Monitor\mev_bot_transactions.csv
⏰ Check interval: 30 seconds
βœ… Monitor started successfully. Press Ctrl+C to stop.

πŸ” Checking transactions for: 4vJfp62jEzcYFnQ11oBJDgj6ZFrdEwcBBpoadNTpEWys
πŸ“Š Found 3 recent transactions

πŸ†• New transaction: 3H2kwXyp1zccaUSWayFVHWLjBWzvxirrSHMDt5kEoHncffo6fwUxzuh9S3JFcKUFX1HSn1UJE3uQELM3jd3jZKez
πŸ” Analyzing transaction: 3H2kwXyp1zccaUSWayFVHWLjBWzvxirrSHMDt5kEoHncffo6fwUxzuh9S3JFcKUFX1HSn1UJE3uQELM3jd3jZKez
❌ Not a buy transaction

πŸ“Š Output Format

CSV File Structure

Data is saved to mev_bot_transactions.csv in the following format:

Column Description Example
Timestamp Transaction detection time 2025-01-01T12:00:00.000Z
Transaction Signature Transaction signature 4v1wjvYNQoxEf8Ttg5tDtyHJ4DSPQPx6jBFbynXkJxXfVjUY199uVJobgz5h1eYffDGxW5TFJi6HUJ688tH1q3cE
MEV Bot Address MEV bot address 4vJfp62jEzcYFnQ11oBJDgj6ZFrdEwcBBpoadNTpEWys
Token Address Purchased token address 8jVcgXXUReoiFCDzDMEhftCvA7HWqLX6rNmZ6AxLpump
SOL Amount SOL amount paid 4.213801967
USD Value USD value (to be added in future)

Console Output Example

βœ… BUY TRANSACTION DETECTED!
   Token: 8jVcgXXUReoiFCDzDMEhftCvA7HWqLX6rNmZ6AxLpump
   SOL Amount: 4.213801967
   Confidence: high
πŸ“ Saved to CSV file

βš™οΈ Configuration

Configuration File (src/config.ts)

export const CONFIG = {
  // MEV bot addresses to monitor
  MEV_BOT_ADDRESSES: [
    '4vJfp62jEzcYFnQ11oBJDgj6ZFrdEwcBBpoadNTpEWys',
    'E6YoRP3adE5XYneSseLee15wJshDxCsmyD2WtLvAmfLi'
  ],
  
  // Solana RPC endpoint
  RPC_URL: 'https://api.mainnet-beta.solana.com',
  
  // Connection commitment level
  COMMITMENT: 'confirmed',
  
  // CSV filename
  CSV_FILENAME: 'mev_bot_transactions.csv',
  
  // DEX program IDs
  DEX_PROGRAM_IDS: [
    'JUP4Fb2cqiRUcaTHdrPC8h2gNsA2ETXiPDD33WcGuJB', // Jupiter
    '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8', // Raydium
    '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM', // Orca
    'whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc'   // Whirlpool
  ]
};

Adding New MEV Bots

Add new addresses to the MEV_BOT_ADDRESSES array in src/config.ts:

MEV_BOT_ADDRESSES: [
  '4vJfp62jEzcYFnQ11oBJDgj6ZFrdEwcBBpoadNTpEWys',
  'E6YoRP3adE5XYneSseLee15wJshDxCsmyD2WtLvAmfLi',
  'YOUR_NEW_MEV_BOT_ADDRESS'  // Add new address
]

Changing RPC Endpoint

To use a more stable RPC service:

RPC_URL: 'https://your-rpc-endpoint.com'

πŸ”§ Troubleshooting

Common Issues

1. RPC Request Limit (429 Too Many Requests)

Symptom: "429 Too Many Requests" error message Solution:

  • Current polling method already solves this issue
  • Requests are made at 30-second intervals to avoid limits

2. Connection Error

Symptom: "Connection failed" or "Network error" Solution:

# Test connection
npm run debug

# Use different RPC endpoint
# Change RPC_URL in src/config.ts

3. CSV File Not Created

Symptom: mev_bot_transactions.csv file doesn't exist Solution:

# Check permissions
ls -la mev_bot_transactions.csv

# Create file manually
echo "Timestamp,Transaction Signature,MEV Bot Address,Token Address,SOL Amount,USD Value" > mev_bot_transactions.csv

4. Transactions Not Detected

Symptom: Only "No new transactions found" messages Solution:

  • Verify that MEV bots are actually active
  • Check if RPC endpoint is working properly
  • Verify network connection status

Debugging

Check Connection Status

npm run debug

Adjust Log Level

Change logging settings in src/config.ts:

LOGGING: {
  ENABLE_DEBUG: true,        // Enable debug messages
  SHOW_ALL_TRANSACTIONS: false,  // Show all transactions
  SHOW_CONFIDENCE_LEVELS: true   // Show confidence levels
}

πŸ—οΈ Project Structure

MEV-Bot-Transaction-Monitor/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ improvedMonitor.ts    # Main monitoring logic
β”‚   β”œβ”€β”€ transactionParser.ts  # Transaction analysis logic
β”‚   β”œβ”€β”€ config.ts            # Configuration file
β”‚   └── debug.ts             # Debugging tools
β”œβ”€β”€ package.json             # Project settings
β”œβ”€β”€ tsconfig.json           # TypeScript settings
β”œβ”€β”€ README.md              # This file
└── mev_bot_transactions.csv # Output file (auto-generated)

πŸ› οΈ Tech Stack

  • Language: TypeScript
  • Runtime: Node.js
  • Blockchain: Solana Web3.js
  • Data Storage: CSV
  • Package Manager: npm

Key Dependencies

  • @solana/web3.js: Solana blockchain connection
  • @solana/spl-token: SPL token processing
  • csv-writer: CSV file writing
  • ts-node: TypeScript execution

πŸ“ˆ Performance Optimization

Currently Implemented Optimizations

  • Polling Method: Efficient polling instead of WebSocket
  • Duplicate Removal: Skip already processed transactions
  • Retry Logic: Automatic retry on failure
  • Batch Processing: Process 10 at a time

Additional Optimization Options

  • Memory Management: Clean up old transaction hashes
  • Parallel Processing: Monitor multiple bots simultaneously
  • Caching: Cache transaction data

πŸ”’ Security Considerations

  • Read-Only: This tool only performs read-only operations
  • No Private Keys Required: No private keys or seed phrases needed
  • Public Data: Only accesses public blockchain data

πŸ“ License

ISC License

🀝 Contributing

Please submit bug reports or feature suggestions through issues.

πŸ“ž Support

If you encounter problems, check the following:

  1. Troubleshooting section in this README
  2. GitHub issues page
  3. Run connection test: npm run debug

⚠️ Warning: This tool is for educational and research purposes only. Please conduct thorough testing before using it for actual trading.

About

A TypeScript application that monitors Solana MEV bot purchase transactions in real-time and extracts token addresses and SOL amounts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published