A customizable module for detecting arbitrage opportunities between DeFi exchanges
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
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.
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 ArbitrageAggregator
up and running is easy (and free!).
Running ArbitrageAggregator
requires the pandas
and web3
libraries. One must also create a free account on Alchemy.com to obtain an API key.
-
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 toArbitrageAggregator
). 1c. That's it! The new API key will be displayed on the Alchemy dashboard. -
Install the
pandas
andweb3
libraries, which are listed inrequirements.txt
. The easiest way to do this to downloadrequirements.txt
and usepip
:pip install -r requirements.txt
-
Download the
.py
files from this repository (ArbitrageAggregator.py
andDEXcalculator.py
) -
Run
ArbitrageAggregator.py
and enter your Alchemy API URL -
Congratulations! You can now use
ArbitrageAggregator
to constantly detect arbitrage opportunities between DeFi exchanges!
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.
See the open issues for a list of proposed features (and known issues).
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU GPL-3 License. See LICENSE
for more information.
Evan Gottschalk - @Fort1Evan - [email protected]
Project Link: https://github.com/EvanGottschalk/ArbitrageAggregator
Thinking about contributing to this project? Please do! Your Github username will then appear here.