A Rust-based arbitrage bot for cryptocurrency trading.
This project implements an arbitrage bot that monitors price differences across multiple exchanges to identify and execute profitable trading opportunities.
- Real-time price monitoring
- Multi-exchange support (Binance, Coinbase, etc.)
- Risk management
- Automated trading execution
- Exchange trait abstraction for flexible implementations
The bot uses a trait-based architecture for exchange interactions:
- Exchange Trait: Unified interface for all exchanges
- Price Monitoring: Real-time price feeds with spread calculation
- Order Execution: Market order placement with fee tracking
- Mock Exchange: Testing without real API calls
For detailed architecture documentation, see Exchange Architecture Guide.
- Rust 1.85.0 or later
- Cargo package manager
- Clone the repository:
git clone <repository-url>
cd arb-bot- Build the project:
cargo build- Run the application:
cargo runarb-bot/
├── Cargo.toml # Package configuration
├── Cargo.lock # Dependency lock file
├── .gitignore # Git ignore rules
├── README.md # Project documentation
├── src/
│ ├── main.rs # Main binary entry point
│ ├── lib.rs # Library entry point
│ ├── bin/ # Additional binaries
│ ├── examples/ # Example code
│ ├── benches/ # Benchmark code
│ ├── api/ # API modules
│ ├── config/ # Configuration modules
│ ├── database/ # Database modules
│ ├── error/ # Error handling modules
│ ├── exchanges/ # Exchange integrations
│ ├── logger/ # Logging modules
│ ├── risk/ # Risk management modules
│ ├── strategy/ # Trading strategy modules
│ ├── utils/ # Utility modules
│ └── websocket/ # WebSocket modules
├── tests/ # Integration tests
│ └── common/ # Shared test utilities
└── target/ # Build artifacts
# Run all tests (unit + integration)
cargo test
# Run unit tests only
cargo test --lib
# Run integration tests only
cargo test --test '*'
# Run all tests with output
cargo test -- --nocapture# Run example code
cargo run --example <example-name># Run benchmarks
cargo benchcargo build --release[Add your license here]