Skip to content

rafalum/arbit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arbit - Uniswap V3 Arbitrage Engine

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.

⚠️ Disclaimer

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.

🚀 Features

  • 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

📋 Prerequisites

  • 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

🛠️ Setup

  1. Clone the repository

    git clone https://github.com/rafalum/arbit
    cd arbit
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure environment variables

    cp env.example .env
    # Edit .env with your private keys and RPC URLs
  4. Required environment variables:

    • PRIVATE_KEY_8453: Your private key for Base network
    • PRIVATE_KEY_10: Your private key for Optimism network
    • RPC_URL_8453: Your RPC URL for Base network
    • RPC_URL_10: Your RPC URL for Optimism network

🏃 Running the Engine

Start the main arbitrage engine:

python3 -m src.engine

🖥️ Web Interface

Launch the monitoring UI (currently experimental and heavily vibe coded):

python3 -m ui.run

The UI provides real-time visualization of trading activity and opportunities.

🧪 Running Tests

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_engine

📁 Project Structure

arbit/
├── 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

🙏 Acknowledgments

This project builds upon and incorporates significant portions of code from the chainflip-io/chainflip-uniswapV3-python repository.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

Performance Notes

  • 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

🐛 Known Issues

  • UI is experimental and may have display issues
  • Currently limited to ETH/USDC pair only
  • Gas estimation may need optimization for smaller profit margins

About

Arbitrage Engine for Uniswap v3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors