A sophisticated Rust-based trading bot for Solana's PumpFun platform with PumpPortal integration. This bot automatically identifies and trades new tokens based on multiple trading strategies with comprehensive monitoring and risk management.
- Multi-Strategy Trading: Implements momentum, mean reversion, breakout, volume spike, and holder growth strategies
- PumpPortal Integration: Real-time token discovery and analysis
- Risk Management: Configurable stop-loss, take-profit, and position sizing
- Real-time Monitoring: Comprehensive metrics, alerts, and webhook notifications
- Dry Run Mode: Test strategies without real money
- Wallet Management: Secure keypair handling and transaction management
- Configurable: Extensive configuration options for all parameters
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β PumpPortal β β Trading Bot β β Solana RPC β
β API βββββΊβ βββββΊβ β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Wallet β
β Management β
βββββββββββββββββββ
βββββββββββββββββββ
β Start Bot β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Load Config β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Initialize β
β Components β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Main Loop β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Fetch New β β Analyze Tokens β β Check Exit β
β Tokens βββββΊβ with Strategies βββββΊβ Conditions β
βββββββββββββββββββ βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Execute Trades β β Update Metrics β
βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β
ββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββ
β Sleep & Repeat β
βββββββββββββββββββ
The bot implements five distinct trading strategies:
- Trigger: Price increase β₯ 5% with volume ratio β₯ 2x
- Logic: Identifies tokens with strong upward price momentum
- Confidence: Based on price change percentage
- Trigger: Price drop β₯ 10% with good liquidity ratio
- Logic: Assumes temporary price drops will recover
- Confidence: Based on magnitude of price drop
- Trigger: Volume spike β₯ 3x with price momentum β₯ 2%
- Logic: Catches tokens breaking out of consolidation
- Confidence: Based on volume spike magnitude
- Trigger: Volume multiplier β₯ 5x with β₯ 50 holders
- Logic: Identifies sudden interest in tokens
- Confidence: Based on volume spike and holder count
- Trigger: β₯ 100 holders with β₯ $500K market cap
- Logic: Organic growth in token adoption
- Confidence: Based on holder-to-market-cap ratio
βββββββββββββββββββ
β Position Entry β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Check Criteria β
β - Market Cap β
β - Holders β
β - Age β
β - Liquidity β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Calculate Size β
β - Confidence β
β - Max Amount β
β - Available SOL β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Execute Trade β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Monitor Positionβ
β - Profit Target β
β - Stop Loss β
β - Time Decay β
βββββββββββββββββββ
- Total trades executed
- Win/loss ratio
- Total profit/loss
- Maximum drawdown
- Current positions
- Volume traded
- Uptime
- Critical: System failures, wallet issues
- Error: Daily loss thresholds exceeded
- Warning: High drawdown, low win rate
- Info: General status updates
Supports Discord, Slack, and custom webhook endpoints for real-time notifications.
- Rust 1.70+ installed
- Solana CLI tools
- A Solana wallet with some SOL for trading
- Clone the repository
git clone <repository-url>
cd solana-pumpfun-bot- Install dependencies
cargo build --release- Generate or import wallet
# Generate new wallet
solana-keygen new --outfile wallet.json
# Or import existing wallet
solana-keygen recover 'prompt://?key=0/0' --outfile wallet.json- Configure the bot
cp config.example.toml config.toml
# Edit config.toml with your settings- Run the bot
# Dry run (recommended first)
cargo run -- --dry-run
# Live trading
cargo runKey configuration parameters:
[trading]
max_buy_amount = 1_000_000_000 # 1 SOL max per trade
profit_target_percent = 20.0 # Take profit at 20%
stop_loss_percent = 10.0 # Stop loss at 10%
max_positions = 5 # Max concurrent positions
[pumpportal]
min_market_cap = 1_000_000 # $1M minimum
max_market_cap = 10_000_000 # $10M maximum
min_holders = 100 # Minimum holdersAdd custom trading strategies by implementing the StrategyConfig:
let custom_strategy = StrategyConfig {
strategy: TradingStrategy::Custom,
parameters: {
let mut params = HashMap::new();
params.insert("custom_param".to_string(), 1.5);
params
},
enabled: true,
};Configure Discord webhook for alerts:
[monitoring]
webhook_url = "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"The bot integrates with PumpPortal API for:
- Real-time token discovery
- Market data and metrics
- Holder information
- Price and volume data
Use reliable RPC endpoints for better performance:
- Mainnet:
https://api.mainnet-beta.solana.com - Helius:
https://mainnet.helius-rpc.com/?api-key=YOUR_KEY - QuickNode:
https://YOUR_ENDPOINT.solana-mainnet.quiknode.pro/YOUR_KEY/
- Adjust confidence thresholds based on market conditions
- Modify cooldown periods to prevent overtrading
- Fine-tune profit/loss targets for your risk tolerance
- Wallet Security: Never share your private key
- API Keys: Use environment variables for sensitive data
- Dry Run: Always test with dry run mode first
- Position Limits: Set appropriate position size limits
- Monitoring: Regularly check bot performance and alerts
The bot provides comprehensive logging:
- Trade execution details
- Strategy analysis results
- Error messages and warnings
- Performance metrics
- Alert notifications
Log levels: trace, debug, info, warn, error
- 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.
This software is for educational purposes only. Trading cryptocurrencies involves substantial risk of loss. The authors are not responsible for any financial losses. Always do your own research and never invest more than you can afford to lose.
For support and questions:
- Create an issue on GitHub
- Check the documentation
- Review the configuration examples
- Telegram Contact: @Kat_logic
Stay updated with the latest features and improvements:
- Watch the repository for releases
- Check the changelog
- Follow best practices for updates
Happy Trading! ππ