Skip to content

About

Automated arbitrage opportunity scanner

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Avalanche Dexalot–TraderJoe Arbitrage Bot

Overview

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.

Features

  • 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.

Requirements

Install dependencies:

pip install -r requirements.txt

Setup

  1. Clone the repository.
  2. Install dependencies as above.
  3. (Optional) If you want to use a custom Avalanche RPC URL, edit pairs.py and update the rpc_url variable.

Usage

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 30

This will check for arbitrage opportunities every 30 seconds, using a trade size of 2 units.

How It Works

  • 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.

Configuration

  • To add or update token address mappings, edit the ADDRESS_MAPPING dictionary in pairs.py.
  • To change the minimum liquidity required for a pair, adjust the min_reserve parameter in get_supported_pairs_with_token_info.

Extending

  • To add more exchanges or price sources, create new modules similar to dexalot.py and traderjoe.py.

Disclaimer

This code is for educational and research purposes only. Use at your own risk. Always test thoroughly on testnets before deploying with real funds.

About

Automated arbitrage opportunity scanner

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages