A Solana arbitrage bot for arbitrage opportunities. This bot calculate the most optimal trade size between various DEX pools on Solana and executes trades when profitable opportunities are found. This repository utilizes the onchain program for executing arbitrage trades.
This is a demo bot to show how to parse each pool and call the onchain program.
Example transaction:
If you wanna build more profitable and usuful arbitrage bot, contact here: Telegram | Twitter
- Load configuration from a config file
- Send transactions through multiple RPC endpoints (spam)
- Kamino flashloan integration
- Parse all available pool types (Raydium, DLMM, Whirlpool, etc.)
- Rust and Cargo installed
- A Solana wallet with SOL
-
Clone the repository
git clone https://github.com/0xTan1319/solana-onchain-arbitrage-bot.git cd solana-onchain-arbitrage-bot
-
Update config.toml file
-
Run the bot
cargo run --release --bin solana-onchain-arbitrage-bot -- --config config.toml
- Copy the example configuration file:
cp config.toml.example config.toml
- Edit
config.toml
and configure your:- Private key for your Solana wallet
- RPC endpoint URL(s)
- Configure your trading pairs and pools:
- Update the
mint_config_list
with your desired token mints - Add the corresponding pool addresses for each DEX type (Raydium, DLMM, Whirlpool, etc.)
- Ensure lookup table accounts are properly set for your trading pairs
- Update the
compute_unit_limit
: Maximum compute unit limit per transactionprocess_delay
: Delay between processing iterations in milliseconds
mint_config_list
: List of mints to processmint
: Mint addressraydium_pool_list
: List of Raydium pool addressesmeteora_dlmm_pool_list
: List of Meteora DLMM pool addressesraydium_cp_pool_list
: List of Raydium CP pool addressespump_pool_list
: List of Pump pool addresseswhirlpool_pool_list
: List of Whirlpool pool addressesraydium_clmm_pool_list
: List of Raydium CLMM pool addresseslookup_table_accounts
: List of lookup table accountsprocess_delay
: Process delay in milliseconds
url
: RPC URL for the Solana network
enabled
: Enable spam transactionssending_rpc_urls
: List of RPC URLs for sending transactionscompute_unit_price
: Fixed compute unit pricemax_retries
: Maximum retriesenable_simple_send
: Enable simple send mode
private_key
: Private key (can be path or environment variable)
enabled
: Enable Kamino flashloan
MIT