Okay, so the recent liquidity problem Bitcoinica had, was unacceptable for anyone with a short position, as they weren't able to liquidate in a clearly rising market. But that's not what this post is going to be about. I've read the thread in which Zhoutong explained what happened, and some users which clearly have no idea how leverage works are throwing around false accusations, so I think it is time for someone to explain exactly how Bitcoinica operates. To make my examples easy to understand, I won't take the spreads into the calculations, which are basically the way Bitcoinica charges a fee on every trade that is made. Also I'll be using a leverage of 1:1 to make my examples as easy as possible. When there are 2 users, and one goes long and the other one goes short for the same amount, they cancel each other out. But what happens when there are more longs or more shorts? Let's explain this thing called "Hedging"!

Now there's two things that can happen: The BTC/USD price rises, or the BTC/USD prices falls. Let's see what happens in either scenario.

BTC/USD falls with a long positionLet's say the BTC/USD price falls to 1$ each and scared to lose more, the customer decides to liquidate his position. What happens is that Bitcoinica sells those 5BTC they previously bought on Mtgox for 1$ each. So what's Bitcoinica's balance going to look like after this happens?

They've lost money! Wrong. That's where the balance of the customer comes in. The customer lost money by taking a losing long position, and lost half of his balance, because BTC/USD prices fell to 1/2 of their former value and he was using 1:1 leverage.

Customer's balance: 10-5 = 5$Bitcoinica's balanace: 95+5 = 100$

And Bitcoinica's balance is back to were they started, as we would expect! Now in real life it would have ended slightly higher, due to them profiting on the spreads, but as I've said earlier, we're not going to take spreads into account as they will complicate the calculations without explaining what I want to explain.

BTC/USD rises with a long positionLet's say the BTC/USD price rises to 3$ each and happy with his profit, the customer decides to liquidate his position. What happens is that Bitcoinica sells those 5BTC they previously bought on Mtgox for 3$ each. So what's Bitcoinica's balance going to look like after this happens?

They've won money! Wrong. That's where the balance of the customer comes in. The customer won money by taking a winning long position, and won an extra 50% of his initial balance, because BTC/USD prices rose to 150% of their former value and he was using 1:1 leverage.

Customer's balance: 10+5 = 15$Bitcoinica's balanace: 105-5 = 100$

And Bitcoinica's balance is back to were they started, as we would expect!

Short scenarioNow let's consider the customer is going to short for 5BTC at 2$ per Bitcoin. What happens is that Bitcoinica sells 5BTC for 2$ each at Mtgox. Their balance is now as follows:

Now there's two things that can happen: The BTC/USD price rises, or the BTC/USD prices falls. Let's see what happens in either scenario.

BTC/USD falls with a short positionLet's say the BTC/USD price falls to 1$ each and happy with his profit, the customer decides to liquidate his position. What happens is that Bitcoinica buys those 5BTC they previously sold on Mtgox for 1$ each. So what's Bitcoinica's balance going to look like after this happens?

They've won money! Wrong. That's where the balance of the customer comes in. The customer won money by taking a winning short position, and won an additional 50% of his balance, because BTC/USD prices fell to 1/2 of their former value and he was using 1:1 leverage.

Customer's balance: 10+5 = 15$Bitcoinica's balanace: 105-5 = 100$

And Bitcoinica's balance is back to were they started, as we would expect!

BTC/USD rises with a short positionLet's say the BTC/USD price rises to 3$ each and scared to lose more, the customer decides to liquidate his position. What happens is that Bitcoinica buys those 5BTC they previously sold on Mtgox for 3$ each. So what's Bitcoinica's balance going to look like after this happens?

They've lost money! Wrong. That's where the balance of the customer comes in. The customer lost money by taking a losing short position, and lost half his balance, because BTC/USD prices rose to 150% of their former value and he was using 1:1 leverage.

Customer's balance: 10-5 = 5$Bitcoinica's balanace: 95+5 = 100$

And Bitcoinica's balance is back to were they started, as we would expect!

Why am I explaining this?Well first of all, because it's probably a good idea more people understand how Bitcoinica works. Second of all, some people that have no idea how this concept works, were accusing Zhoutong of shady things, because they thought it was weird people couldn't liquidate their shorts, even though Bitcoinica had plenty of BTC. I understand that it indeed sounds weird, but hopefully the examples posted here will help people understand why liquidating a short position requires buying BTC, and hence USD. Still, it is good that we have skeptics on this board so I'm not blaming anyone for the confusion.

Advice to ZhoutongPlease give people that have open short positions higher priority on buying BTC. It is simply unacceptable people were unable to liquidate their positions for several hours because of USD liquidity problems. Stop allowing more long positions _before_ you run out of USD, so that there's enough USD left for people with shorts to liquidate them. Of course the same should be true the other way around. Give people with long positions a higher priority on selling BTC. Stop allowing more short positions _before_ you run out of BTC, so that there is enough BTC left for people with longs to liquidate them.

Thanks for reading everyone! If you have any questions just ask! And please notify me if you find any errors in my explanations, as I might have messed up somewhere ^^

Thank you so much for taking time to write this long post to explain how Bitcoinica works. Please PM me your Bitcoin address or Bitcoinica username so that I can send you a 3.14159265 BTC bounty. I really appreciate your effort!

I will take your advice and start tweaking the circuit breaker algorithm today. It was triggered several times before, but at very minor scale and mainly due to excessive withdrawals instead of major trading activities like today. In the future, we will implement two levels of restrictions: no-opening (soft buy/sell redflag) and no-closing (hard buy/sell redflag), and leave some gap between them depending on total amount of open positions.

Your advice really makes sense because we may have forced liquidations when the market is moving, and we have to leave some reserve for them to happen as well.

Advice to ZhoutongPlease give people that have open short positions higher priority on buying BTC. It is simply unacceptable people were unable to liquidate their positions for several hours because of USD liquidity problems. Stop allowing more long positions _before_ you run out of USD, so that there's enough USD left for people with shorts to liquidate them.

Is a load of.... unless you're advocating the same in a reverse situation. Otherwise this is just fucking up a market that already has issues.

Thank you so much for taking time to write this long post to explain how Bitcoinica works. Please PM me your Bitcoin address or Bitcoinica username so that I can send you a 3.14159265 BTC bounty. I really appreciate your effort!

I will take your advice and start tweaking the circuit breaker algorithm today. It was triggered several times before, but at very minor scale and mainly due to excessive withdrawals instead of major trading activities like today. In the future, we will implement two levels of restrictions: no-opening (soft buy/sell redflag) and no-closing (hard buy/sell redflag), and leave some gap between them depending on total amount of open positions.

Your advice really makes sense because we may have forced liquidations when the market is moving, and we have to leave some reserve for them to happen as well.

Thank you very much for your kind words That indeed sounds like an excellent plan to prevent people from being stuck with potentially unwanted positions. It's great to see a talented person like you offer such a great service and to see you problems being dealt with in such a timely manner. Let's hope Bitcoinica continues to grow! I'll PM you my Bitcoinica username. Thanks again!

Advice to ZhoutongPlease give people that have open short positions higher priority on buying BTC. It is simply unacceptable people were unable to liquidate their positions for several hours because of USD liquidity problems. Stop allowing more long positions _before_ you run out of USD, so that there's enough USD left for people with shorts to liquidate them.

Is a load of.... unless you're advocating the same in a reverse situation. Otherwise this is just fucking up a market that already has issues.

Yes, that is correct. People with long positions should also get priority on selling. Thanks for the advice, I'll edit the post in a moment.

Advice to ZhoutongPlease give people that have open short positions higher priority on buying BTC. It is simply unacceptable people were unable to liquidate their positions for several hours because of USD liquidity problems. Stop allowing more long positions _before_ you run out of USD, so that there's enough USD left for people with shorts to liquidate them.

Is a load of.... unless you're advocating the same in a reverse situation. Otherwise this is just fucking up a market that already has issues.

Yes, that is correct. People with long positions should also get priority on selling. Thanks for the advice, I'll edit the post in a moment.

When I actually implement it, I will definitely consider both directions. Our redflag can be triggered when we are out of BTC too.

Thank you for this topic, the "reserve problem" one was blowing my mind. I mean, I know what a call option or a put option is, but all that vocabulary of "covering his shorted coins slipping under his long leveraged position blablabla" is Greek to me.

If I understood correctly, the costumer always has to have a balance capable of paying off the risks he's running, is that it?So, in the end, actual leverage (investing more money than you own) isn't yet possible in the bitcoin world, as I suspected?

And what changes if that 1:1 constant in your example isn't 1:1 anymore?

Thank you for this topic, the "reserve problem" one was blowing my mind. I mean, I know what a call option or a put option is, but all that vocabulary of "covering his shorted coins slipping under his long leveraged position blablabla" is Greek to me.

If I understood correctly, the costumer always has to have a balance capable of paying off the risks he's running, is that it?So, in the end, actual leverage (investing more money than you own) isn't yet possible in the bitcoin world, as I suspected?

And what changes if that 1:1 constant in your example isn't 1:1 anymore?

Thank you for the explanations.

Yes, you can actually invest more money than you own. Let's say I deposit 100$ into my bitcoinica account and the price of BTC/USD is 2$. If I set my maximum leverage to say 10:1, I can actually buy 10 times as many BTC as I would be able to buy on Mtgox. So in this case instead of 50BTC, I'm allowed to buy 500 (!) BTC with just 100$. The thing is, now that I have so many BTC, if the price drops by just 20 cents, I'm losing 500 * 0.20 = 100 dollars on that price movement, so I no longer have any cash left in Bitcoinica, so my position is forced liquidated, leaving me with neither Dollars nor BTC.

So in a formula:

When going long, using X:1 leverage, the bitcoin prices are allowed to drop by 100 / X % before I'm liquidated.Now here's the kicker: You actually have to subtract another 4% from that number, because that's how Bitcoinica protects themselves against sudden price swings. Because if they liquidate your position too late because the swing was too sudden, you would end up with a negative balance.

So for the different leverages, this is how much the BTC/USD is allowed to drop before you are forced liquidated:

Yes, thank you, that's what I was imagining that would happen, as soon as the losses "touch" the total balance (including fees and protections etc), they would force the liquidation of your position, even if it's not expired yet.The thing is, if right after the liquidation, but still before the expiration of your order, the prices swing on the other direction, you're still screwed in spite of having been "right on your bet"...

Is that how leverage is done on conventional financial markets as well? You always have to provide some guarantees before hand? For example, if I write a call option to someone, must I always prove before hand that I actually have what I would need to sell in case that option is exercised? I imagined such requirements were laxer on "non-anonymous scenarios", and that eventually people who lose too much would go bankrupt, with police going after them to seize their belongings and all that thing. Anyway, I thought you could go really bankrupt and remain owing people money by playing wrongly in these markets, instead of "at most losing your reserves".

Yes, thank you, that's what I was imagining that would happen, as soon as the losses "touch" the total balance (including fees and protections etc), they would force the liquidation of your position, even if it's not expired yet.The thing is, if right after the liquidation, but still before the expiration of your order, the prices swing on the other direction, you're still screwed in spite of having been "right on your bet"...

Is that how leverage is done on conventional financial markets as well? You always have to provide some guarantees before hand? For example, if I write a call option to someone, must I always prove before hand that I actually have what I would need to sell in case that option is exercised? I imagined such requirements were laxer on "non-anonymous scenarios", and that eventually people who lose too much would go bankrupt, with police going after them to seize their belongings and all that thing. Anyway, I thought you could go really bankrupt and remain owing people money by playing wrongly in these markets, instead of "at most losing your reserves".

That is correct. But then again, your bet was wrong on how much leverage to use. It's a risk vs reward calculation you have to do for yourself. Taking higher risks, and you are able to profit more, but there's less room for error.

No idea how it works on regular markets. I *think* you are allowed to have negative balances on some of them, but it would require all kinds of verification procedures, so that they can be relatively sure you will fill up negative balances to zero or positive later. But then again, I have no experience at all with any financial markets. This is the first time I've spent time learning how these kinds of systems work. By studying Mtgox, Bitcoinica and financial articles.

This does not do much to explain the common case at bitcoinica, as you conveniently choose scenarios where Bitcoinica always has a higher balance than the customer's trade, (and the customer uses 1:1 margin).

For example:If Bitcoinica has a $1000 balance, and the customer executes a $1000 trade at 10:1 margin (which Bitcoinica allows), then bitcoinica does not have the funds available to fully equalize this trade against mtgox.The trade would then require $10000 but bitcoinica only has $1000. If that trade is very profitable, Bitcoinica will have to pay the customer his earnings, or prevent him from liquidating his position until it is either not profitable, or until another customer opens an opposing position.

In all of your scenarios you say "Bitcoinica has lost money! Wrong!". It is in fact very possible for Bitcoinica to lose money -- the fact that you conveniently avoid this scenario is rather suspect.

This does not do much to explain the common case at bitcoinica, as you conveniently choose scenarios where Bitcoinica always has a higher balance than the customer's trade, (and the customer uses 1:1 margin).

For example:If Bitcoinica has a $1000 balance, and the customer executes a $1000 trade at 10:1 margin (which Bitcoinica allows), then bitcoinica does not have the funds available to fully equalize this trade against mtgox.The trade would then require $10000 but bitcoinica only has $1000. If that trade is very profitable, Bitcoinica will have to pay the customer his earnings, or prevent him from liquidating his position until it is either not profitable, or until another customer opens an opposing position.

In all of your scenarios you say "Bitcoinica has lost money! Wrong!". It is in fact very possible for Bitcoinica to lose money -- the fact that you conveniently avoid this scenario is rather suspect.

precisely.

which brings up another objection; for those with accts at Bitcoinica and who were not privy to Zhou's "alert" last nite about his internal market imbalance and his "recommendation" to sell or go short, how is that favorable to them?

the other scenario Mushoz's simplistic argument ignores is what i've been calling slippage.

the grossest example of this is when Zhou lost his Yubikey and thus his connection to gox. for example:

let say you sell or short 5 BTC at Bitcoinica for $4 in a downtrending market like we had a coupla months back. he loses his connection to gox for whatever reason. in the meantime the price decreases further to $3.80. he then sells 5 BTC @ $3.80 only recovering $19 instead of $20. this begins to erode his USD balance or reserves. now we begin to understand where all the USD went.

even assuming he has his maximum connectivity in place, the fact that he's one step removed from gox still results in slippage as he can never execute (hedge) at the same price as his customers did on his site. multiply that by thousands of orders each week.

now you will argue his algorithm takes this into acct through the spread. i argue its impossible to predict the violent swings and ignores the fact that there is constant complaining from customers to reduce that spread and thus his protection. it appears that he may in fact not have been charging enough via the spread given what has happened.

Ferroh: assuming that Bitcoinica does indeed acct for 1/3-1/2 of gox's trading, what do you think about leveraged shorting and its effect on the USD/BTC price? it seems to me that it has caused an asymmetric artificial overshoot to the downside but will not contribute to an overshoot to the upside due to his lack of USD reserve to continuously feed an upward spiral.

on the way down, when there were few to no buyers, he was able to easily step in as a market maker with his USD reserves to buy up the selling/shorting pressure b/c the price was so low. this may not work to the same degree with higher prices to the upside though as we're witnessing.

in this sense Bitcoinica has been destructive to the price and perhaps arguably to the economy. am i missing something?

This does not do much to explain the common case at bitcoinica, as you conveniently choose scenarios where Bitcoinica always has a higher balance than the customer's trade, (and the customer uses 1:1 margin).

For example:If Bitcoinica has a $1000 balance, and the customer executes a $1000 trade at 10:1 margin (which Bitcoinica allows), then bitcoinica does not have the funds available to fully equalize this trade against mtgox.The trade would then require $10000 but bitcoinica only has $1000. If that trade is very profitable, Bitcoinica will have to pay the customer his earnings, or prevent him from liquidating his position until it is either not profitable, or until another customer opens an opposing position.

In all of your scenarios you say "Bitcoinica has lost money! Wrong!". It is in fact very possible for Bitcoinica to lose money -- the fact that you conveniently avoid this scenario is rather suspect.

At this moment, the reserve is larger than top three accounts combined times 10. Your reasoning might be valid at the earlier days, but definitely not now.

That's why we may occasionally halt one direction trading when we don't have money. Didn't you know what happened yesterday?

the other scenario Mushoz's simplistic argument ignores is what i've been calling slippage.

the grossest example of this is when Zhou lost his Yubikey and thus his connection to gox. for example:

let say you sell or short 5 BTC at Bitcoinica for $4 in a downtrending market like we had a coupla months back. he loses his connection to gox for whatever reason. in the meantime the price decreases further to $3.80. he then sells 5 BTC @ $3.80 only recovering $19 instead of $20. this begins to erode his USD balance or reserves. now we begin to understand where all the USD went.

even assuming he has his maximum connectivity in place, the fact that he's one step removed from gox still results in slippage as he can never execute (hedge) at the same price as his customers did on his site. multiply that by thousands of orders each week.

now you will argue his algorithm takes this into acct through the spread. i argue its impossible to predict the violent swings and ignores the fact that there is constant complaining from customers to reduce that spread and thus his protection. it appears that he may in fact not have been charging enough via the spread given what has happened.

Ferroh: assuming that Bitcoinica does indeed acct for 1/3-1/2 of gox's trading, what do you think about leveraged shorting and its effect on the USD/BTC price? it seems to me that it has caused an asymmetric artificial overshoot to the downside but will not contribute to an overshoot to the upside due to his lack of USD reserve to continuously feed an upward spiral.

on the way down, when there were few to no buyers, he was able to easily step in as a market maker with his USD reserves to buy up the selling/shorting pressure b/c the price was so low. this may not work to the same degree with higher prices to the upside though as we're witnessing.

in this sense Bitcoinica has been destructive to the price and perhaps arguably to the economy. am i missing something?

Solution to the slippage problem:

Rule #1: Always consider market depth, not last price.

At 0 second, Bitcoinica shows a price of $4, at the same time, Mt. Gox price is rising to $4.5. A customer sends a market buy order.At 1 second, Bitcoinica gets a new price based on algorithm, gives a price of $4.55.At 1.01 second, Bitcoinica hedged and executed the order.

This ensures that no one is able to take advantage of sudden price movements. Price first, trade later.

If there's no adverse selection problem (deliberate attempt to cheat when opportunities arrive), trades are evenly distributed across the timeframe, and chances of further slippage is minimal.

Rule #2: Bitcoinica processes 50 ฿ at a time. No customer can take advantage of buying 10,000 Bitcoins and then enjoy the massive slippage on Bitcoinica.

Also, we have the thing called API, and we don't plug the Yubikey in the server.

For shorting issues, you don't understand Bitcoinica at all. What Bitcoinica did over the months was dumping a few thousands coins, buying back, and dumping again, and buying back,...

Bitcoinica can never short unless someone bought some coins and sent to us at the first place. Bitcoinica don't create paper assets to short the market. We just provide a pool of resources to Bitcoiners to borrow by placing either currency as collateral.

Thank you for your imagination. If I were you, I would stop polluting the thread that helps people to really understand.

the other scenario Mushoz's simplistic argument ignores is what i've been calling slippage.

My post wasn't an argument. I wanted to explain how Bitcoinica works and how they hedge. Clearly in the other thread you said it was weird Bitcoinica said they had loads of BTC, but no USD, and that people couldn't buy BTC to go long or buy BTC to liquidate their shorts. All I wanted to do with my post is explain why liquidating shorts or going long requires Bitcoinica to have USD, and _not_ BTC. This "simplistic scenario" was clearly needed, because without it you failed to understand how hedging works, yet you were arguing about it like you did know how it works.

I agree 100% with you that people getting stuck with shorts and being unable to liquidate them is unacceptable. And that's what my suggestion to Zhoutong was for. He already said he is going to implement such a function, so that's good to prevent a similar situation in the future. In the mean time he already said he was going to pay out of his own pocket for the risk of others. I simply can't think of a way he could have handled this situation better.

Quote

the grossest example of this is when Zhou lost his Yubikey and thus his connection to gox. for example:

Of course they are using the API, and not a Yubikey...

Quote

let say you sell or short 5 BTC at Bitcoinica for $4 in a downtrending market like we had a coupla months back. he loses his connection to gox for whatever reason. in the meantime the price decreases further to $3.80. he then sells 5 BTC @ $3.80 only recovering $19 instead of $20. this begins to erode his USD balance or reserves. now we begin to understand where all the USD went.

And that's why the trade on Bitcoinica doesn't go through before they hedged the position on Mtgox. The situation you're describing simply isn't possible. They try to hedge for 4$. When that isn't possible due to whatever situation you can come up with, and the price falls to 3,80, that's the price the costumer is going to get. Unfair? That's the risk of market orders. If the customer used a limit order instead, which he should if he cares about the risk, and places the limit order at 4$, the trade simply wouldn't go through, because Bitcoinica is unable to hedge at 4$ as the price already fell to 3,80$.

Quote

even assuming he has his maximum connectivity in place, the fact that he's one step removed from gox still results in slippage as he can never execute (hedge) at the same price as his customers did on his site. multiply that by thousands of orders each week.

Again, read the response to the quote above.

Quote

now you will argue his algorithm takes this into acct through the spread. i argue its impossible to predict the violent swings and ignores the fact that there is constant complaining from customers to reduce that spread and thus his protection. it appears that he may in fact not have been charging enough via the spread given what has happened.

It's impossible to know exactly how much the risk is going to be. That's why they overestimate the risk in their spreads. Unfair? Not at all. As you understand they need to protect themselves against the risk, and of course they need to profit as well. That's why the spread is bigger than required. Both as an extra buffer against the risk and for profit.

Quote

Ferroh: assuming that Bitcoinica does indeed acct for 1/3-1/2 of gox's trading, what do you think about leveraged shorting and its effect on the USD/BTC price? it seems to me that it has caused an asymmetric artificial overshoot to the downside but will not contribute to an overshoot to the upside due to his lack of USD reserve to continuously feed an upward spiral.

Do you know what's required on Bitcoinica to short? BTC. Do you know how they get BTC? That's correct. They buy BTC. So for every BTC that was shorted, a BTC was bought. Actually, there's _more_ BTC bought by Bitcoinica than there was sold through shorting. Do you know why? Because they need reserves.

Quote

on the way down, when there were few to no buyers, he was able to easily step in as a market maker with his USD reserves to buy up the selling/shorting pressure b/c the price was so low. this may not work to the same degree with higher prices to the upside though as we're witnessing.

How do you know how Bitcoinica's balance is doing? AFAIK they have some pretty big investors, and turning in some nice profits. Why do you have to come up with stories how they might be running out of USD because of losses, when you have no idea how they are doing? Could it maybe be, that there are actually too many people long for their reserves to handle? I mean, look at the last month. It's been an extremely Bullish market. It isn't weird that a lot of people are long currently.

Quote

in this sense Bitcoinica has been destructive to the price and perhaps arguably to the economy. am i missing something?

Yes, a lot. Honestly no offense, it's good to have skeptics as well. But please don't try to present things as facts and use them as arguments, when so many things are clearly wrong in your reasoning. If you think something might be bad for the market, Bitcoinica or anything else, but you are not sure how it works, just ask others, instead of stating it as facts. It would prevent a lot of FUD spreading through these forums.