A sophisticated Ethereum blockchain monitoring and trading bot designed to detect new token launches, analyze trading patterns, and identify expert trader wallets on Uniswap V2. This bot provides real-time monitoring capabilities for token liquidity events, trading activities, and automated tax calculation for potential trading opportunities.
- Real-time Liquidity Detection: Monitors Uniswap V2 factory for new token pair creation events
- Trading Event Detection: Tracks trading start events and liquidity additions from mempool
- Expert Trader Identification: Analyzes trading patterns to identify successful wallet addresses
- Tax Calculation: Automated buy/sell tax analysis for tokens
- Buy Count Tracking: Monitors trading volume and activity patterns
- Contract Analysis: Extracts function signatures from verified and unverified contracts
- Liquidity Detection: Real-time monitoring of new token pair creation
- Trading Event Detection: Mempool monitoring for trading start events
- Trader Wallet Analysis: Expert trader identification and tracking
- Tax Analysis: Automated calculation of buy/sell taxes
- Volume Analysis: Trading volume and activity pattern tracking
- Node.js (v14 or higher)
- MongoDB database
- Ethereum RPC endpoint (WebSocket recommended)
- Etherscan API key
- Private key for testing (optional)
-
Clone the repository
git clone <repository-url> cd eth-snipping-bot
-
Install dependencies
npm install
-
Environment Setup Create a
.envfile in the root directory:RPC_WSS_URL=wss://your-ethereum-websocket-endpoint VIRTUAL_RPC_URL=wss://your-virtual-rpc-endpoint MONGODB_URL=mongodb://localhost:27017/eth-snipping-bot ETHERSCAN_API=your-etherscan-api-key
# Start the main application
npm start
# Monitor liquidity events
npm run liquidity
# Monitor trading events
npm run trading_event
# Monitor trader wallets
npm run trader_walletnode modules/detect_liquidity.jsMonitors Uniswap V2 factory for new token pair creation events and displays:
- Pair address
- ETH and token balances
- Token information (name, symbol, decimals, total supply)
- Creation timestamp
node modules/detect_trading_event.jsMonitors mempool for trading-related transactions:
openTrading()andsetTrading(bool)eventsaddLiquidityETH()events- Real-time transaction analysis
node modules/detect_trader_wallet.jsAnalyzes trading patterns to identify expert traders:
- Tracks wallet addresses with successful trading history
- Monitors front-running activities
- Calculates expert level based on trading success
- Stores data in MongoDB
node modules/calc_tax_amount.jsCalculates buy/sell taxes for tokens:
- Simulates buy/sell transactions
- Analyzes transfer events to determine tax rates
- Provides detailed tax percentage calculations
eth-snipping-bot/
├── common/
│ └── common.js # Shared utility functions
├── constants/
│ ├── abi/
│ │ ├── ERC20.json # ERC20 token ABI
│ │ ├── uniswapV2Factory.json
│ │ └── uniswapV2Router.json
│ └── constants.js # Contract addresses and constants
├── modules/
│ ├── calc_tax_amount.js # Tax calculation module
│ ├── detect_liquidity.js # Liquidity detection
│ ├── detect_trader_wallet.js # Trader analysis
│ ├── detect_trading_event.js # Trading event detection
│ ├── get_buy_count.js # Buy count tracking
│ ├── get_contract_function.js # Contract analysis
│ └── get_correct_eth.js # ETH calculation utilities
├── index.js # Main application entry point
├── package.json
└── README.md
| Variable | Description | Required |
|---|---|---|
RPC_WSS_URL |
Ethereum WebSocket RPC endpoint | Yes |
VIRTUAL_RPC_URL |
Virtual RPC for testing | Yes |
MONGODB_URL |
MongoDB connection string | Yes |
ETHERSCAN_API |
Etherscan API key | Yes |
The bot is configured to work with:
- Uniswap V2 Factory:
0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f - Uniswap V2 Router:
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D - WETH:
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
{
address: String, // Wallet address
eth_balance: String, // Current ETH balance
last_block: Number, // Last block number
front_running: Number, // Front-running count
expert_level: Number, // Expert level score
trading_count: Number // Total trading count
}- Private Key Management: Never commit private keys to version control
- API Key Security: Keep your Etherscan API key secure
- Network Security: Use secure RPC endpoints
- Testing: Always test on testnets before mainnet usage
This bot is for educational and research purposes only. Users are responsible for:
- Complying with local regulations
- Understanding the risks of automated trading
- Ensuring proper authorization for any trading activities
- Being aware of potential MEV (Maximal Extractable Value) implications
-
Connection Errors
- Verify RPC endpoint URLs
- Check network connectivity
- Ensure WebSocket connections are supported
-
MongoDB Connection
- Verify MongoDB is running
- Check connection string format
- Ensure database permissions
-
API Rate Limits
- Monitor Etherscan API usage
- Implement rate limiting if needed
- Consider upgrading API plan
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Use WebSocket connections for real-time monitoring
- Implement proper error handling and reconnection logic
- Monitor memory usage for long-running processes
- Consider using connection pooling for database operations
- Implement proper logging for debugging and monitoring
- Support for Uniswap V3
- Multi-chain support (BSC, Polygon, etc.)
- Advanced MEV detection
- Machine learning for trader pattern analysis
- Web interface for monitoring and control
- Alert system for specific events
- Historical data analysis tools
Disclaimer: This software is provided for educational purposes only. Trading cryptocurrencies involves substantial risk of loss and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade, you should carefully consider your investment objectives, level of experience, and risk appetite.