Hacker News new | ask | show | jobs
Show HN: I built a live Bitcoin price aggregator with multiple indexes (live.bitcoinindex.es)
57 points by timothyjcoulter 4589 days ago
18 comments

So, assume I already have Bitcoins on Coinbase and have a verified account to sell them easily. Theoretically, my plan for free money would look like this:

- Say I have 11 BTC on Coinbase.

Wire $10k to OKPAY ($25 bank fee, 0% OKPAY commission)

Send OKPAY money to BTC-E, $200 fee (2%).

- Now I have $9,775 on BTC-E.

Within ~1 second of each other, I enter a market order to buy 10.754 BTC on BTC-e for $9,775, and sell 10.754 BTC on Coinbase for $10,488.21 (after their 1% fee).

These are the real market rates at the time of this post (accounting for book depth). I make $488 with no risk other than holding the Bitcoin for awhile, which anyone holding Bitcoin does anyway.

Before I attempt to do this and find out the hard way why it ends up costing me money in the process, could someone please kindly point out the flaw in my plan?

Correct, expect arbitrage is risky in illiquid markets. Here your BTC will take a while to get into your wallet after buying them on Coinbase or BTC-e (about 10 days on Coinbase). Your wire transfers will also take a few days to clear. During these wait periods the prices of BTC will be subject to wide swings.

And at last, your arbitrage profit will get severely eaten by the fees of the banks and BTC exchange platforms.

It's never easy to make a profit in an arbitrage scheme (unless you have a crushing competitive advantage such as transaction speed): if it were easy, enough people would use the scheme, bringing the price differences back to a range were turning a profit would be difficult again... so if there are significant price differences between exchanges, it's a signal of arbitrage difficulty.

I already have the Bitcoin in Coinbase though, I don't have to wait for anything. It's true that the wire transfer will take time, but the value of the dollar isn't going to change much in that time. If my only risk is the Bitcoin fluctuating in that time, it seems like free money for anyone who is already holding Bitcoin and would already be subject to that risk.
It works, but now you have to get your cash out of Coinbase, into your bank, and into BCT-e before you can do it again.

You could also simply buy on BTC-e, transfer bitcoins to Coinbase, sell on coinbase.

It's pure arbitrage.

Check withdraw limits. You might have $10k+ on an account like BTC-e and have to withdraw it over several days. If you keep arbitraging you will have more and more money in an exchange that is risky (BTC-e isn't trusted because it is written by one dude Bulgaria or something like that and the owner could just close up shop at anytime and you're fucked).

Also while all your transfers are clearing bitcoin could swing one way or the other totally screwing things up (coinbase takes several days to clear bitcoin buys (not sure about sells))

That's a classic arbitrage strategy. It works. The only reason that traditional "big" finance isn't doing it yet is that Bitcoin is too small/new.

As for risks:

http://en.wikipedia.org/wiki/Arbitrage#Risks

There's no flaw. It's called arbitrage. If enough people do it expect the gap to narrow, though.

It just takes too much time to buy bitcoins with dollars/sell with dollars on some of these exchanges, which is why this is possible.

BTC-e is based in an unknown city in Bulgaria and the operators are unknown. Keep that in mind when trading there. This is probably the most important factor for the prices there being so low, they could basically just take your money and run without you having any chance of getting hold of the operators.
I'd love to see this, but also including exchanges across different currencies (e.g. CNY) and normalized.

Kind of like http://bitcoinaverage.com/ does, but with a nice chart like http://bitcoinindex.es/.

I suspect the visualized data will be much more interesting, since different local economies behave differently. For example, when BTC was "crashing" yesterday to $850 USD, Chinese trades were still holding well about $1000 USD. Eventually the arbitrage opportunity becomes too big and the gap is closed. Watching this is fascinating.

Now that I have a huge stash of bit coins I was thinking of making a service/startup where you could lend out your bit coins to people who would agree to pay you back a slightly higher number of coins in the future. Kind of like a bank but not corrupt and full of banksters like the federal reserve and JP Morgan. Once I have traction I can IPO but instead of sell my shares for cash I would sell them in bit coins.

I think it would have some kind of restful API.

Why would anyone want to borrow money in a deflationary currency (Bitcoins) rather than an inflationary one (dollars)?
You want to borrow bit coins so that you can improve your business and then pay back the coins with increased profits due to the improvements. Isn't that obvious? I'm not interested in dollars because I don't think they are particularly useful. I convert all my dollars to bit coins whenever I can. Look at the price of bit coin in dollar terms and you'll see everyone else is doing the same thing.

Do you think the API for borrowing a deflationary currency should have a different API than an inflationary one?

Your conversion makes sense (USD -> BTC) so long as both mantain the current trend (BTC increasing in value wrt USD). Why? It's like investing in a stock or commodity that's increasing. I invested extra cash in a few stocks, including TSLA, while it was on the rise. This gave me a better ROI than holding USD or investing it in a CD or other low interest rate account.

But as a borrower, deflation blows. If I borrow 100 BTC and the terms of the loan are that I have to pay back 100 BTC + 10 BTC as interest, but the value of BTC has increased by another 10% I'm really paying 21% interest on the loan.

But as a borrower, inflation rocks. If I borrow 100 USD and the terms of the loan are that I have to pay back 100 USD + 10 USD as interest, but the value of USD has decreased by 10% I'm really paying 0% interest on the loan (actually, I might be able to beat inflation and come out ahead).

This goes back to what I mentioned in another thread [1] about buying and selling in either type of currency.

Let me hand wave some things, we'll assume that the real value of an item or ROI is static, and only the nominal value is changing with inflation or deflation.

Inflation: I borrow money to buy an item. I pay interest on the loan, and gain the benefit of having the item today rather than a year later when I would have saved up the cash. Over that year I pay off the loan, but with inflation I may get a discount of sorts on the item. If inflation is 10%, the nominal value is 10% higher the next year. If the interest payment is less than 10% I've saved money. If it's more than 10%, hopefully there was a profit in having the item now rather than later or I lost money.

Deflation: I borrow money to buy an item. I pay interest on the loan, and gain the benefit of having the item today rather than a year later when I would have saved up the cash. Over that year I pay off the loan, but with deflation I have an added cost. If deflation is 10%, the nominal value is 10% lower the next year. If the interest payment is negative ~10%, I've saved money. If it's higher, then hopefully there was a profit in having the item now rather than later or I lost money.

In fact, that matrix is essentially the same. Borrowers win in inflation (or might), while lenders might lose (but it beats leaving the cash under the mattress where it will lose value). Borrowers lose in deflation in most circumstances, while lenders win as long as borrowers don't default too often. Lenders under deflation have to be confident that the expected ROI of their loans will beat the deflation rate, or they might as well leave the cash alone. Lenders under inflation are virtually guaranteed that reasonable loan practices (subprime mortgages being an example of unreasonable loan practices) will be better than sitting on the cash if the economy is otherwise stable.

[1] https://news.ycombinator.com/item?id=6811101

I realized after reading other posts that I did, in fact, hear a whoosh earlier.
> You want to borrow bit coins so that you can improve your business and then pay back the coins with increased profits due to the improvements.

That doesn't really answer the question. Grandparent wasn't asking "Why would you want to borrow BTC?". It was asking, "Why would you want to borrow in a deflationary currency such as BTC rather than a traditional, inflationary currency?"

As others have pointed out, the most obvious practical reason why a borrower might specifically desire a BTC-denominated loan is in order to short sell Bitcoin. For something like a business loan, it seems intuitive that choosing BTC over a traditional currency would accomplish little aside from maximizing the interest rate on your loan (in real terms). Admittedly there may be plenty of unwary buyers who'll happily enter into a loan like that without doing any math first - the entire payday/title loan industry is built on this fact - but an operation relying on that unfortunate fact doesn't jibe too well with the stated goal of behaving more ethically than the existing financial establishment. So hopefully there's something else to it?

OK, so why don't you borrow dollars, convert to bitcoins, and actually make money on the loan through deflation?
Based on previous businesses that've offered Bitcoin loans, a common reason to borrow money in Bitcoins is because the person has no intention of paying off the loan. It doesn't take a large proportion of loans going bad before lenders start losing money on average at any reasonable interest rate, and increasing the interest rate will just increase the proportion of bad loans to good loans.
What legal or contractual constructs did previous bitcoin lenders attempt to use to ensure repayment? Surely they required some form of collateral or obtained sufficient information to be able to place a lien on the borrower's (thieves by your description) property.
>Kind of like a bank but not corrupt and full of banksters like the federal reserve and JP Morgan

Sounds like you're very knowledgeable about the money-lending space. Where do I send my money?

The only thing I'm knowledgable about is disrupting corrupt, inefficient industries/governments. I will send you a note as soon as the API is ready. There will be an API endpoint you can use to send me bit coins.
You can do something similar to this on Bitfinex right now, though it's specifically lending for margin trading. Also has the option to lend USD, which I have done, and had quite a nice return.

Worth checking out while doing research.

This would open up the possibility of shorting Bitcoins. Could get big.
You can already short Bitcoin; it's been possible for several years on Bitfinex and previous platforms (I forget the predecessor's name).
Out of pure curiosity, what's a "huge stash" of bitcoins these days? Top 100 on the bitcoin rich list? Top 1000? http://bitcoinrichlist.com/top100

Instead of lending, what about investing in startups using bitcoins?

you could lend out your bit coins to people who would agree to pay you back a slightly higher number of coins in the future.

Is this something that can be written into the Bitcoin protocol?

No. Bitcoins are designed to act like cash, so he would need to ask for some kind of collateral to ensure that people don't just run off with his bitcoins.
What's to stop people from just running off with your loan? Would you require some sort of tie-in to real-world identity?
Firstly, that's very cool. Well done!

Secondly, I know hardly anything about bitcoins - but here all I see is an arbitrage opportunity. Buy bitcoins from BTC-e and sell them on MTGox, which seems to be consistently around 150 (I assume USD) different.

Am I missing something here?

withdrawing USD from mtgox and transferring them to btc-e takes roughly two hours, depending on which payment processor you choose. okpay is usually pretty fast, but you loose about 50$ on commission. furthermore unless you are verified on mtgox, you've got a withdrawal limit of 1000$ per day. add to that the time interval during which your money is locked up either in the blockchain or the payment processor and you end up with substantial risk between the trades.

EDIT: This only worked until the end of may - I've just noticed that OKPAY withdrawal is no longer an option: https://www.mtgox.com/pdf/20130528_okpay_statement.pdf

The fact that there is a gap that large between exchanges is indicative of a huge liquidity problem in the exchanges. Big enough that I wouldn't go near it...even with my arbitrage-loving mitts.
It is impossible to withdraw USD from MtGox.
Excuse my ignorance, but can you elaborate?
People have said they're nearly insolvent. They're also being sued I think. So, withdrawing USD from Mt. Gox you're screwed... I waited 3 months and gave, up, converted my dollars into bitcoin and sold it elsewhere.
It isn't impossible but users have to wait arbitrarily large amounts of time in order to withdraw - some people report waiting for months.
Selling on MtGox, from what I understand, takes days (if not weeks). Buying is more straightforward.
Sorry to break it out, but the plural of index is indices :(
The server had a blip making me lose about an hour of data, but I was really excited to show it to you.
This is pretty cool!

What do you use for a stack?

Super small. Node JS/express and flat files for history.
I want all time history! But on serious note, if you could dynamically add other "indexes" as well as show other currencies besides USD, that'd also be good. But I'm assuming this is a side project you're just messing with?
Master plan: Add many other indexes. Let you choose the one you want. Let you embed it wherever you want. And more.
That's great. I put up a simple autorefresh page at: http://btcpricenow.com - still gathering my thoughts on Litecoin. http://bitcoinwisdom.com/ seems to be best for realtime charting.
It'd be great if you could include an overall average of the exchanges and also convert USD into other currencies.
V.nice. There's a plethora of applications for good dynamic graphing. I'd suggest adding a time axis.
Do you have any data on volume of trades you could add? I'm curious as to how liquid the market is.
This is awesome. Where can I donate?
Donate here! 1FXxhiSRtEcJ9s6YteTyvV2uk2bvJqR9vC
Thanks, grab a couple of good beers :).
Thanks!
Figuring this out now. Thanks!
Looks good! X and Y axes with price/time ticks would be really useful...
Thanks! To get Y value at least, hover over a series and it'll give you the price at that point.
Just an FYI - for some reason the HTTPS Everywhere plugin kills your site.
Thanks for letting me know! We don't support https (yet) so that could be why.
Shows a blank page for me or a "Whoops, something went wrong!".
Yep. You guys are hugging it to death. :)
Looks good. Perhaps add BTCChina, and label the horizontal axis?
Are you working on re-upping it? I would like to see.
You mean a server issue? If re-upping means re-selling the data, send me your ideas. :)
Looks nice, would like to see cavirtex exchange.
Nice, is this on github or similar?