solship/Bonkfun-bundler-trading
A high-performance bonkfun trading bot for atomic multi-wallet bundle trading on Solana, featuring Jito bundle execution, Raydium SDK v2 integration, and comprehensive bonkfun token creation with automated trading strategies
πΆ Bonk.fun Multi-Wallet Bundle Trading Bot v2.0.0
A high-performance, production-ready Solana bundle trading bot for bonk.fun and bonk.fun-style token launches. This bot uses Jito bundles to create tokens and execute multi-wallet buys in a single atomic block. Built with Raydium SDK v2, it's designed for seamless one-block execution and fast inclusion.
π Key Features
- β Atomic Multi-Wallet Bundling - Execute trades from 12+ wallets in a single block
- β Jito Bundle Integration - Reliable bundle submission with multi-endpoint redundancy
- β Raydium SDK v2 - Latest SDK for optimal performance and compatibility
- β Vanity Address Generation - Create memorable token addresses with custom suffixes
- β Comprehensive Error Handling - Robust error recovery and validation
- β Detailed Logging - Real-time monitoring and debugging capabilities
- β Configuration Validation - Automatic validation of all settings
- β IPFS Metadata Upload - Automatic token metadata and image upload
π Performance Metrics
| Metric | Value |
|---|---|
| Max Wallets per Bundle | 12+ (configurable) |
| Transaction Success Rate | >99% |
| Bundle Execution Time | <2 seconds |
| Memory Usage | <100MB |
| CPU Usage | <10% |
ποΈ Architecture Overview
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Configuration β β Core Logic β β Execution β
β β β β β β
β β’ Environment βββββΆβ β’ Token CreationβββββΆβ β’ Jito Bundles β
β β’ Validation β β β’ SOL Distributionβ β β’ Multi-Endpointβ
β β’ Constants β β β’ LUT Managementβ β β’ Confirmation β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Utilities β β Raydium SDK β β Monitoring β
β β β β β β
β β’ File I/O β β β’ Launchpad β β β’ Logging β
β β’ Math Utils β β β’ Swap Logic β β β’ Error Trackingβ
β β’ Address Gen β β β’ Pool Mgmt β β β’ Performance β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
π Project Structure
Bonkfun-Bundler-Bonk.fun-Bundler/
βββ π src/ # Source and entry points
β βββ π index.ts # Main entry point (bundle flow)
β βββ π oneWalletBundle.ts # Single wallet bundle mode
β βββ π closeLut.ts # Lookup table management
β βββ π gather.ts # Data collection utilities
β βββ π status.ts # Status monitoring
β βββ π test.ts # Testing utilities
β βββ π buysell.ts # Buy/sell operations
β βββ π main.ts # Core business logic (distribution, LUT, buy)
β βββ π token.ts # Token creation and metadata
β βββ π config.ts # Raydium SDK configuration
β βββ π types.ts # TypeScript type definitions
β βββ π util.ts # Core utilities
β βββ π vanity.ts # Vanity address generation (see utils/)
βββ π constants/ # Configuration constants
β βββ π constants.ts # Environment variables
β βββ π index.ts # Constants exports
βββ π executor/ # Transaction execution
β βββ π jito.ts # Jito bundle executor
β βββ π legacy.ts # Legacy transaction executor
βββ π utils/ # Utility functions
β βββ π utils.ts # General utilities
β βββ π logger.ts # Logging utilities
β βββ π swapOnlyAmm.ts # AMM swap utilities
β βββ π index.ts # Utils exports
βββ π image/ # Token images
βββ π package.json # Dependencies
βββ π tsconfig.json # TypeScript configuration
βββ π README.MD # This file
π οΈ Installation & Setup
Prerequisites
- Node.js v18+
- npm or yarn
- Solana CLI (optional, for debugging)
- Reliable RPC Node (Helius, QuickNode, etc.)
1. Clone and Install
git clone https://github.com/solship/Bonkfun-bundler-trading.git
cd Bonkfun-bundler-trading
npm install2. Environment Configuration
Create a .env file in the root directory:
# Network Configuration
RPC_ENDPOINT=https://your-rpc-endpoint.com
RPC_WEBSOCKET_ENDPOINT=wss://your-ws-endpoint.com
PRIVATE_KEY=your_main_wallet_private_key
# Token Configuration
TOKEN_NAME="My Awesome Token"
TOKEN_SYMBOL="MAT"
DESCRIPTION="A revolutionary token built on Solana"
TOKEN_SHOW_NAME="My Token"
TOKEN_CREATE_ON="bonk.fun"
# Social Media Links
TWITTER="https://twitter.com/solship"
TELEGRAM="https://t.me/solship"
WEBSITE="https://mytoken.com"
# Token Assets
FILE="./image/token.png"
# Trading Configuration
SWAP_AMOUNT=0.1
DISTRIBUTION_WALLETNUM=12
JITO_FEE=0.001
# Vanity Address (Optional)
VANITY_MODE=true
# Single Wallet Mode (Optional)
BUYER_WALLET=your_buyer_wallet_private_key
BUYER_AMOUNT=0.053. Configuration Validation
npm run validate4. Run the Bot
# Multi-wallet bundle mode
npm start
# Single wallet bundle mode
npm run single
# Close lookup table
npm run close
# Gather data
npm run gather
# Check status
npm run status
# Run tests
npm testπ§ Configuration Options
Network Settings
| Variable | Description | Example |
|---|---|---|
RPC_ENDPOINT |
Solana RPC endpoint | https://api.mainnet-beta.solana.com |
RPC_WEBSOCKET_ENDPOINT |
WebSocket endpoint | wss://api.mainnet-beta.solana.com |
PRIVATE_KEY |
Main wallet private key | Base58 encoded key |
Token Settings
| Variable | Description | Limits |
|---|---|---|
TOKEN_NAME |
Token display name | 1-32 characters |
TOKEN_SYMBOL |
Token ticker symbol | 1-10 characters |
DESCRIPTION |
Token description | 1-500 characters |
FILE |
Token image path | PNG/JPG file |
Trading Settings
| Variable | Description | Range |
|---|---|---|
SWAP_AMOUNT |
SOL per wallet | 0.01-100 SOL |
DISTRIBUTION_WALLETNUM |
Number of wallets | 1-100 |
JITO_FEE |
Bundle fee | 0-1 SOL |
π Usage Examples
Basic Multi-Wallet Bundle
// The bot will:
// 1. Create token with metadata
// 2. Distribute SOL to 12 wallets
// 3. Create lookup table
// 4. Generate buy instructions
// 5. Execute atomic bundle
npm startSingle Wallet Bundle
// For testing or small-scale operations
npm run singleCustom Configuration
// Modify .env file for different scenarios
SWAP_AMOUNT=0.05 // Smaller amounts for testing
DISTRIBUTION_WALLETNUM=6 // Fewer wallets
VANITY_MODE=true // Generate vanity addressesπ Monitoring & Debugging
Real-Time Logging
The bot provides comprehensive logging with emojis for easy identification:
- π Execution Start
- π Token Creation
- π SOL Distribution
- π Lookup Table Operations
- π Buy Instruction Generation
- π¦ Bundle Creation
- π Jito Submission
- β Success Confirmations
- β Error Messages
Log Levels
// Configure logging verbosity
const LOG_LEVEL = {
ERROR: 0,
WARN: 1,
INFO: 2,
DEBUG: 3
}Performance Monitoring
# Monitor bundle execution
npm run status
# Check wallet balances
npm run gatherπ‘οΈ Error Handling
Automatic Recovery
The bot includes comprehensive error handling:
- Network Failures - Automatic retry with exponential backoff
- Transaction Failures - Detailed error analysis and recovery
- Configuration Errors - Validation before execution
- RPC Timeouts - Multi-endpoint fallback
Common Issues
| Issue | Solution |
|---|---|
| Insufficient SOL | Add more SOL to main wallet |
| RPC Timeout | Use faster RPC endpoint |
| Bundle Rejection | Increase Jito fee |
| Token Creation Fail | Check token parameters |
π Security Considerations
Private Key Management
- Never commit private keys to version control
- Use environment variables for all sensitive data
- Consider hardware wallets for large amounts
- Regular key rotation for production use
Network Security
- Use trusted RPC endpoints (Helius, QuickNode)
- Enable rate limiting to prevent abuse
- Monitor for suspicious activity
- Keep dependencies updated
π Performance Optimization
Bundle Size Optimization
// Optimize for maximum efficiency
const OPTIMIZATION_CONFIG = {
WALLETS_PER_TRANSACTION: 5, // Optimal batch size
COMPUTE_UNIT_LIMIT: 1_000_000, // Compute budget
COMPUTE_UNIT_PRICE: 200_000, // Priority fee
MAX_BUNDLE_SIZE: 1232 // Solana limit
}Memory Management
- Streaming operations for large datasets
- Garbage collection optimization
- Connection pooling for RPC calls
- Efficient data structures
π§ͺ Testing
Unit Tests
npm testIntegration Tests
# Test with devnet
npm run test:devnet
# Test bundle execution
npm run test:bundlePerformance Tests
# Benchmark bundle creation
npm run test:benchmark
# Load testing
npm run test:loadπ API Reference
Core Functions
createBonkFunTokenMetadata()
Creates and uploads token metadata to IPFS.
distributeSol(connection, mainKp, distributionNum)
Distributes SOL to multiple wallets for trading.
createLUT(mainKp)
Creates a lookup table for transaction optimization.
makeBuyIx(kp, buyAmount, index, creator, mintAddress)
Generates buy instructions for a single wallet.
executeJitoTx(transactions, payer, commitment)
Executes bundle transactions through Jito.
Utility Functions
validateConfiguration()
Validates all configuration constants.
calculateMinimumSolRequired()
Calculates minimum SOL needed for operation.
generateVanityAddress(suffix)
Generates vanity addresses with custom suffixes.
π€ Contributing
Development Setup
# Install development dependencies
npm install --dev
# Run linter
npm run lint
# Run type checker
npm run type-check
# Run tests
npm testCode Style
- TypeScript for type safety
- ESLint for code quality
- Prettier for formatting
- Comprehensive comments for documentation
Pull Request Process
- Fork the repository
- Create feature branch
- Add tests for new functionality
- Update documentation
- Submit pull request
π License
This project is licensed under the ISC License - see the LICENSE file for details.
π Support
Documentation
- API Reference - Complete function documentation
- Examples - Usage examples and tutorials
- Troubleshooting - Common issues and solutions
Community
- Discord - @solship1_1
- Telegram - @solship
- Twitter - @solship
Professional Support
For enterprise support, custom development, or consulting:
- Email - [contact@solship.com]
- Discord - Direct message for urgent issues
- Telegram - Quick support and updates
π Changelog
v2.0.0 (Current)
- β¨ Complete code refactoring with comprehensive comments
- π‘οΈ Enhanced error handling and validation
- π Performance optimizations and monitoring
- π§ Configuration validation and management
- π Comprehensive documentation and examples
- π§ͺ Improved testing and debugging tools
v1.0.0 (Previous)
- π Initial release with basic functionality
- π¦ Jito bundle integration
- πͺ Multi-wallet support
- π Raydium SDK integration
Built with β€οΈ by solship
For MEV bot customization, consulting, or private collaboration, please reach out through the provided channels.