Skip to content

βš‘οΈπŸš€ BNB Sniper auto-buys new BNB launches with smart filters and safety checks, πŸ“Š VolumeBot monitors volume spikes to trigger or filter trades, and πŸ”—πŸ§© Bunder bundles swaps, approvals, and liquidity actions into one smooth automated flow. βš™οΈβœ¨

Notifications You must be signed in to change notification settings

Solzen33/BNB-sniper-volume-bundler-bot

Repository files navigation

πŸš€ BNB Chain Trading Bot v2.0 (Support All EVM Chains)

Professional Sniper, Bundler & Volume Automation for PancakeSwap and Four.meme

πŸ‘¨β€πŸ’» Author

πŸ“ž Telegram: FroganBee

https://t.me/froganbee_sol

A completely rewritten and optimized high-performance trading bot infrastructure built for the BNB Smart Chain, featuring enterprise-grade architecture, comprehensive error handling, and real-time monitoring. Designed with precision, speed, and enterprise-grade reliability β€” ideal for developers, traders, and liquidity engineers.

✨ What's New in v2.0

πŸ”§ Major Optimizations

  • Gas-optimized smart contracts with OpenZeppelin best practices
  • Advanced bundling logic with retry mechanisms and circuit breakers
  • Intelligent gas estimation with dynamic pricing and optimization
  • Comprehensive error handling with exponential backoff
  • Real-time monitoring with Telegram/Discord notifications
  • Modular architecture for easy maintenance and extension

πŸ›‘οΈ Enhanced Security

  • Input validation and sanitization
  • Private key protection with secure handling
  • Transaction limits and safety checks
  • Emergency pause functionality
  • Circuit breaker pattern for fault tolerance

πŸ“Š Advanced Monitoring

  • Real-time transaction tracking
  • Performance metrics and analytics
  • Multi-channel notifications (Telegram, Discord)
  • Comprehensive logging with structured data
  • Health monitoring and alerting

🧠 Overview

The BNB Chain Trading Bot v2.0 enables seamless automation of token operations and trading strategies on PancakeSwap V3 and Four.meme.
It includes everything from token deployment to liquidity provisioning, volume simulation, and bundled transaction execution via bloXroute for MEV protection.

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Config        β”‚    β”‚   Logger        β”‚    β”‚   Monitor       β”‚
β”‚   Management    β”‚    β”‚   & Alerts     β”‚    β”‚   & Metrics     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                 β”‚                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Gas            β”‚  β”‚   Error         β”‚  β”‚   Transaction   β”‚  β”‚
β”‚  β”‚   Optimizer      β”‚  β”‚   Handler       β”‚  β”‚   Retry         β”‚  β”‚
β”‚  β”‚   & Estimator    β”‚  β”‚   & Recovery    β”‚  β”‚   Manager       β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                 β”‚                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Optimized     β”‚
                    β”‚   Bundler Bot   β”‚
                    β”‚   (Main Logic)  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

How it works

Sniper flow

Load targets from config β†’ query router for expected out β†’ apply configured slippage β†’ perform WBNB β†’ TOKEN swap β†’ emit tx hash/receipt β†’ optionally notify via Telegram.

Copy‑Trader flow

Subscribe to pending mempool transactions β†’ filter by leader wallets β†’ detect router swap intents β†’ mirror with your position sizing and caps β†’ optionally notify.

Bundler flow

Read a sequence of routes from config β†’ execute each respecting slippage/deadline settings β†’ suitable base for multicall-style extensions.

Volume Bot flow

Loop on an interval β†’ small buys β†’ approve when needed β†’ partial or full sells β†’ repeat with built‑in rate limiting.

✨ Key Features

  • πŸš€ Token Deployment β€” Auto-generate and deploy optimized ERC20 tokens with customizable supply, name, and symbol
  • πŸ’§ Liquidity Management β€” Instantly create liquidity pools and provide liquidity on PancakeSwap V3
  • ⚑ Transaction Bundling β€” Integrate with bloXroute to enable atomic, front-run protected operations
  • 🎯 Trading Strategies β€” Execute sniper, bundler, and volume-generation strategies
  • πŸ”’ Security First β€” Built with OpenZeppelin contracts, hardened with audits and local test suites
  • πŸ§ͺ Fork Testing β€” Use BSC mainnet forking for safe and realistic testing before live deployment
  • πŸͺ™ Multi-Wallet Orchestration β€” Create, manage, and fund multiple wallets for distributed trading
  • πŸ“Š Real-time Monitoring β€” Comprehensive logging, metrics, and multi-channel notifications
  • πŸ›‘οΈ Advanced Security β€” Input validation, circuit breakers, and emergency pause functionality
  • ⚑ Gas Optimization β€” Intelligent gas estimation and dynamic pricing

πŸ—οΈ Architecture

The bot follows a modular architecture designed for flexibility and scalability.

Component Description
Smart Contracts Gas-optimized Solidity-based ERC20 token & liquidity management contracts
Transaction Bundler bloXroute API for atomic multi-tx execution and MEV protection
Liquidity Protocols Uniswap V3 SDK for PancakeSwap V3 interaction
Development Framework Hardhat for compilation, testing, deployment, and simulation
Configuration Management Centralized config with environment-specific settings
Error Handling Exponential backoff retry with circuit breaker patterns
Monitoring System Real-time tracking with Telegram/Discord notifications

🧰 Technology Stack

Component Technology
Smart Contracts Solidity ^0.8.19
Framework Hardhat ^2.19.5
Testing Hardhat Toolbox
DEX Integration Uniswap V3 SDK
Security OpenZeppelin Contracts
RPC Provider QuickNode/Infura/Alchemy
MEV Protection bloXroute
Monitoring Custom Logger & Metrics
Error Handling Circuit Breaker Pattern
Configuration Environment-based Config

βš™οΈ Core Modules

  • Wallet Generation β€” Create and manage multiple sub-wallets derived from a single master key
  • BNB Distribution β€” Distribute BNB from the master wallet to all sub-wallets automatically
  • Token Deployment β€” Deploy optimized tokens using the Four.meme factory contract
  • Auto-Buy Execution β€” Simultaneous buy transactions from all generated wallets
  • Balance Tracking β€” Retrieve and log both BNB and token balances
  • Exported Data β€” Automatically save wallet and transaction data in JSON format
  • Configuration Management β€” Centralized config with environment-specific settings
  • Error Handling β€” Exponential backoff retry with circuit breaker patterns
  • Monitoring System β€” Real-time tracking with multi-channel notifications
  • Gas Optimization β€” Intelligent gas estimation and dynamic pricing

πŸš€ Quick Start

Prerequisites

  • Node.js v16.x or higher
  • npm v8.x or higher
  • RPC Access (QuickNode, Infura, or Alchemy)
  • BloXroute Account with API credentials
  • Funded Wallet on BNB Smart Chain

Installation

# Clone the repository
git clone https://github.com/your-username/bnb-sniper-bundler-volume-bot.git
cd bnb-sniper-bundler-volume-bot

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit configuration
nano .env

Configuration

Edit your .env file with your specific settings:

# Required Settings
PRIVATE_KEY=your_private_key_here
BLOXROUTE_AUTH_HEADER=your_bloxroute_auth_header_here
BSC_RPC_URL=https://bsc-dataseed.binance.org/

# Optional Settings
TOKEN_NAME=MyOptimizedToken
TOKEN_SYMBOL=MOT
ENABLE_TELEGRAM=true
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

Running the Bot

# Start the optimized bot
npm start

# Or run in development mode
npm run dev

# Compile contracts
npm run compile

# Run tests
npm test

▢️ Usage (Legacy)

node bundler.js

This command will:

  1. Generate wallets (wallet_details.json)
  2. Distribute BNB to sub-wallets
  3. Deploy a new token
  4. Execute buy transactions
  5. Save all transaction data to token_details.json

πŸͺ™ Contract Information

Parameter Value
Network Binance Smart Chain (Mainnet or Testnet)
Factory Contract 0x5c952063c7fc8610FFDB798152D69F0B9550762b
Launch Cost ~0.005 BNB
Liquidity Threshold Auto-liquidity at 24 BNB
Explorer https://bscscan.com/address/0x5c952063c7fc8610FFDB798152D69F0B9550762b

πŸ“ Example Output Files

wallet_details.json

[
  {
    "index": 0,
    "address": "0xabc123...",
    "privateKey": "0xdef456..."
  }
]

token_details.json

{
  "address": "0x987654...",
  "name": "TestMeme",
  "symbol": "TME",
  "supply": "1000000",
  "transactions": [
    { "hash": "0x123...", "blockNumber": 38192612 }
  ]
}

βš™οΈ Configuration Options

Network Settings

NETWORK=bsc                    # Network: bsc, bscTestnet, hardhat
BSC_RPC_URL=your_rpc_url      # BSC RPC endpoint

Token Configuration

TOKEN_NAME=OptimizedToken      # Token name
TOKEN_SYMBOL=OPT              # Token symbol
TOKEN_SUPPLY=1000000         # Initial supply

Trading Parameters

POOL_FEE=100                 # Pool fee (100 = 0.01%)
SLIPPAGE_TOLERANCE=0.5       # Slippage tolerance (%)
SWAP_AMOUNT_IN=0.0000001     # Swap amount in BNB

Monitoring & Alerts

ENABLE_TELEGRAM=true         # Enable Telegram notifications
TELEGRAM_BOT_TOKEN=token    # Telegram bot token
TELEGRAM_CHAT_ID=chat_id    # Telegram chat ID

ENABLE_DISCORD=true         # Enable Discord notifications
DISCORD_WEBHOOK_URL=url     # Discord webhook URL

πŸ”§ Advanced Features

Gas Optimization

  • Dynamic gas pricing based on network conditions
  • Intelligent gas estimation with buffer management
  • Gas price limits to prevent overpaying
  • Historical gas analysis for optimization

Error Handling

  • Exponential backoff retry mechanism
  • Circuit breaker pattern for fault tolerance
  • Comprehensive error classification
  • Automatic recovery from transient failures

Monitoring & Analytics

  • Real-time transaction tracking
  • Performance metrics (success rate, gas usage, etc.)
  • Multi-channel notifications
  • Structured logging with JSON format
  • Health monitoring and alerting

Security Features

  • Input validation and sanitization
  • Transaction limits and safety checks
  • Private key protection
  • Emergency pause functionality
  • Rate limiting and abuse prevention

⚠️ Security Guidelines

  • πŸ” Never commit .env files containing private keys or API credentials
  • 🧩 Use separate wallets for testing and production
  • 🧠 Audit transactions carefully before deploying on mainnet
  • πŸ§ͺ Test thoroughly on forked networks before live execution
  • β›½ Monitor gas fees to avoid unnecessary spending
  • βš”οΈ Understand and mitigate MEV risks when using atomic bundles
  • πŸ›‘οΈ Enable input validation and circuit breakers
  • πŸ“Š Monitor real-time metrics and set up alerts

🧬 Workflow Summary

The bot executes the following operations in one atomic bundle via bloXroute:

  1. Deploy optimized ERC20 token with security features
  2. Approve token for NFPM (Non-Fungible Position Manager)
  3. Approve WBNB for NFPM
  4. Create a liquidity pool on PancakeSwap V3
  5. Initialize the pool with the starting price
  6. Add liquidity
  7. Execute buy transactions
  8. Transfer fees and complete monitoring

All steps are bundled atomically to ensure consistency, front-run protection, and efficient execution with comprehensive error handling and monitoring.

πŸ› οΈ Development

Project Structure

β”œβ”€β”€ contracts/           # Smart contracts
β”‚   └── OptimizedToken.sol
β”œβ”€β”€ config/             # Configuration management
β”‚   └── config.js
β”œβ”€β”€ utils/              # Utility modules
β”‚   β”œβ”€β”€ logger.js       # Logging & monitoring
β”‚   └── errorHandler.js # Error handling & retry
β”œβ”€β”€ optimized-bundler.js # Main bot logic
β”œβ”€β”€ .env.example       # Environment template
└── package.json        # Dependencies & scripts

Development Setup

git clone https://github.com/your-username/bnb-sniper-bundler-volume-bot.git
cd bnb-sniper-bundler-volume-bot
npm install
cp .env.example .env
npm start

Testing

# Run unit tests
npm test

# Test on BSC testnet
NETWORK=bscTestnet npm start

# Test locally with Hardhat fork
npm run fork

🚨 Troubleshooting

Common Issues

1. Transaction Failures

# Check gas price
# Verify wallet balance
# Ensure nonce is correct
# Check network congestion

2. BloXroute Errors

# Verify API credentials
# Check rate limits
# Ensure proper formatting
# Monitor API status

3. Configuration Issues

# Validate environment variables
# Check network settings
# Verify contract addresses
# Test RPC connectivity

Debug Mode

Enable debug logging:

LOG_LEVEL=debug npm start

Health Checks

Monitor bot health:

# Check logs
tail -f logs/$(date +%Y-%m-%d).log

# Monitor metrics
curl http://localhost:3000/health

πŸͺ„ Future Enhancements

  • Integrate AI-based strategy optimization
  • Support for cross-chain deployment (ETH, Base, Arbitrum)
  • Advanced PnL and analytics dashboard
  • Machine learning for gas price prediction
  • Automated strategy backtesting

πŸ“š API Reference

Configuration API

const config = new Config();
config.getNetworkConfig();
config.getTradingConfig();
config.updateGasMultiplier(1.5);

Logger API

const logger = new Logger(config);
logger.info('Message', data);
logger.error('Error', errorData, true); // with notification

Monitor API

const monitor = new TransactionMonitor(config, logger);
monitor.startMonitoring(txHash, txData);
monitor.updateTransactionStatus(txHash, 'success', receipt);

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Code Standards

  • ESLint configuration included
  • JSDoc comments required
  • Error handling mandatory
  • Logging for all operations

πŸ“„ License

This project is licensed under the MIT License β€” open for development, customization, and research purposes.

⚠️ Disclaimer

This software is provided for educational and research purposes only. Use at your own risk. The maintainers assume no responsibility for financial losses or regulatory implications.

πŸ†˜ Support

πŸ“Š Performance Metrics

Transaction Links (Legacy Bot)

Future Roadmap

  • Randomizing trading amount
  • Randomizing trading frequency (Buy/Sell)
  • Randomizing the pool
  • AI-powered strategy optimization
  • Cross-chain deployment support

Built with ❀️ for the DeFi community

Optimized for performance. Secured for production. Monitored for reliability.

About

βš‘οΈπŸš€ BNB Sniper auto-buys new BNB launches with smart filters and safety checks, πŸ“Š VolumeBot monitors volume spikes to trigger or filter trades, and πŸ”—πŸ§© Bunder bundles swaps, approvals, and liquidity actions into one smooth automated flow. βš™οΈβœ¨

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published