Overview
The Transaction History tool (tx_history) is a command-line utility that fetches and analyzes recent transactions for a given Solana address. It provides detailed statistics about transaction success rates, fill events, and error patterns.
This tool is particularly useful for:
- Bot Performance Analysis: Understand how well your keeper bot is performing
- Competition Analysis: Identify how often other keepers fill orders first
- Error Debugging: Diagnose common transaction failure patterns
- Strategy Optimization: Use metrics to tune bot configuration
What It Does
The tool fetches up to 256 recent transactions for a specified address and analyzes them to produce:- Success vs Failed: Count of confirmed vs failed transactions
- Order DNE Logs: “Order Does Not Exist” errors (order was already filled or cancelled)
- OrderTrigger Events: Count of trigger order executions
- No Fill Events: Successful transactions that didn’t result in fills (competition)
- Empty Events: Transactions with no parseable events
Installation
The tool is built as part of the Keep-rs project. No separate installation is needed.Usage
Basic Command
Parameters
The Solana public key (address) to analyze.This is typically your bot’s wallet address or sub-account address.Example:
Solana RPC endpoint to use for fetching transactions.Examples:
Examples
Analyze Mainnet Bot Performance
Analyze with Custom RPC
Debug Mode (Verbose Logging)
Output Format
The tool produces a summary report like this:Metrics Explained
Number of transactions that confirmed successfully on-chain.High success rate (>80%) indicates:
- Good RPC connection
- Appropriate priority fees
- Healthy bot operation
Number of transactions that failed to confirm or were rejected.High failure rate may indicate:
- Insufficient priority fees
- Network congestion
- Invalid transaction construction
- Insufficient funds
Number of transactions that encountered “Order does not exist” errors.This happens when:
- Another keeper filled the order first (competition)
- The order was cancelled before your tx landed
- Swift order expired
Number of trigger orders successfully executed.Trigger orders are stop-loss or take-profit orders that activate when oracle prices reach specified levels.
Successful transactions that didn’t produce
OrderFill events.Causes:- Order already filled (by another keeper or AMM)
- Partial fills
- Transaction included other instructions (trigger, cancel)
Transactions with no parseable Drift events.May indicate:
- Non-Drift transactions
- Failed instruction execution
- Event parsing issues
Interpreting Results
Healthy Bot Performance
- High success rate (>80%)
- Moderate competition (20-30% DNE)
- Low “no fill” rate (<20%)
High Competition Environment
- Moderate success rate
- High competition (>50% DNE)
- High “no fill” rate
- Increase priority fees
- Focus on less competitive markets
- Optimize transaction latency
Transaction Failures
- Low success rate (<60%)
- Low competition (failures not due to DNE)
- Increase priority fees significantly
- Check RPC endpoint reliability
- Verify bot wallet has sufficient funds
- Review transaction construction logs
Performance Tips
Limitations
Common Issues
Invalid Pubkey Error
RPC Connection Failures
- Check your RPC URL is correct
- Verify network connectivity
- Try a different RPC endpoint
- Check for RPC provider outages
No Transactions Found
- Address has no transaction history
- Wrong network (mainnet vs devnet)
- Very old address with history beyond 256 recent txs
Automation
You can automate performance monitoring with a simple script:Source Code Reference
The Transaction History tool implementation can be found insrc/tx_history.rs:
- Argument parsing (
src/tx_history.rs:13-21): CLI argument structure - Signature fetching (
src/tx_history.rs:35-50): Fetch recent transaction signatures - Concurrent transaction fetching (
src/tx_history.rs:52-78): Parallel transaction data retrieval - Event parsing (
src/tx_history.rs:80-138): Parse Drift events and calculate statistics - Summary output (
src/tx_history.rs:140-146): Print results
Related Tools
- Metrics Dashboard (
http://localhost:9898/dashboard): Real-time bot performance monitoring - Prometheus Metrics (
http://localhost:9898/metrics): Detailed metrics for alerting and graphing - Solana Explorer: View individual transactions at https://explorer.solana.com