Inspiration

We wanted to see if there was a way to use people's spare change to generate revenue for charity. Hence our motto 'turning cents into change'. We were captured by arbitrage techniques used on forex markets that seemingly generate revenue out of thin air, and we wanted to see if it could be done between different crypto exchanges.

What it does

Our program queries an API that we wrote for getting pricing data across many markets, and then uses that data to construct a graph, upon which it runs a modified version of the Bellman-Ford algorithm. This algorithm allows us to find positive cycles in the graph, each of which correspond to trades where we end with more currency than we started. Because Bellman-Ford operates so quickly, it gives us the time we need to execute the trading cycle we recovered before currencies fluctuate too much and the cycle disappears.

How I built it

We wrote our front-end in native javascript, which queries the CryptoCompare API for historical pricing info, and our RESTful API for trade information. It displays the trade cycle in a graph (using the CytoScape library) and queries for a new cycle from the most recent pricing information upon the click of a button. The website is hosted on Github-Pages and uses a domain.com domain. Our backend is written with Flask and hosted on Heroku. We actually wrote two seperate backends, one which publishes trade information, and another which consumes that information, finds negative cycles, and publishes the cycle for the website to consume.

Challenges I ran into

While we had originally intended to create a fully functional piece of software to generate revenue for charity, it quickly became apparent that the time and financial constraints we were under would have to limit the scope of our project for the time being. To actually consume live information from dozens of different marketplaces and hundreds of different cryptocurrencies, and to be able to post buy/sell requests in an automated fashion using marketplace APIs, we would have had to spend hundreds of dollars and waited potentially weeks to get security clearance at each marketplace.

Our compromise was instead to use a free api to consume historical marketplace information, and simulate inter-market currency fluctuations, which we would then post on an API of our own. While this unfortunately meant that we couldn't raise any money for charity today, it did mean that we were able build a great proof of concept that demonstrates that these cycles can be found even when there is very low fluctuation between markets.

Accomplishments that I'm proud of

With all of the challenges listed in the previous section, we were extremely proud to have persevered and create a working proof of concept that runs fast, looks clean, and uses many pieces of software we were previously unfamiliar with.

What I learned

We each learned a several skills individually and as a whole learned some important lessons during the course of this project.

Tom learned how to consume various marketplace API’s and write a RESTful API with Flask as well as how to host a backend with Heroku and create a domain alias using Domain.com, Mark learned implementing an algorithm is not always as straight-forward as it seems and one needs to be open to adapting, Sosa learned how to manipulate JSON files, how the Bellman-Ford algorithm can be modified for arbitrage, and how to work on a Flask API, and Noah learned how to consume APIs in javascript, how to use Promises, and how to work with the CytoScape graphing library.

Our project very much had a linear pipeline (we generate data, find a positive exchange rate cycle, send off the path of the cycle and exchange rates) and it often felt like one had to just wait for somebody else to finish their part. While that thought is tempting, in such a time constrained environment we learned how important it is to always be productive. If you’re waiting on data to test, try generating some instead of waiting. If you’re waiting on the API to be posted, start reading up on Flask to help your teammates out. We also learned how important it is to communicate consistently throughout the project. Again as we were working in a well-partitioned pipeline, it could be easy to get lost in your own work. Making sure all the piece fit together throughout the project is important.

What's next for ChangeChain

Now that we have a promising proof of concept under our belt, we hope to present our idea to DEN or equivalent entrepreneurial networks in order to raise the funds we need to act on real time data from many marketplaces, rather than historical data. If we are able to bridge this gap, we are optimistic that we will be able to really accomplish our mission statement, and turn cents into change.

Built With

Share this project:

Updates