Free money!

Free money!

I bought some Dogecoins a few weeks ago and they lost 20% of their value pretty quickly. But I’ve had enormous fun wheeling and dealing in currencies on the CoinEx and Cryptsy currency exchanges. Many of the currencies are worth tiny fractions of a US penny each which allows you to buy and sell tens of thousands of something while only risking a few dollars. And the markets are wildly volatile, so you can make or lose 10-15% in a few minutes many several time a day. Exciting!

Jesus whipping money changers

The currency exchanges can be thought of as a market allowing the exchange of U.S. Dollars for German Marks or British Pounds. If you want to buy Pounds you go to the Pounds room, Marks are bought and sold in the Marks room. Once you’ve sold your Dollars for Pounds, you can stay in the Pounds room buying and selling many other currencies: Indian Rupees, Argentine Pesos, Macedonian Denars, Russian Rubles, Israeli Sheqels, Canadian Dollars or Hungarian Forints.

Some currencies are bought and sold in more than one room so you could exchange your Dollars for Pounds in the Pounds room, buy Rupees with Pounds, take your Rupees to the Marks room and sell them for Marks then take your Marks back to the Marks room and turn them back into Dollars. Each time you buy or sell a currency, the exchange charges you a percentage of the transaction so you can lose money even if it’s relative values were static.

One of the first days I was messing around I noticed when a currency goes up or down in value, it can go up or down quicker depending on what they’re being exchanged for. It occurred to me that I might be able to make free money from this phenomenon. A harried vacationer wanders into the Pounds room to buy some Rupees and doesn’t realize or care that Rupees are relatively expensive when purchased in Pounds, so I run into the Marks room and buy some Rupees for cheap and sell them to the customer in the Pounds room for more. I can immediately return to the Marks room and turn my Marks back into dollars and wait for the next person that wants to let me run between rooms finding the best deal and keeping the difference for myself.

I gamed out values of a quickly rising currency on paper and went through the transactions necessary to see if what seemed like a sure profit would actually pan out. To my amazement it did – in a series of trades that took less than a minute to execute I increased the amount of the currency I started with by 0.91% while paying only 0.7% in fees.

Many of the currency exchanges expose information to computers through an API (“application programming interface”) – a computer can examine changes in values across the dozens of currency pairs in the markets in a fraction of a second so I set out to write a program to do just that. After a few days of stimulating frustration figuring out how to code the process of paying attention to values and running between rooms finding the cheapest Rupees, I had a PHP script working. I found that when I tested my observation manually and made a profit, I was most likely just lucky as the opportunities to make a sure profit only last a few seconds.

The limitations I’m coming up against are,

  • The API I started working with frequently returns an error and if it happens after the first in the series of trades is executed, the plan doesn’t work.
  • Programming what to do when the plan doesn’t work is an entirely different problem to solve that I haven’t begun to tackle.
  • The vast majority of the trades occurring in the market I’m using are of a magnitude of less than $10 and there’s not much of a profit to be made – a few cents on a really good trade.
  • The information on the markets is not instantaneous and sometimes the opportunities have passed by the time my computer and the exchange finish talking to each other.
  • When something goes wrong, I have to go in and decide what to do with my brain.
  • PHP isn’t the best language to use for this as it’s designed to serve a webpage, not make decisions based on continuous back and forth communication between servers.

Despite all the drawbacks, my account balance on the exchange I’ve been using while developing is up 5% from the amount I started with last week. Given that the app has executed 3,355 trades just since I started recording them to a database, this is pretty impressive – especially considering at 0.2-0.3% of each transaction goes to the exchange, and there’s always at least two transactions to make a profit with this technique.

I’m hoping to get the app working with the Bter exchange later today. The Bter API seems to be both faster and more reliable than Cryptsy’s so far, so it can only work better! If it actually works the next steps will be determining if any cryptocurrency exchage has enough volume to make more than a fraction of a cent per trade and writing a multi-threaded desktop app that can make more trades quicker than the limitations imposed by PHP. Meanwhile, I’m thankful nobody reads this blog because the more bots there are doing this same thing the less likely mine will work well.

It’s been a lot of fun so far: I get to go to bed each night thinking sometime soon, I’ll get things working well enough so whenever I need money I can just turn on my bot and watch it work for a few hours.