PumpFun Sniper Bot
A high-performance Solana sniper bot that detects and trades new PumpFun token launches in the first block using AllenHark's ultra-low latency ShredStream service.
ð Features
- First-Block Sniping: Detects new PumpFun token creations via ShredStream and executes trades in the same block
- Ultra-Low Latency: Direct shred processing for sub-millisecond detection times
- Automatic Buy/Sell: Configurable automatic buying and selling with profit tracking
- Smart Filtering: Customizable filters for dev buy amounts, token metrics, and spam detection
- Blacklist System: Automatic blacklisting of unprofitable creators to avoid repeat losses
- AllenHark Integration: Optimized for AllenHark Relay and ShredStream services
ð Prerequisites
Before running the bot, you need:
-
Funded Solana Wallet: A Solana wallet with sufficient SOL for trading
- Generate a keypair:
solana-keygen new -o wallet.json - Fund it with SOL for trading + transaction fees
- Generate a keypair:
-
RPC Endpoints: Access to Solana RPC providers (Helius, Shyft, QuickNode, Alchemy, etc.)
- Get free/paid API keys from your preferred RPC providers
-
AllenHark Services (Recommended for best performance):
- ShredStream access for real-time shred data
- AllenHark Relay for optimized transaction submission
- Sign up at: https://allenhark.com
-
User Volume Accumulator: A PDA derived from your wallet for PumpFun volume tracking
- See Deriving User Volume Accumulator below
ð§ Installation
Option 1: Download Pre-built Binaries (Recommended)
Download the latest release for Linux (x86_64):
1# Download and extract the release
2wget https://github.com/AllenHark-Inc/PumpFun-Sniper/releases/latest/download/sniperbot-linux-x86_64.tar.gz
3tar -xzf sniperbot-linux-x86_64.tar.gz
4cd sniperbot
5
6# Make binaries executable
7chmod +x sniperbot sell_token add_blacklist fix_blacklist test_blacklistDownload Links:
Option 2: Build from Source
[!NOTE] Access to the private source code repository requires a one-time purchase of 40 SOL. Contact us via Discord or visit AllenHark.com for access.
Once you have access to the private repository:
1# Clone the private repository
2git clone https://github.com/AllenHark-Inc/Ark-Shreds-Consumer-Rs.git
3cd Ark-Shreds-Consumer-Rs
4
5# Build for Linux
6cargo build --release --target x86_64-unknown-linux-gnu
7
8# Binaries will be in target/x86_64-unknown-linux-gnu/release/âïļ Configuration
1. Create config.toml
Copy the example configuration and customize it:
1# Trading Parameters
2purchase_amount_sol = 0.001 # Amount of SOL to spend per snipe (0.001 SOL fee per transaction)
3slippage_basis_points = 100 # Slippage tolerance (100 = 1%)
4live = true # Set to false for dry-run mode (no real transactions)
5
6# Wallet Configuration
7payer_keypair_path = "./wallet.json" # Path to your Solana wallet keypair
8
9# AllenHark Services (for best performance)
10relay = "https://relay.allenhark.com/v1/sendTx"
11quic = "185.191.117.237:4433"
12keep_alive_url = "https://relay.allenhark.com/ping"
13shredstream_uri = "http://127.0.0.1:9999" # Local ShredStream proxy
14tip_wallet = "harkYFxB6DuUFNwDLvA5CQ66KpfRvFgUoVypMagNcmd"
15tip_lamports = 1_000_000 # 0.001 SOL tip per transaction
16
17# PumpFun Configuration
18user_volume_accumulator = "YOUR_DERIVED_PDA_HERE" # See derivation guide below
19
20# RPC Pool (add your own RPC endpoints with API keys)
21rpc_pool = [
22 "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY",
23 "https://rpc.shyft.to?api_key=YOUR_KEY",
24 "https://solana-mainnet.quiknode.pro/YOUR_KEY",
25 "https://solana-mainnet.g.alchemy.com/v2/YOUR_KEY"
26]
27
28# Jito Configuration
29jito_enabled = true
30default_rpc = "https://rpc.shyft.to?api_key=YOUR_KEY"
31
32# Transaction Confirmation Settings
33confirmation_wait_ms = 2301 # Time to wait for transaction confirmation (ms)
34balance_check_max_retries = 5 # Max retries when checking token balance
35
36# Dev Buy Filter (skip tokens outside this range)
37min_dev_buy_sol = 0.5 # Minimum dev initial buy (SOL)
38max_dev_buy_sol = 4.5 # Maximum dev initial buy (SOL)
39
40# Spam Filter
41[spam_filter]
42min_buy_sol = 0.01 # Minimum buy amount to consider
43max_buy_sol = 10.0 # Maximum buy amount to consider
44min_tokens = 1000 # Minimum token amount
45min_accounts = 8 # Minimum number of accounts in transaction
46
47# Optional: Whitelist specific accounts
48# account_include = ["PUBKEY1", "PUBKEY2"]2. Deriving User Volume Accumulator
The user_volume_accumulator is a PDA (Program Derived Address) required by PumpFun to track your trading volume.
Method 1: Using Rust
1use solana_sdk::pubkey::Pubkey;
2use std::str::FromStr;
3
4fn derive_user_volume_accumulator(user_pubkey: &Pubkey) -> Pubkey {
5 let pumpfun_program = Pubkey::from_str("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P").unwrap();
6 let fee_program = Pubkey::from_str("pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ").unwrap();
7
8 let (pda, _bump) = Pubkey::find_program_address(
9 &[
10 b"user-volume-accumulator",
11 user_pubkey.as_ref(),
12 pumpfun_program.as_ref(),
13 ],
14 &fee_program,
15 );
16
17 pda
18}
19
20// Usage:
21let user = Pubkey::from_str("YOUR_WALLET_PUBKEY").unwrap();
22let accumulator = derive_user_volume_accumulator(&user);
23println!("User Volume Accumulator: {}", accumulator);Method 2: Using Node.js
1const { PublicKey } = require('@solana/web3.js');
2
3function deriveUserVolumeAccumulator(userPubkey) {
4 const pumpfunProgram = new PublicKey('6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P');
5 const feeProgram = new PublicKey('pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ');
6
7 const [pda, bump] = PublicKey.findProgramAddressSync(
8 [
9 Buffer.from('user-volume-accumulator'),
10 userPubkey.toBuffer(),
11 pumpfunProgram.toBuffer(),
12 ],
13 feeProgram
14 );
15
16 return pda;
17}
18
19// Usage:
20const user = new PublicKey('YOUR_WALLET_PUBKEY');
21const accumulator = deriveUserVolumeAccumulator(user);
22console.log('User Volume Accumulator:', accumulator.toString());For more details, see: https://allenhark.com/docs/pumpfun-sniper
3. Download Initial Blacklist (Recommended)
Download the pre-populated blacklist to avoid known malicious wallets:
1# Download the latest blacklist (updated daily)
2wget https://allenhark.com/blacklist.jsonl -O blacklist.jsonl
3
4# Or use curl
5curl -o blacklist.jsonl https://allenhark.com/blacklist.jsonlThe blacklist is updated daily with high-frequency token launchers and known rug pullers. The bot will automatically update this file as it detects unprofitable trades.
Learn more: https://allenhark.com/docs/blacklist
ðŊ Usage
Main Sniper Bot
Run the main sniper bot:
1./sniperbotThe bot will:
- Connect to ShredStream for real-time shred data
- Monitor for new PumpFun token creations
- Filter tokens based on your configuration
- Automatically buy tokens that pass filters
- Automatically sell after confirmation
- Track profits and update blacklist
[!IMPORTANT] Usage Fees: The bot charges 0.001 SOL before each buy and 0.001 SOL after each sell (total 0.002 SOL per complete trade cycle) paid to AllenHark. These fees are charged regardless of trade profitability.
Remove Fees: Purchase source code access for 40 SOL to remove all usage fees and customize the bot. Contact us via Discord or visit AllenHark.com.
Utility Binaries
Sell Token
Manually sell a specific token if the bot skipped it or failed to sell:
1./sell_token --token <MINT_ADDRESS>
2
3# Example:
4./sell_token --token GRTZHBm1X6N6rx99UowUbnTDUe5AFStJHqcw5bGApumpAdd to Blacklist
Manually add a wallet address to the blacklist:
1./add_blacklist <WALLET_ADDRESS>
2
3# Example:
4./add_blacklist 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsUTest Blacklist
Test if a wallet address is in the blacklist:
1./test_blacklist <WALLET_ADDRESS>
2
3# Example:
4./test_blacklist 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsUFix Blacklist
Fix data corruption in the blacklist file:
1./fix_blacklistUse this if you encounter errors loading the blacklist.
ð Understanding the Output
The bot provides detailed real-time metrics:
⥠Event Latency: 234 Ξs (direct channel, no ZMQ!)
ð Processing Mint: GRTZHBm1X6N6rx99UowUbnTDUe5AFStJHqcw5bGApump
ð PRE-FLIGHT TIME: 1.234ms (Channel -> Serialized, no ZMQ!)
â
Token account confirmed and available
ð° Token account balance: 1234567 tokens
ð Preparing SELL transaction...
â
Sell transaction sent!
ð° Profit Calculation:
Initial SOL balance: 10.123456789 SOL
Final SOL balance: 10.125678901 SOL
Rent recovered: 0.002039280 SOL
Total profit (with rent): 0.004261392 SOL
ð Security Best Practices
- Never share your wallet keypair (
wallet.json) - Keep your RPC API keys private - don't commit
config.tomlto public repos - Start with small amounts - test with
purchase_amount_sol = 0.001first - Use dry-run mode - set
live = falseto test without real transactions - Monitor your wallet balance - the bot will spend SOL on every qualifying token
- Review the blacklist regularly - ensure it's not blocking legitimate opportunities
â ïļ Risk Disclaimer
Trading cryptocurrencies involves significant risk of loss. This bot is provided as-is with no guarantees of profit.
- PumpFun tokens are highly volatile and risky
- Many tokens are scams or rug pulls
- You may lose all SOL spent on trades
- Past performance does not guarantee future results
- Usage fees (0.002 SOL per trade cycle) are charged regardless of trade outcome and are non-refundable
- Always trade responsibly and only with funds you can afford to lose
ð Documentation & Support
- Full Documentation: https://allenhark.com/docs/pumpfun-sniper
- Blacklist Guide: https://allenhark.com/docs/blacklist
- Discord Support: https://discord.gg/JpzS72MAKG
- AllenHark Services: https://allenhark.com
ð ïļ Troubleshooting
Bot won't start
- Check that
config.tomlexists and is valid TOML format - Verify your wallet keypair path is correct
- Ensure your wallet has sufficient SOL balance
No tokens being sniped
- Verify ShredStream is running and accessible
- Check your spam filters aren't too restrictive
- Ensure your RPC endpoints are working
- Verify
live = truein config
Transactions failing
- Check your wallet has enough SOL for trades + fees
- Verify RPC endpoints are responsive
- Increase
slippage_basis_pointsif needed - Check AllenHark Relay is accessible
Blacklist errors
- Run
./fix_blacklistto repair corruption - Delete
blacklist.jsonland re-download from https://allenhark.com/blacklist.jsonl - Check file permissions
ð Configuration Tips
Recommended Settings for Beginners
1purchase_amount_sol = 0.001 # Start small
2slippage_basis_points = 200 # Higher slippage for volatile tokens
3min_dev_buy_sol = 1.0 # Only snipe tokens with 1+ SOL dev buy
4max_dev_buy_sol = 3.0 # Avoid huge dev buys (potential dumps)
5live = false # Test in dry-run mode firstAggressive Settings (Higher Risk/Reward)
1purchase_amount_sol = 0.01 # Larger position sizes
2slippage_basis_points = 100 # Tighter slippage
3min_dev_buy_sol = 0.5 # Cast a wider net
4max_dev_buy_sol = 5.0 # Include larger dev buys
5confirmation_wait_ms = 1500 # Faster selling (riskier)Conservative Settings (Lower Risk)
1purchase_amount_sol = 0.001 # Minimal position size
2slippage_basis_points = 300 # Accept more slippage
3min_dev_buy_sol = 2.0 # Only well-funded launches
4max_dev_buy_sol = 3.0 # Avoid extreme dev buys
5confirmation_wait_ms = 3000 # Wait longer for confirmationðĪ Contributing
This is an open-source project. Contributions, issues, and feature requests are welcome!
ð License
[Add your license here]
Built with ⥠by AllenHark | Powered by ShredStream