Coin Watch : Bitcoin Arbitrage ToolsteemCreated with Sketch.

in #bitcoin7 years ago

Hi Steemit!

I wanted to give back to the Steemit community in the best way I know how: through the power of engineering!  I've hacked together a small tool that allows you to detect when there are arbitrage opportunities between two Bitcoin exchanges.  The idea is to be notified when the price differs beyond a certain threshold to take advantage of the difference (see below).   I originally built this tool for myself, but thought it might interest some others on Steemit, so I created a simple interface to open it up to the world.  Currently I support the two exchanges that I use most frequently: Gemini and Coinbase.  Disclaimer: In no way should this be considered investment advice.  Think of this tool as an additional data provider to help you make more informed investment decisions. http://coinwatch.azurewebsites.net/
Coin Watch

How arbitrage works

ExchangeSupport.PNG

Let's look at the basics of arbitrage.  In a perfect economy, the price for an identical good or service should be the same.  This is especially true for digital goods such as bitcoin, where it doesn't cost more to ship the product to certain locations.  Price differences occur due to market fragmentation.
arbitrage.PNG Imagine two bodies of water, each representing a sub-population of the market.  In this analogy, the height of the water represents the undervaluation of the good.  Lower water level means lower potential gains (higher prices).  In a free-flowing market, the two bodies of water are connected, causing the water levels to be equivalent.  However, if only a certain subset of the population has access to one of the bodies of water, they may experience wildly different water levels for brief periods of time.  Any person that has access to both bodies of water can take advantage of the difference, collecting water from one and dumping it into the other.  If the water levels vary by a great enough difference, it makes sense for these users to pay the cost of carrying the water across the divide (price difference > transaction fees).  This will eventually equalize the levels of the two bodies of water; implying that even the population that simply owns some share of the larger body of water will experience the benefit of the water migration.  This analogy is a bit oversimplified, given that many exchanges have a built-in waiting period to prevent immediate buying and selling.  

Azure Functions FTW

I recently discovered Azure Functions; a neat offering from Azure that allows you to write a simple function in C#, F#, or JavaScript and create triggers to automatically run your code on a virtual machine.  You can plug-in various I/O modules (Azure storage, SendGrid, Twilio, etc.) which makes it simple to integrate with supported technologies.  It also supports Nuget imports so you're not limited to the various modules existing in the Azure Functions library.  It's ideal for small IOT projects as you don't have to manage any hardware or deployment and can edit your service entirely in the browser.

AzureFunctions.PNG
The tool is made up of a couple functions and a website for user interaction.  Every 5 minutes, the data collection function calls Gemini/Coinbase APIs to collect the latest trading prices.  The prices are logged in a history table and stored in a processing Queue.  The queued data is listened to by another Azure Function which calculates the price difference and determines who should be notified.  There are a couple other Azure Functions for handling user signup, updating alert thresholds, and unsubscribing.  Separately, I've created a simple website for interacting with the various APIs.

Try it out

http://coinwatch.azurewebsites.net/

More features

I'd love to get some feedback and feature requests. The following features could be coming down the pipeline, depending on community interest:

  • In-depth market analysis
    What's the probability of future price increase given x% price difference? Once I've collected enough historical price difference data, I'll be able to put together some results on this.
  • Current price trends
    Live graph of the past N days of price differences.
  • Support for additional exchanges and cryptocurrencies
  • Ability to auto-purchase through Gemini

Steem Powered

If you feel like this tool is helpful, please consider showing support by upvoting or resteeming to help keep the service running.

Sort:  

There is really very little profits to be made doing arbitrage with Bitcoin IMO. Expecially if you are trying to profit through more complex interactions, fees add up.

Yes, that's definitely true. Fees can easily eat up any potential profit. The way that I think about the price gap is that it helps give indicators on when to buy, by stacking the odds in your favor ever so slightly. If you buy during a price gap on the lower side, the prices should eventually equalize, which may marginally raise your odds of profit. This is a more passive version of arbitrage vs active trading between the two systems.