A high-performance cryptocurrency sniping bot designed for detecting and trading newly deployed tokens on Base blockchain with sub-second execution times.
- Ultra-Fast Detection: WebSocket-based token detection with deployer filtering
- Zero Fake Tokens: Only monitors trusted deployer addresses
- Immediate Swap Execution: Sub-second transaction submission
- Optimized Gas Configuration: Base chain optimized gas settings
- Real-time Monitoring: Live event detection with timestamps
βββ index.js # Main execution file
βββ utils/
β βββ ultra_fast_detector.js # Token detection engine
β βββ swap.js # Swap execution logic
βββ abi/
β βββ uniswapRouterABI.json # Uniswap router contract ABI
βββ scrap/ # Archive/backup files
βββ .env # Environment configuration
βββ package.json # Dependencies
βββ README.md # This file
npm install ethers dotenvCreate a .env file in the root directory:
# ============================================================================
# BLOCKCHAIN CONNECTION
# ============================================================================
# Base Chain WebSocket URL (Required)
# Get from: Alchemy, Infura, or other RPC provider
WSS_URL=wss://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY_HERE
# Alternative WebSocket URLs:
# WSS_URL=wss://base-mainnet.infura.io/ws/v3/YOUR_PROJECT_ID
# WSS_URL=wss://base.llamarpc.com
# ============================================================================
# WALLET CONFIGURATION
# ============================================================================
# Your wallet private key (KEEP THIS SECURE!)
# β οΈ NEVER share this or commit it to version control
# Format: 64-character hex string (with or without 0x prefix)
PRIVATE_KEY=your_64_character_private_key_here_without_0x_prefix
# ============================================================================
# SMART CONTRACT ADDRESSES
# ============================================================================
# Uniswap V2 Router on Base Chain
UNISWAP_ROUTER_ADDRESS=0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24
# ============================================================================
# OPTIONAL SETTINGS
# ============================================================================
# Node.js environment (optional)
NODE_ENV=production
# Logging level (optional)
LOG_LEVEL=infoSetup Steps:
- Copy the above content to a new
.envfile - Replace
YOUR_API_KEY_HEREwith your actual Alchemy/Infura API key - Replace
your_64_character_private_key_here_without_0x_prefixwith your wallet's private key - Keep the
.envfile secure and never commit it to version control
Before running the bot, approve unlimited VIRTUALS spending:
// This needs to be done once manually
await virtualsContract.approve(routerAddress, ethers.MaxUint256);const APPROVAL_AMOUNT = ethers.parseEther("100000000"); // 100M tokens
const AMOUNT_IN = ethers.parseEther("200"); // 200 VIRTUALS
const VIRTUALS_ADDRESS = "";const ULTRA_FAST_GAS = {
gasLimit: 250000,
maxFeePerGas: ethers.parseUnits('40', 'gwei'), // Adjust for Base chain
maxPriorityFeePerGas: ethers.parseUnits('20', 'gwei')
};node index.jsπ Starting...
β‘ Monitoring deployer:
π 0x1234abcd... | 2025-05-29T15:30:45.123Z
π Swap submitted: 0xabcd1234... | 2025-05-29T15:30:45.234Z
β
Approval submitted: 0xef567890...
π― Complete: 0x1234abcd...
- Only monitors events from trusted deployer
- Eliminates 90-99% of false positives
- 5-10x faster detection
- Submits transactions immediately
- Doesn't wait for confirmation
- Sub-second execution times
- Direct callback execution
- Zero unnecessary logging in critical path
- Minimal memory allocation
- Single event listener
- No polling or API calls
- Real-time event detection
- Never commit your
.envfile - Keep private keys secure
- Test with small amounts first
- Base chain uses very low gas (0.001-0.01 gwei)
- Current settings are aggressive for speed
- Adjust based on network conditions
- VIRTUALS tokens in wallet
- ETH for gas fees
- Unlimited VIRTUALS approval to router
- Test thoroughly before live trading
- Monitor gas prices
- Start with small amounts
- Have exit strategy ready
-
"Insufficient allowance" error
- Solution: Pre-approve VIRTUALS token spending
-
"Gas price too high" error
- Solution: Reduce gas settings in
ULTRA_FAST_GAS
- Solution: Reduce gas settings in
-
No token detection
- Check WebSocket connection
- Verify deployer address
- Confirm event topic
-
Slow execution
- Check network latency
- Optimize gas settings
- Verify no unnecessary logging
- Detection timestamp
- Transaction submission time
- Token address detection
- Block number tracking
- Monitor execution times
- Track successful swaps
- Analyze gas usage
This bot is for educational purposes. Cryptocurrency trading involves significant risk. Always:
- Test thoroughly
- Start with small amounts
- Understand the risks
- Trade responsibly
Built for maximum speed and precision on Base blockchain β‘