A benchmarking tool for Solana RPC nodes using Raydium swaps. While simple SOL transfers only use about 200-5000 compute units (CU), this tool performs Raydium swaps that use ~30,000 CU to better simulate real-world RPC node performance under load.
- Simple SOL transfers are too lightweight for meaningful RPC testing
- Raydium swaps use ~30,000 CU (vs 200-5000 CU for transfers)
- Better represents real DeFi transaction workloads
- Tests node performance with complex instructions
- Solana block limit: ~1.4M CU per block
- Raydium swap: ~30,000 CU per transaction
- Max ~40-45 swap transactions per block
- Tests both compute-heavy and data-heavy operations
- Measures end-to-end transaction performance:
- Send latency
- Block inclusion time
- Transaction success rates
- Landing time distribution
- Block distribution analysis
- Tests node performance under DeFi-like load
- Verifies WebSocket notification reliability
- Measures transaction finality times
- Identifies potential bottlenecks
This tool executes real swaps on Raydium with real funds:
- ONLY use a dedicated test wallet with limited funds
- Real tokens will be swapped
- Real fees will be paid
- Incorrect settings can cause significant losses
- Start with small test amounts
- Go to the Releases tab
- Download for your platform:
thorbench-linux-amd64for Linuxthorbench-windows-amd64.exefor Windowsthorbench-darwin-amd64for macOS
- For Linux/macOS:
chmod +x thorbench-*
Requires Go 1.20 or higher:
git clone https://github.com/your-repo/thorbench.git
cd thorbench
go mod tidy
go buildThe tool creates a config.json template on first run:
{
"private_key": "<YOUR-BASE58-PRIVATE-KEY>",
"rpc_url": "https://api.mainnet-beta.solana.com",
"ws_url": "", // Optional: WebSocket URL
"send_rpc_url": "", // Optional: Separate RPC for sending
"rate_limit": 200,
"tx_count": 100,
"prio_fee": 1.0,
"node_retries": 3,
"input_mint": "So11111111111111111111111111111111111111112", // SOL
"output_mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC
"slippage": 100.0, // Use 100% for testing
"amount": 0.1, // Amount per swap
"compute_unit_limit": 30000, // Optional: defaults to 30000
"skip_warmup": false // Optional: whether to skip warmup transaction
}The tool performs a warmup transaction by default before starting the benchmark. This helps:
- Verify pool configuration and connectivity
- Ensure proper token account setup
- Test transaction parameters
- Prime any caches in the node
When to disable warmup ("skip_warmup": true):
- If token accounts are already pre-created
- During rapid sequential tests
- When testing cold-start performance
- When testing failover scenarios
- If pool parameters are already verified
- ONLY use major pools with high liquidity (>$1M):
- SOL/USDC
- SOL/RAY
- BONK/SOL etc.
- NEVER use:
- Small pools (<$100k liquidity)
- New/unverified tokens
- Low volume pools
- Highly volatile pairs
rate_limit: Maximum transactions per secondnode_retries: Number of RPC retries per transactioncompute_unit_limit: Maximum compute units per transactionprio_fee: Priority fee in lamports per compute unit
- Set slippage to 100.0 (100%) for testing
- Lower values will cause "slippage limit exceeded" errors
- Only safe with major pools
- Can cause large losses in small pools
- Start with small amounts
- Check pool liquidity before setting amount
Test wallet needs:
- SOL for fees (base fee + priority fee × compute units)
- Input tokens (amount × number of transactions)
- Extra for potential retries
- Configure
config.json - Verify wallet balances
- Run:
./thorbench
The tool outputs:
- Success/failure rates
- Landing time statistics
- Block distribution analysis
- Timing statistics (min/max/avg/median/percentiles)
- Logs in
thor_bench_<timestamp>_<testid>.log
The benchmark provides detailed statistics:
- Total transactions attempted
- Successful transactions
- Failed transactions (slippage vs other failures)
- Not landed or timed-out transactions
- Effective success rate (successful/total configured)
- Overall landing rate (landed/attempted)
- Minimum time
- Maximum time
- Average time
- Median time
- 90th/95th/99th percentiles
- Transactions per block
- Block spacing analysis
- Landing time distribution
- Check SOL for fees
- Ensure enough input tokens
- Account for priority fees
- Verify using large enough pool
- Check token pair liquidity
- Reduce amount per transaction
- Verify RPC stability
- Lower rate limit
- Increase retries
- Check WebSocket connection
- Test with minimal amounts first
- Use dedicated test wallet
- Monitor market conditions
- Keep transaction logs
- Never share private keys
- Start with warmup enabled
- Monitor resource usage
Apache License 2.0 - See LICENSE file for details.
This software is provided "as is", without warranty of any kind, express or implied. The authors and maintainers are not responsible for any damages or losses that may arise from its use. Users should thoroughly test the gateway in their specific environment before deploying to production.
For additional support or questions, please contact our support team via our discord server.