# How does a high frequency trading bot work?

Let’s go back to your buy order of 10 BTC and imagine that it was broken down to ten 1 BTC orders.

On some exchanges, traders have the ability to place a maximum price they’re willing to pay. This is something the exchange uses if the price changes very quickly and the market order fails. So, if BTC’s market price is 9,000 a trader would indicate the maximum price as 9,050 or 9,100. Let’s get to the fun part now.

As you remember, your trade was broken down into ten 1 BTC orders and you indicated your maximum price as 9,100. Let’s now imagine that the first BTC was processed easily and was given to you for 9000 because it’s the market price.

Once that 1 BTC is processed, the HFT server will notice the trade being made immediately. We’re talking nanoseconds here because of the co-location to the exchange’s server. It immediately identifies you as a big trader as it’s programmed to think that a large trade is just a part of an even larger one.

Therefore, it will start trying to identify your maximum price. It has seen that you bought 1 BTC for 9000, so it will try something like 9500 but will fail. After failure, it will try 9400, 9300 and all the way down to 9100.

Once it guesses that you’re willing to pay 9100, it buys up all of the 9000 priced BTC on the exchange’s server because it has faster access and then sells you all of them for \$9100 a piece. This way, the HFT user gains a profit of around 800-900 in a millisecond, while you have to pay more for the remainder of your BTC order.

Is that how it really works? if yes, how do they identify the maximum price someone is willing to pay?

That is entirely wrong. When you place your 10x 1BTC buy order @ 9100, you will probably taking out the ask order on the limited order book which is @ price of 9001, 9002 .... etc.

And there is no way anyone can process information within a few ns. The entire article is written by someone who knows nothing about HFT and want to "impress" someone else as if he knows a lot....

• Thanks, can you comment how HFT bots make money then? I cannot understand what they do Commented Dec 20, 2019 at 11:03
• Everyone has there own strategy and it is difficult to say a universal method. And HFT is different from algorithmic trading as well Commented Dec 20, 2019 at 13:54
• I agree that it varies. But generally when a product trades in a decentralized manner (on many exchanges, rather than one) HFT can profit from tiny temporary discrepancies between venues. I know nothing about BTC but it probably also has this "feature". Commented Dec 20, 2019 at 18:34
• It is not easy to arb between exchanges as many firms have already been doing this, some with access to low latency microwave. Commented Dec 21, 2019 at 2:41

No. If you sent 10 orders for 1 btc and they all hit the matching engine then in any sane microstructure you should get your orders processed before the counter has time to process your 9 trailing orders (assuming your limit price is above the best offer)

And if they can react to the first order before the others hit the gateway then they would not be able to test against your trailing orders.

• Thanks, can you comment how HFT bots make money then? I cannot understand what they do Commented Dec 20, 2019 at 11:03
• « HFT bots » is so diverse that it is not well defined to talk about what « they do » as it suggests there is a single hft strategy. HFT only means any strategy that processes real time market data and takes decisions based on that. One example of very basis strat is price arbitrage between 2 exchanges markets in case they are crossed. Buy the lower ask and sell the higher bid. Those require HFT since market inefficiencies last only a fraction of a second typically.
– Ezy
Commented Dec 21, 2019 at 11:42