Musings on HFT in Bitcoin

I have 4 Bitcoin L3 exchange feeds running smoothly out of a data center in California (which is slightly closer to Asian exchanges and Coinbase than the east coast).  It took a bit of error handling and exponential back-off, to handle the unreliability of connectivity with these exchanges, where connections can intermittently be overwhelmed (returning 502 / 503 errors due to the poor choice of a REST-based API).

I am thinking to add Bitstamp and Kraken to the mix, even though they are smaller.   Bitstamp seems to have recovered somewhat since its security breach and Kraken is unique due to its EUR denominated trading.

HFT Opportunity

Bitcoin trading & order volume is quite far from the hyper-fast moving equities, FX, or treasuries markets.   That said, it has significant potential for market makers and short-term prop-trading given the greater transparency of microstructure in this market.    The caveat to this is that the transaction costs on many exchanges are enormous (10+bp or 20+bp round-trip), though for BTCChina is surprisingly free (fees are on withdrawal).

I am really at the beginning of collecting HFT-style data for the main exchanges, so while I have tested a couple of signals on very small samples, want to collect a larger data set for backtest and fine-tuning.   The 2 signals have tested are around short-term momentum detection, so can either use to follow momentum or use as a risk-avoidance in a market making engine.  In the later case would remove my offer from one side of the market if detect 1-sided direction, avoiding adverse selection.


Some marketplaces look to put in measures to keep their marketplace sane for lower-freq / non-HFT specialized traders.   In looking at the Kraken API today, noticed the following:

We have safeguards in place to protect against abuse/DoS attacks as well as order book manipulation caused by the rapid placing and canceling of orders …

The user’s counter is reduced every couple of seconds, but if the counter exceeds 10 the user’s API access is suspended for 15 minutes. The rate at which a users counter is reduced depends on various factors, but the most strict limit reduces the count by 1 every 5 seconds.

So effectively Kraken will allow for a small burst of order adjustments or placements, but only allows an average of 1 adjustment / 5 sec.   For a market maker 1 every 5 seconds (or 2 sides every 10) is too limiting.   This can become a problem for both market makers and trend / momentum followers if the market is moving.   Perhaps this limit should scale with respect to price movement or be combined with a higher limit + minimum TTL (time to live).

I am actually for certain restrictions in the market.  The equities market, in particular, needs to be cleaned up, not with new taxes or ill-conceived regulation (reg-NMS for example), but with:

  1. time-based priority / price-level  (believe it or not, there are order types that allow HFT to jump the queue)
  2. minimum TTL (time-to-live)
  3. some reasonable maximum # of orders / unit time on a security

#2 and #3 would remove many of the games on the exchange that do not serve the market.





Filed under strategies

7 responses to “Musings on HFT in Bitcoin

  1. Hi, I’ve stumbled over your blog a week ago. Thanks for posting your insight as they are very insightful.
    I’ve been into algo-trading with cryptocurrency for a year now, my experience tells me that although live data feeds exists on several of the major exchanges, HFT is still not mature enough because of high order posting/removing lags that create major execution losses.

    • tr8dr

      Hi Andrey, thanks for the insight. Took a look at your site, looks like you are working on interesting stuff. Noticed that you are doing a e-BTC arb. e-BTC trades at a substantial discount to other exchanges. My concern with doing arb at all is that the main reason why the arb exists in the 1st place is because of the perceived credit risk of the exchange(s) in question. I would love to be able to put significant money into a strategy like this, but there is a possibility of losing it all if the exchange disappears.

      As for market making & order posting / removal speed, what sort of latencies have you seen? I have heard anecdotally that people have had trouble placing aggressive orders and getting filled when the market is moving (especially on the chinese exchanges).

      • Thanks.
        We had done Intra-Exchange arbitrage on BTC-e. Our algorithm did work but investing in alt coins, we held 5 other cryptocoins at the time, proved not profitable. We had since moved to a more robust Inter-Exchange Arbitrage that actually makes profits.

        Order post time depends much on exchanges from our experience, it varies between 10ms and 1sec. The problem intensifies when you post multiple orders that get partially filled. In order to keep track of your position multiple private data request are needed.

        I cannot really comment on placing aggressive orders since I try to avoid it 🙂

        Do you think the BTC market is ready for an institutional investor?

      • Jacob Eliosoff

        Just to back up your comment on the dangers of these “arbs”. At some point, another of these exchanges will run into trouble – hacked, inside job, etc. When it does, it may make a public announcement, like Bitstamp did; or it may “temporarily” block withdrawals, like MtGox did. Suppose it blocks fiat withdrawals. Annoyed customers start resorting to withdrawing BTC instead. To do this they use the cash they meant to withdraw to buy BTC, then withdraw that. This creates artificial buying pressure on the creaking exchange, pushing its price above other markets.

        The arbitrageur sees this and thinks “Wow! Time to buy cheaper bitcoins on the other exchanges, send them here and sell them at a profit!” …And then tries to withdraw the cash, fails, and loses everything. This is how Gox played out, and it won’t be the last.

        True arbitrage means simultaneously buying and selling the same thing for a profit. But every exchange that flames out is a reminder that the coin you buy on BTC-e and the coin you sell on Bitstamp may turn out to be fatally different. Arbitrageurs should keep in mind that they’re short an option, and that some of the most tempting opportunities will turn out to be mousetraps.

      • tr8dr

        @jacob, thanks again for your insightful comments (and great to meet you the other day). I am staying away from “arb” in bitcoin because, as we’ve both said, the credit or liquidation risk is baked into the spread. Arbitrage without the exchange credit and liquidation issues will be possible, once and if exchanges are on a cross-exchange netting arrangement and fiat / BTC is held in escrow by PB or another trusted party.

        There is not only cross-exchange arb available, but BTC / fiat crosses which can, in theory, be arbed. A problem with doing the currency arb is that the transaction costs in the 10s of bp are often higher than the standard currency fluctuations. The bigger gaps can occur around news events and fixings, making it more workable.

        Anyway, short of a netting / escrow arrangement, no way I am going to play in the “arb” space. As you pointed out, can touch on arb in market making by offering your best bid or ask on separate exchanges where there is a small mispricing & is most favorable for a specific direction. Indeed one does that as well in market making on FX, though can do it across correlated currencies in addition to marketplaces.

  2. tr8dr

    @Andrey, cross exchange with BTC-e makes sense given the wide spreads. I have been reluctant to do this myself, because of my level of trust w/ BTC-e.

    As for institutional investment, I see the following problems:

    – exchanges should not be managing capital
    * credit risk of exchange disappearing with deposit is high (esp if is in the millions)
    * solution is to have cross-exchange PB or multi-currency escrow
    – liquidity
    * can run decent size during market moves, but still very small
    – diversification
    * with only 2 somewhat liquid assets (BTC, LTC), not much diversification possible
    * hard to find correlated assets outside of crypto space, so far

  3. Pingback: The Whole Street’s Daily Wrap for 3/15/2015 | The Whole Street

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s