An automated arbitrage engine that identifies and executes profitable opportunities on Uniswap V3 pools between Base and Optimism networks for the ETH/USDC trading pair.
USE AT YOUR OWN RISK: This software is experimental and for educational purposes. Arbitrage trading involves significant financial risk and may result in loss of funds. The authors are not responsible for any financial losses incurred through the use of this software.
- Real-time monitoring of ETH/USDC pools on Base and Optimism
- Automated arbitrage opportunity detection
- Trade execution with gas optimization
- Web UI for monitoring and visualization
- Comprehensive test suite
- Python 3.8+
- Private keys for Base and Optimism networks
- Sufficient ETH and USDC for trading and gas fees
- RPC access to Base and Optimism networks
-
Clone the repository
git clone https://github.com/rafalum/arbit cd arbit -
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
cp env.example .env # Edit .env with your private keys and RPC URLs -
Required environment variables:
PRIVATE_KEY_8453: Your private key for Base networkPRIVATE_KEY_10: Your private key for Optimism networkRPC_URL_8453: Your RPC URL for Base networkRPC_URL_10: Your RPC URL for Optimism network
Start the main arbitrage engine:
python3 -m src.engineLaunch the monitoring UI (currently experimental and heavily vibe coded):
python3 -m ui.runThe UI provides real-time visualization of trading activity and opportunities.
Execute the test suite:
# Test swap exact input
python3 -m test.test_swap_exact_input
# Test swap exact output
python3 -m test.test_swap_exact_output
# Test engine logic
python3 -m test.test_enginearbit/
├── src/ # Core arbitrage engine
│ ├── engine.py # Main arbitrage logic
│ ├── uniswap.py # Uniswap V3 interface
│ ├── utils.py # Utility functions
│ └── libraries/ # Mathematical libraries
├── test/ # Test suite
├── ui/ # Web interface
└── assets/ # Static assets
This project builds upon and incorporates significant portions of code from the chainflip-io/chainflip-uniswapV3-python repository.
This project is licensed under the MIT License - see the LICENSE file for details.
- Monitor gas costs carefully as they can eat into arbitrage profits
- Consider using flashloans for larger arbitrage opportunities
- Test thoroughly on testnets before using real funds
- UI is experimental and may have display issues
- Currently limited to ETH/USDC pair only
- Gas estimation may need optimization for smaller profit margins