Bitfinex Flash Crash Postmortem

Screen Shot 2015-08-20 at 4.18.33 PM

On August 18th a trader(s) capitalised on the general malaise over the BitcoinXT debate, and the Bitfinex margin trading platform. Bitfinex USD swaps remained at ATH levels even as spot began falling after the Grexit drama washed over. The average “kill zone” slowly creeped higher as traders bought in at the top of the last rally. Pushing the price into the kill zone would set off a wave of cascading margin calls. In addition, traders using Bitcoin as collateral would enter into a negative feedback loop. The value of their collateral declines at the same time as the Bitcoin price falls.

The chart above is from BFXData. I have circled the flash crash event. A trader(s) borrowed a much XBT as possible with the intention of slamming the book to go short. That is the spike in the red line, which is the total XBT swaps outstanding. The blue line, which is the XBT price, tanked as the seller hit bids. We know that that a majority of leveraged longs got cleared out because the green line, the outstanding amount of USD swaps, declined. Traders began getting margin called and Bitfinex had to liquidate their positions and their XBT collateral in some cases.

If that weren’t bad enough for longs, cracks in Bitfinex’s margin trading software became apparent. From Phil Potter’s, the Bitfinex CEO, conversation on Whaleclub TeamSpeak after the event, I speculate there was a miscommunication between the spot trade matching engine and the system that handles margin trading. A latency between the two systems would cause more liquidations to be enacted because the margin engine had stale data. If the margin engine thinks the price is lower than it actually is, it will continue to liquidate traders causing a flash crash.

In Bitcoin, it always pays to have dry powder ready. Bitfinex is still the number one Bitcoin/USD exchange by volume. Violent flash crashes and short squeezes will continue happening on Bitfinex. As of Friday, BitMEX will settle all contracts based on TradeBlock’s XBX Index. When another similar situation occurs, read below on how to capitalise using BitMEX futures contracts.

Assume that Bitfinex’s price is $160 while the other major exchanges are trading at $220. Buying spot on an unlevered basis at $160 and selling at $220 gives an arbitrage profit of $60. Without using derivatives, buying cheap on Bitfinex and selling expensive elsewhere leaves time risk. In the time it takes to transfer Bitcoin between two exchanges, the price on the expensive exchange could fall to the level of Bitfinex.

Instead buy spot at $160, then sell XBT7D (BitMEX’s weekly XBTUSD futures contract) at $220. You have locked in a profit of $60. Once the coins have been transferred from Bitfinex to the expensive exchange, you sell spot and buy back your XBTUSD futures. If the rest of the global exchanges fell to the level of Bitfinex, then your XBT7D short position would profit. This would maintain your $60 arbitrage profit.

Ether Margin Trading vs. Futures Contracts

Soon after spot Ether trading began, leveraged products on the Ether/Bitcoin (ETHXBT) appeared. BitMEX was the first exchange to offer leveraged trading via a futures contract called ETH7D. The leading spot ETHXBT exchanges Poloniex and Kraken, have just started offering margin trading. This post will explain the differences and costs of margin trading vs. futures trading of ETHXBT.

Margin Trading

Margin trading requires that traders borrow Bitcoin to go long ETHXBT, and Ether to go short ETHXBT. Traders will then place their leveraged orders into the spot order book. The ability to borrow Bitcoin and Ether is not a sure thing. On Poloniex and Kraken other users must lend out their excess Bitcoin or Ether. If there is no supply, margin trading cannot happen. The interest rates paid are very volatile and can be expensive at times.

Futures Trading

The BitMEX ETH7D futures contract expires weekly every Friday. Each contract is worth 1 ETH, and traders must post Bitcoin as margin to go long or short. BitMEX allows 5x leverage. This means that there is no need to borrow ETH in order to short the ETHXBT exchange rate when using ETH7D. There is no daily interest rate charged either. The difference between where you buy or sell ETH7D and the current spot ETHXBT rate at the time represents an implied interest rate. For traders who have Bitcoin, ETH7D represents the easiest and cheapest way to go both long or short with leverage on ETHXBT.