Common Issues
This guide covers common problems encountered when running Keep-rs bots and their solutions.RPC Connection Issues
RPC Connection Issues
Symptoms
- Bot fails to start with connection errors
- Intermittent disconnections during operation
- Slow transaction confirmations
Solutions
Check Environment VariablesRPC_URL- Solana RPC endpoint (must support websockets)GRPC_ENDPOINT- Drift gRPC endpoint (e.g.,https://api.rpcpool.com)GRPC_X_TOKEN- Authentication token for gRPCPYTH_LAZER_TOKEN- Pyth price feed access token
- High rate limits (1000+ requests/second)
- Low latency (<50ms)
- gRPC support for real-time account updates
- Max retries: 10 attempts
- Backoff:
2^retriesseconds (capped at 30s) - Applies to: Pyth price feed connections (util.rs:356)
Transaction Failures: Insufficient Funds
Transaction Failures: Insufficient Funds
Error Message
Cause
Your bot wallet doesn’t have enough SOL to cover transaction fees.Solutions
Check Wallet Balance- Filler Bot: 1-5 SOL (depending on transaction volume)
- Liquidator Bot: 2-10 SOL (liquidations use more compute units)
- Higher priority fees require more SOL
InsufficientFundsForFee errors in metrics:Transaction Failures: Compute Unit Exceeded
Transaction Failures: Compute Unit Exceeded
Error Message
Cause
Transaction consumed more compute units (CUs) than allocated.Default Limits
- Swift fills: Configured via
--swift-cu-limit(default varies by config) - Auction fills: Configured via
--fill-cu-limit(default varies by config) - Dynamic adjustment based on account list size (filler.rs:462-469, 633-641)
Solutions
Increase CU LimitsgRPC Authentication Errors
gRPC Authentication Errors
Stale Data Issues
Stale Data Issues
Warning Messages
Staleness Thresholds
User Accounts (liquidator.rs:60)- Max age: 100 slots (~40 seconds)
- Checked before liquidation attempts
- Max age: 50 slots (~20 seconds)
- Validated for all user positions
- Max age: 5000ms (5 seconds)
- Checked before using in transactions
Causes
- gRPC Connection Issues - Missed account updates
- Network Congestion - Delayed slot progression
- Oracle Downtime - Price feed not updating
- Bot Performance - Can’t process updates fast enough
Solutions
Improve gRPC Connection- Use dedicated gRPC endpoint
- Enable account filters to reduce bandwidth
- Ensure stable network connection
- Log staleness warnings
- Attempt recalculation with stale data
- Skip liquidation if critical data is too stale
Competition Scenarios
Competition Scenarios
Scenario 1: AMM Fill Beats You
The vAMM (virtual AMM) filled the order before your transaction landed.Why This Happens- vAMM has no network latency
- vAMM JIT (Just-In-Time) making is enabled
- Your priority fee was too low
Scenario 2: Higher Priority Fee
Another keeper bot paid a higher priority fee and got included first.MetricsScenario 3: Order Already Filled
The order was filled by another keeper between cross detection and transaction confirmation.Metrics- Reduce transaction latency
- Optimize cross detection speed
- Accept this as normal competition
Scenario 4: Partial Fill
Metrics- Insufficient maker liquidity
- Maker order partially filled by another taker
- Maker position limits reached
Error Tracking
Transaction Failure Metrics
The bot tracks all transaction failures with labels (filler.rs:1034-1040, 1154-1186):Success Metrics
Viewing Metrics
If running with HTTP metrics enabled:Getting Help
If you encounter issues not covered here:- Check Logs: Run with
RUST_LOG=debugfor verbose output - Review Metrics: Identify patterns in failures
- Drift Discord: Ask in the
#keeperschannel - GitHub Issues: Report bugs at drift-labs/keeper-bots-v2