Installation
This guide will walk you through installing Keep-rs and configuring it to run keeper bots on Drift Protocol.Prerequisites
Before installing Keep-rs, ensure you have the following:Required Software
Required Access & Credentials
- Bot Wallet: A Solana wallet with SOL for transaction fees (base58 encoded private key)
- RPC Endpoint: A Solana RPC provider (e.g., Helius, QuickNode, Triton)
- gRPC Access: Drift Protocol gRPC endpoint and authentication token
- Pyth Lazer Token: For real-time price feeds (optional but recommended)
Clone and Build
Build the Project
Build the release binary with optimizations:This will compile the
keeprs binary to target/release/keeprs.The first build may take several minutes as Cargo downloads and compiles all dependencies. Subsequent builds will be faster due to caching.
Configure Environment Variables
Environment Variable Reference
Required Variables
| Variable | Description | Example |
|---|---|---|
BOT_PRIVATE_KEY | Base58 encoded Solana private key for your bot wallet | 5J7W... |
RPC_URL | Solana RPC endpoint URL | https://api.mainnet-beta.solana.com |
GRPC_ENDPOINT | Drift Protocol gRPC endpoint | https://api.rpcpool.com |
GRPC_X_TOKEN | Authentication token for gRPC access | your_token |
Optional Variables
| Variable | Description | Default |
|---|---|---|
PYTH_LAZER_TOKEN | Pyth Lazer price feed token | None |
METRICS_PORT | Port for Prometheus metrics server | 9898 |
MARKET_IDS | Comma-separated perp market indices | "0,1,2" |
MAINNET | Use mainnet (true) or devnet (false) | true |
DRY_RUN | Simulate transactions without sending | false |
Getting Access Credentials
Bot Wallet Setup
Your bot needs a funded Solana wallet:-
Create a new keypair (if you don’t have one):
-
Export as base58:
-
Fund the wallet: Transfer SOL to your bot’s address for transaction fees
- Minimum recommended: 0.5 SOL for fillers, 1-5 SOL for liquidators
RPC Provider
The public RPC endpoint (
https://api.mainnet-beta.solana.com) has rate limits. For production use, sign up for a dedicated RPC provider:gRPC Access
Contact the Drift Protocol team to get gRPC access:- Join the Drift Discord
- Request keeper bot access in the developer channels
- Receive your
GRPC_ENDPOINTandGRPC_X_TOKEN
Pyth Lazer (Optional)
For the fastest price feeds:- Visit Pyth Network
- Sign up for Pyth Lazer access
- Generate an API token
Docker Installation (Alternative)
If you prefer to run Keep-rs in Docker:The Docker image exposes port 9898 for metrics. Map it to your host with
-p 9898:9898 to access the metrics and health endpoints.Verify Installation
Test that everything is configured correctly:- Bot wallet loaded successfully
- Connected to RPC endpoint
- gRPC subscriptions established
- Metrics server running on port 9898
Next Steps
Quick Start Guide
Get your first bot running with step-by-step instructions
Configuration Reference
Learn about all available configuration options