A high-performance Solana token monitoring and automated trading bot designed for tracking new token launches on Pump.Fun and executing trades based on market capitalization thresholds.
Pump Sniper is a specialized trading bot that monitors the Solana blockchain for new token creations on the Pump.Fun platform. It automatically identifies and purchases tokens when they reach predefined market capitalization thresholds, enabling traders to capture early opportunities in newly launched tokens.
The system consists of two primary components:
- Monitor: Real-time token tracking and market cap visualization
- Sniper: Automated trading execution based on configurable parameters
- Real-time token creation monitoring via gRPC streaming
- Instant market capitalization calculation and tracking
- Automated buy execution when tokens meet threshold criteria
- Configurable trading parameters and risk management
- Multi-token concurrent tracking capabilities
- Transaction priority fee optimization for faster execution
- Direct integration with Solana RPC nodes
- Yellowstone gRPC protocol support for low-latency data streaming
- Bonding curve mathematics for accurate price calculations
- Slippage protection and transaction retry mechanisms
- Memory-efficient token caching and state management
pump-sniper/
├── src/
│ ├── accounts/ # Solana account structures
│ ├── bin/ # Executable binaries
│ │ ├── monitor.rs # Token monitoring tool
│ │ └── sniper.rs # Automated trading bot
│ ├── common/ # Shared components
│ ├── constants/ # Program constants
│ ├── error/ # Error handling
│ ├── instructions/ # Transaction builders
│ └── utils/ # Helper functions
├── Cargo.toml # Rust dependencies
└── test_*.sh # Testing scripts
The monitor provides real-time visibility into token launches:
- Displays token name, symbol, and mint address
- Shows initial and current market capitalization
- Calculates percentage changes since launch
- Updates market data every 3 seconds
- Visual status indicators for buy signals
The automated trading bot executes trades based on:
- Market cap threshold detection
- Configurable buy amounts
- Priority fee settings for transaction speed
- Slippage tolerance parameters
- Test mode for single-buy validation
- Rust 1.70 or higher
- Solana CLI tools
- Access to Solana RPC endpoint
- Yellowstone gRPC endpoint access
git clone https://github.com/kernlog/pump-sniper.git
cd pump-sniper
cargo build --release| Variable | Description | Default |
|---|---|---|
GRPC_ENDPOINT |
Yellowstone gRPC endpoint URL | Required |
RPC_ENDPOINT |
Solana RPC node URL | Required |
MARKET_CAP_THRESHOLD_USD |
Market cap trigger in USD | 8000 |
BUY_AMOUNT_SOL |
Purchase amount in lamports | 50000000 |
PRIORITY_FEE_SOL |
Transaction priority fee | 100000 |
COMPUTE_UNIT_LIMIT |
Compute units for transactions | 75000 |
MAX_SLIPPAGE_BPS |
Maximum slippage in basis points | 500 |
WALLET_PRIVATE_KEY |
Base58 encoded private key | Required for sniper |
Create a .env file in the project root:
GRPC_ENDPOINT=your_grpc_endpoint
RPC_ENDPOINT=your_rpc_endpoint
MARKET_CAP_THRESHOLD_USD=8000
BUY_AMOUNT_SOL=50000000
WALLET_PRIVATE_KEY=your_base58_private_key# Basic monitoring
cargo run --bin monitor
# With custom configuration
MARKET_CAP_THRESHOLD_USD=10000 cargo run --bin monitor
# Using the test script
./test_monitor.sh# Ensure wallet is configured
export WALLET_PRIVATE_KEY=your_base58_private_key
# Run sniper
cargo run --bin sniper
# Test mode (stops after first buy)
TEST_MODE=true cargo run --bin sniper
# Using the test script
./test_sniper.shThe monitor displays a real-time dashboard:
====================================================================================================
PUMP.FUN TOKEN MONITOR
====================================================================================================
TOKEN (SYMBOL) MINT ADDRESS INITIAL MC CURRENT MC CHANGE % AGE (s) STATUS
----------------------------------------------------------------------------------------------------
MyToken (MTK) 4Xm9... 1250.50 8500.75 +580.00% 45 BUY!
The bot monitors tokens and triggers buy orders when:
- Token market cap reaches the configured USD threshold
- Token has not been previously purchased
- Sufficient wallet balance exists
- Slippage Protection: Configurable maximum slippage percentage
- Buy Amount Limits: Fixed SOL amounts per trade
- Single Purchase Logic: Prevents duplicate buys of same token
- Test Mode: Allows validation with single trade execution
- Detects token meeting threshold criteria
- Calculates optimal transaction parameters
- Builds and signs transaction with priority fee
- Submits to network with retry logic
- Confirms transaction success
The system implements Pump.Fun's bonding curve formula:
- Virtual token reserves calculation
- Real-time price derivation
- Market cap computation based on curve state
Utilizes Yellowstone gRPC for:
- Account update subscriptions
- Transaction monitoring
- Minimal latency data delivery
- Concurrent token tracking
- Cached market data
- Batch RPC requests
- Efficient memory management
cargo testcargo doc --open- Accounts: Borsh-serialized Solana account structures
- Instructions: Transaction instruction builders
- Utils: Helper functions for PDA derivation, price calculations
- Common: Shared configuration and event handling
Connection Errors
- Verify gRPC endpoint accessibility
- Check RPC node availability
- Ensure network connectivity
Transaction Failures
- Increase priority fee for congested network
- Adjust slippage tolerance
- Verify wallet balance
Missing Tokens
- Confirm gRPC subscription filters
- Check program ID configuration
- Verify account parsing logic
- Token detection: <20ms from creation
- Market cap calculation: <5ms
- Transaction submission: <30ms
- Confirmation time: 400ms
- Memory: ~100MB baseline
- CPU: <5% during monitoring
- Network: Varies with token activity
This software is provided for educational and research purposes. Cryptocurrency trading involves substantial risk of loss. Users should:
- Understand the risks involved in automated trading
- Never invest more than they can afford to lose
- Conduct thorough research before trading
- Comply with local regulations and tax obligations
This project is released under the Apache License. See LICENSE file for details.
Contributions are welcome. Please:
- Fork the repository
- Create a feature branch
- Commit changes with clear messages
- Submit a pull request with description
For issues, questions, or improvements:
- Open an issue on GitHub
- Review existing documentation
- Check closed issues for solutions