This project is an automated arbitrage bot that monitors and identifies arbitrage opportunities between the Dexalot and TraderJoe decentralized exchanges on the Avalanche C-Chain. It fetches real-time prices, checks for supported and liquid trading pairs, and prints out arbitrage opportunities based on configurable trade sizes.
- Fetches and cross-references supported trading pairs from Dexalot and TraderJoe.
- Checks for pool existence and liquidity on TraderJoe.
- Fetches buy/sell prices for any pair and trade size, accounting for slippage.
- Prints arbitrage opportunities and potential profit for each pair.
Install dependencies:
pip install -r requirements.txt- Clone the repository.
- Install dependencies as above.
- (Optional) If you want to use a custom Avalanche RPC URL, edit
pairs.pyand update therpc_urlvariable.
Run the main script to start monitoring for arbitrage opportunities:
python main.py [trade_size] [sleep_seconds]trade_size(optional): The amount of base asset to use for each trade (default: 1).sleep_seconds(optional): How often to check for opportunities (default: 10 seconds).
Example:
python main.py 2 30This will check for arbitrage opportunities every 30 seconds, using a trade size of 2 units.
- The bot fetches all supported pairs from Dexalot and checks if they are also available and liquid on TraderJoe.
- For each pair, it fetches buy and sell prices from both exchanges for the given trade size.
- If an arbitrage opportunity is found (i.e., you can buy low on one exchange and sell high on the other, after accounting for a minimum spread), it prints the details and the potential profit.
- To add or update token address mappings, edit the
ADDRESS_MAPPINGdictionary inpairs.py. - To change the minimum liquidity required for a pair, adjust the
min_reserveparameter inget_supported_pairs_with_token_info.
- To add more exchanges or price sources, create new modules similar to
dexalot.pyandtraderjoe.py.
This code is for educational and research purposes only. Use at your own risk. Always test thoroughly on testnets before deploying with real funds.