This project provides a visual interface for detecting and analyzing arbitrage opportunities in cryptocurrency markets.
- Token network graph visualization
- Arbitrage path visualization
- Profit calculation based on initial capital
- Interactive UI for exploring different tokens and opportunities
- Python 3.8 or higher
- pip (Python package manager)
-
Clone the repository or download the source code
-
Create a virtual environment (recommended): ``` python -m venv venv ```
-
Activate the virtual environment:
- On Windows: ``` venv\Scripts\activate ```
- On macOS/Linux: ``` source venv/bin/activate ```
-
Install the required dependencies: ``` pip install -r requirements.txt ```
-
Make sure the
.envfile is in the root directory with your Alchemy API keys: ``` ALCHEMY_ETHEREUM_KEY=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY ALCHEMY_BSC_KEY=https://bnb-mainnet.g.alchemy.com/v2/YOUR_KEY ALCHEMY_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY ```
-
Start the Flask server: ``` python app.py ```
-
Open your web browser and navigate to: ``` http://127.0.0.1:5000 ```
-
Use the interface to:
- Select a source token from the dropdown
- Enter your initial capital amount
- Click "Find Arbitrage Opportunities" to analyze
- View the results in the various visualization panels
-
Token Selection: Choose a token from the dropdown menu to use as your starting point for arbitrage.
-
Initial Capital: Enter the amount of capital you want to simulate for the arbitrage.
-
Network Graph: The network graph shows all tokens and their connections. When you find arbitrage opportunities, the relevant path will be highlighted.
-
Path Visualization: Shows the specific path of tokens for an arbitrage opportunity.
-
Profit Calculation: Displays a chart comparing initial capital, final capital, and profit for each opportunity.
- This application uses sample pool data by default. To use real-time data, you would need to uncomment and configure the relevant sections in the code that fetch data from blockchain networks.
- The fee parameter in the arbitrage detection algorithm is set to 0.3% by default, which is typical for many DEXes.