Breaking down the GDAX flash crash to the layman

If you've been reading cryptocurrency related news at all in the last month, you'll have read about the huge crash that took place on GDAX a few weeks ago. The price of Ether crashed from $317.81 to as low as $0.10 for a matter of milliseconds. There's a lot of terminology used in GDAX's main blog posts to explain what exactly happened here so I'll be breaking it down for the layman to understand.

Order Book

An order book on an exchange is the book of all of the open buy/sell orders for an asset. For example, a user named Ted creates a sell order of 100 ETH at $300 per ETH. Another user named Bob has an open buy order of 50 ETH at $300 per ETH. Since an order matching Ted's price offer exists from Bob, 50 of Ted's ETH will be sold to Bob and all of Bob's 50 ETH order will be fulfilled, leaving 50 ETH at $300 per ETH from Ted still on the order book.

The order book is full of orders like this, cascading all the way down in price for buys and all the way up in price for sells. People do this so that they can automatically make a profit without being present at the computer when the price makes a movement, or avoid losses in the case of a downturn.

Market Order

So when explaining the order book, I used an example of Ted and Bob making orders for specific prices. What you can also do is make a "market order". This is when you just want to sell X amount of ETH right now without any delay. People often call this something along the lines of selling or buying "into the book". Orders like this, particularly when of large amounts can trigger large price movements.

To show you how this might look, let's take a look at an example order book taken from Bitfinex.

What you're seeing on the left is a list of buy orders. You can see that there is a total of 0.2 ETH on sale for $272.5, 14.3 ETH for $272.2 and so on. On the right you can see the sell orders in the same vein. These prices here are essentially what determines the current value of ETH on the exchange. What people are willing to pay for 1 ETH is what the value of ETH is considered to be. Side note, the difference in price between the top buy order and top sell order is what's called the "spread", in this case the spread is $0.50.

Now imagine what happens when you do a market sell order for 0.2 ETH. That first buy order is completely eaten up by your demand to sell 0.2 ETH immediately "into the book" and thus the price of ETH drops from $272.50 to $272.20.

In the third column "total" you can see the sum of ETH up until that point in the order book. To make this example interesting, take a look at the second last buy order in that screenshot. The total amount of ETH in the order book until that point is 160.

Now imagine we placed a market sell order of 160 ETH, what would happen? We would eat up all of the buy orders all the way down to and including that second last order. That would mean we've just dropped the price of ETH from $272.5 to $270.7 in less than a second.

Margin Trading

A huge part of what contributed to the scale of this collapse is what's called "margin trading". Margin trading is when you take out a loan to trade with more money than you have. It is also in some cases referred to as "leveraged" trading, though these terms are not synonymous. People take out loans to trade more than they have when they believe that the market will move a certain way.

Most people who hold Ether are "going long". This is when you are betting that the value of an asset is going to go up, be it in a margin trade or not. Another part of margin trading you may have heard of is called "shorting" (like The Big Short). Shorting is inherently margin trading because of how a short works, it involves borrowing assets from other holders in order to open the position. Shorting is essentially betting against the asset's value, betting that it will go down instead of going up.

So you may be wondering, if you are trading with more money than you have, what secures your trades against losses? I mean why are exchanges allowing you to risk their money? Well, it's simple actually. In many big name stock brokers they have what is called a "margin call". It means when your client loses a certain amount on the loan you will start to demand more capital from them to cover their losses or else you will close their position. Unfortunately for GDAX users, margin calls just aren't really a thing in something as volatile and unregulated as cryptocurrencies.

So what we have in GDAX and other platforms instead is "forced liquidation". This means that you use your margin wallet to secure your open margin positions (longs or shorts) against losses. If your losses start to reach the entire value of your margin wallet, then you risk having the system automatically close your trade and sell off all your positions at market value to cover your losses. Forced liquidations can cause large chain reactions in the market as they can trigger price drops which lead into further forced liquidations.

Stop Losses

Another method that users use to prevent losing money in the event of a crypto crash is by setting up stop loss sell orders with the balance on their exchange wallet. These may also be known as "stop market" orders. With a stop loss, you set a price that you want to trigger the opening of a sell position at. There is a major risk with a stop loss however and that is that a stop loss will immediately sell your cryptocurrency at market value and not at a price that you set like in a stop limit order.

When a stop loss is triggered it can also add onto a chain reaction of stop losses and margin calls as you can imagine since a new order isn't created and locked in at a certain price (i.e 5% less than the stop loss trigger price), it places a market order like we discussed earlier. Selling into the order book at whatever price it can get.

Even Stop Limit orders don't save margin traders

While stop limits may save people not trading on margin, they may not save margin traders in serious crash events. Let's set a stop limit which will execute an order to sell for $199 when the price hits $200. Pretty reasonable, right? Maybe, but that depends on how fast this dip is and if your order has a chance to make it into the book before the price drops below $199.

The price may drop below $199 before your order is fulfilled. If that happens and the price continues to go down, you'll still reach the "forced liquidation" stage and be liquidated anyway. So even a stop limit doesn't save a margin trader in this situation.

The Chain Reaction

So with all of these concepts fresh in your mind. Imagine that someone with quite a lot of ETH decides that they want to see if they can make a lot of money by crashing the market. What they do is they go onto GDAX and place a lot of buy orders at low prices, maybe they place a couple at $100, $50, $10 and so on and so forth.

Next, they place a market order to sell all of their ETH straight down the order book. This order is so large that it triggers an instant drop in price of ETH from $317.81 to $224.48. Now imagine all of the active margin positions that users have open, some of them on as much as 10x leverage (meaning a loss of just 10% is 100% of their initial position lost). This seller triggered a mere loss of 29.4%, a loss so enormous that many margin positions would immediately force liquidation. These forced liquidations will open more market orders driving the price down further even people with significant account balance to cover their margins are starting to have massive losses.

All while this is happening, some people have stop loss orders set up to sell when the market is tanking but unfortunately they probably didn't realise that when a market is tanking this fast, a stop loss order will place a market order and they could be selling at rock bottom prices. This furthers the progress of the chain reaction as these stop loss market orders push the price down even more. Trading bots would also be contributing to this.

As the price drops down to absurdly low levels from this absolutely enormous chain reaction of stop losses and forced liquidations, many buyers (and probably the initiator of the situation) have had buy orders open at prices as low as $0.10 per ETH ready for a flash crash event like this. Looking at the GDAX history, there were plenty of orders filled at $0.10 per ETH.

Once all of the forced liquidations and stop loss orders have completed then the price immediately bounces back up as bots and existing low value buy orders buy up the absurdly cheap ETH. There are likely people who have made close to, if not a million dollars just from those lucky $0.10 per ETH buys during the flash crash.

The crazy part about all of this? It happened in less than the blink of an eye, literally. GDAX did a report on this event and has an animated image showing a simulated replay of the crash and subsequent recovery. The crash lasted around 45 milliseconds according to GDAX.

Conclusion

So you might be thinking, wow, that was wild, but can it happen again!? The truth is yes, it has happened before GDAX on Kraken and it will happen again, be it on GDAX, Kraken or another exchange that has margin trading and stop losses. Even without those two factors, flash crashes and even flash pumps of the price can happen just from bots alone, however margin trades and stop losses make it significantly more likely.

As long as someone has enough money to drop the price of the asset significantly, there will always be the possibility of someone intentionally triggering a flash crash again to buy up some of the asset at an absurdly low price. Personally I don't think anyone should margin trade or use stop losses in cryptocurrencies, they are just too volatile. The risk is insanely high. Never use "stop loss" orders either, always use "stop limit" orders.

The good news is that GDAX has agreed to pay back every single person that had their margin position force liquidated or had stop loss orders open. They didn't need to since this was the system and market actually functioning as intended but it is a good gesture on their part to use their profits to pay back the people who lost money.