How to do High-Frequency Trading on Binance
Understand
High-Frequency Trading exploits fleeting inefficiencies in the market by quickly buying or selling the inefficiency in order to make a profit. Therefore, the most important points to consider whether high -frequency trading is even possible on an exchange are the following:
- Trade cost vs inefficiency size
- Latency of tick data (incoming)
- Latency of trade execution (outgoing)
Trade Cost / Inefficiency Size
Trade costs on binance are high. Currently (Nov 2024) for Spot trading fees can be as high as 0.1% for Level 0 down to 0.018% for maker trades using BNB and with the referral discount. This means that in order to be profitable, you need to surpass at least 0.036% profit for each position taken (because the fee is paid on entering and exiting the position). More likely, if you're an individual or small operation you would need to surpass 0.15% to make a profit (Level 0 fees using BNB).
If one can find these opportunities, executing the trades on Binance quickly is challenging.
Latency of tick data (incoming)
Binance provides data through various APIs, some even without requiring login credentials. The most straightforward way to stream tick data is using the WebSocket depth API, however the minimum update interval is one update every 100ms. If you open multiple, staggered depth streams on the same symbol, you will receive the same data through each websocket (i.e.. it's not possible to get higher granularity data using multiple websocket connections)
For High-Frequency trading the important part is how long it takes data from Binance to reach your system. This affects the ability to exploit a short-lived market inefficiency and to compete with other people or companies trying to do the same thing. There is no official co-location offered by Binance.
Latency of trade execution (outgoing)
The other side of the latency equation is how long it takes to execute the trade on Binance's system. The algorithm used to decide whether to enter or exit a position also plays a role, because the longer it takes to decide, the greater the time since the opportunity was found and when the trade is executed by Binance.
For example, if a strategy requires processing weeks or months of historical data to check whether something strange has occurred on the current tick, and without any clever optimisations, it's likely that the computation will add significant delay that can cause the strategy to become non-profitable.
Time taken to send a trade to binance and have it executed is normally very similar to the time taken to receive tick data.