This is a Rust-based bot that tracks specific Solana wallets for trading activity on the Raydium DEX. The bot monitors transactions, identifies net token purchases, and executes trades when a specified threshold is met.
- Monitors specified Solana wallets for trading activity
- Identifies net token purchases/sales based on transaction history
- Executes trades on Raydium DEX when conditions are met
- Rate-limited API calls to prevent request throttling
Ensure Rust is installed on your system. If Rust is not installed, use:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shThen restart your terminal and verify installation:
rustc --versiongit clone https://github.com/your-repo/wallet-tracker.git
cd wallet-trackercargo buildCopy the .env.sample file and follow the instructions inside to configure your environment.
For the bot to place trades on behalf of a wallet, we have to create a wallet.json file in the root directory with the private key array of the wallet.
To create a new Solana wallet using the Solana CLI:
solana-keygen new --outfile wallet.jsonIf you have an existing private key and want to use it:
- Open
wallet.jsonin a text editor. - Replace its content with your private key array (found in
solana-keygenoutput or other Solana wallets). - Ensure
wallet.jsonis stored safely in the root directory (alongsideCargo.toml).
If you have copied your private key from a web extension wallet (e.g., Phantom, Solflare), it is usually in a base58 format. To convert it into a valid JSON array for wallet.json, run the following command in a Solana CLI-supported environment:
echo "your_base58_private_key_here" | solana-keygen recover prompt://?keypair=askThis will generate a valid private key array that you can copy into wallet.json.
Modify src/config.rs to track specific wallets:
pub static ref WALLET_ADDRESSES: Vec<String> = vec![
"YourWalletAddress1".to_string(),
"YourWalletAddress2".to_string(),
];cargo buildcargo run- Fetches recent transactions for the tracked wallets.
- Filters transactions related to Raydium DEX.
- Determines net buy/sell activity for each token.
- If a token's net buy count reaches the threshold (
K), the bot executes a buy order.