Coder Social home page Coder Social logo

cryptographarb's Introduction

CryptoGraphArb

This is the supporting code for my post on using graph theory to discover arbitrage opportunities in a cryptocurrency market.

Getting started

To run it, first sign up to CryptoCompare to get a free API key. Then, you can either replace it after the equals sign at the top of cryptocompare_scraper.py, or create a new text file named API_KEY.txt and paste it there directly.

Then, install dependencies with:

pip install -r requirements.txt

Lastly, run the code:

python cryptocompare_scraper.py
python graph_arbitrage.py

Overview

  • cryptocompare_scraper.py downloads the raw data, creating pairs_list.json, binance_data/ and snapshot.csv.
  • graph_arbitrage.py processes this data and puts it into a graph, before running Bellman-Ford to find arbitrage opportunities.

Your turn

Here's a brief list of a few ways that you could extend this project. Some are trivial, some are not!

  • Model transaction fees. This is literally one line of code, multiplying the arbitrage value by e.g 0.999 for each element in the path.
  • Download data from more exchanges. graph_arbitrage.py operates completely independently of the data collection, it just needs an adjacency matrix.
  • Automatically run the code at fixed intervals to continuously look for arbitrage.
  • Modify the Bellman-Ford so that it doesn't have to recompute everything when some weights change.

cryptographarb's People

Contributors

robertmartin8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.