/ArbitrageAggregator

A customizable bot for detecting arbitrage opportunities between DeFi exchanges-forCodeSpaces

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

ArbitrageAggregator

A customizable module for detecting arbitrage opportunities between DeFi exchanges
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

I initially built ArbitrageAggregator and DEXcalculator as part of a programming challenge to find arbitrage opportunities between decentralized cryptocurrency exchanges (DEX's). The main purpose of ArbitrageAggregator is to continuously detect those profitable trade opportunities and collect data on them.

Built With

  • Python 3.6
  • web3
  • pandas
  • DEXcalculator - This program uses API calls to fetch decentralized exchange balances, which are then used to calculate prices of tokens.

Getting Started

Getting ArbitrageAggregator up and running is easy (and free!).

Prerequisites

Running ArbitrageAggregator requires the pandas and web3 libraries. One must also create a free account on Alchemy.com to obtain an API key.

Installation

  1. To use ArbitrageAggregator, one must obtain their own Alchemy API key. This is quick, simple, and free to do. 1a. First, create a free account on Alchemy.com. 1b. Next, create a blank app using the "+CREATE APP" button (the app's particular parameters are not relevant to ArbitrageAggregator). 1c. That's it! The new API key will be displayed on the Alchemy dashboard.

  2. Install the pandas and web3 libraries, which are listed in requirements.txt. The easiest way to do this to download requirements.txt and use pip:

    pip install -r requirements.txt
    
  3. Download the .py files from this repository (ArbitrageAggregator.py and DEXcalculator.py)

  4. Run ArbitrageAggregator.py and enter your Alchemy API URL

  5. Congratulations! You can now use ArbitrageAggregator to constantly detect arbitrage opportunities between DeFi exchanges!

Usage

ArbitrageAggregator can be used it a number of ways. It can be used as a bot for detecting arbitrage opportunities between decentralized cryptocurrency exchanges by by calling its loopArbitrageDetection() function. It will then continuously check prices of the selected currencies across decentralized exchanges, recording profitable arbitrage trades in a pandas DataFrame and exported to CSV.

The individual functions that make up loopArbitrageDetection() can also be useful on their own and included in other programs. For example, collectPriceDataOnAllExchanges() provides an easy way to get a massive amount of price data on decentralized exchanges, which could then be used for analysis, or used in some other automated process. One can also use checkForArbitrage() to quickly check for live profit opportunities in a given moment, rather than checking continuously.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU GPL-3 License. See LICENSE for more information.

Contact

Evan Gottschalk - @Fort1Evan - evan@fort1e.com

Project Link: https://github.com/EvanGottschalk/ArbitrageAggregator

Acknowledgements

Thinking about contributing to this project? Please do! Your Github username will then appear here.