Optimization techniques for FIX-based trading applications

By XTRD CEO Serg Gulko

Our team has about 20 years of experience with FIX API, with the last six years primarily in crypto (or digital assets, if you will).

During this period, we accumulated particular experience and knowledge of what is good and what is not when it comes to using FIX protocol. Some of our know-how I will share in this short article.

These techniques are general and can be applied to digital assets, FX, equities, etc. It also will work (with some exceptions) with REST/WebSockets APIs.

General optimization methods

Never run on operating system default settings

By default, your OS is pre-configured to run on average hardware profile, and it has no idea how much memory (and what type) you have, what sort of network cards you’ll use, what storage devices are installed, and how they are configured. We don’t know much about Windows or Mac OS, but Linux offers a great set of different configuration mechanisms for tuning. It’s like a free lunch — you can get additional performance by configuring your hardware correctly.

Tune your 10Gbps NICs for better performance

Increase TCP/IP buffers

For example, the default buffer size for Linux is 8kb. This value works perfectly for web browsing but might create problems for applications that work with market data intensively.

If possible, consider changing threads priorities

Again, Linux-specific — you can increase threads priority for specific processes.
In addition to this — bind your application to specific CPU cores (threads affinity)

If possible, choose the proper disk scheduler

Again… Linux has multiple disk I/O schedulers, each with its benefits and drawbacks.
If you run on SSD/NVME then consider using none. (https://access.redhat.com/solutions/109223)

Keep the number of threads as low as possible

This tip is more on the software development side rather than system configuration.
Try to reduce the number of working threads to a bare minimum — context switching comes with a price, and with two or three threads it might be ignored. But with hundreds or thousands of threads competing for resources, the overall impact becomes meaningful.

Market Data sessions optimization

Increase receiving buffers

Pretty straightforward.

Properly plan your processing architecture

Make an informed decision on how and where to process market data — update books, run calculations, send orders, or do anything else.

if these operations take some time, performing them in a separate thread is a good idea. This way, you can ensure that a FIX engine is busy emptying, receiving buffers, and not being part of the Monte Carlo calculation. Otherwise, there is a chance that you will become what we call a “slow consumer” and will be disconnected. Do not try to subscribe to all Binance, Coinbase, OKX, and Deribit instruments, and keep complex processing in a single thread.

On the contrary, if the number of instruments is low, algo is pretty straightforward (e.g. price checks), properly debugged, and profiled, you can always save extra time on context switching by placing your business logic inside FIX messages handlers. For example, the latency arbitrage system we built some time ago works precisely like this.

Turn off logging for market data sessions unless it is required

If you are not in the business of reselling historical market data, then turn off logging provided by FIX engines. Yes, we optimize market data streams, and our FIX-based feeds contain fewer data(in bytes) than native OKX, Huobi, ByBit, or GATE.IO formats. But it still will keep your disk system busy. And it takes some space too. A lot of space.

Trading sessions optimization

Increase receiving and sending buffers

Unlike market data sessions, where you mainly receive data, trading sessions have usually utilized both ways. This means that both sending and receiving buffers should be adequately increased.

Never turn off logging for trading sessions

Based on our experience, we always keep logging on for trading sessions. To mitigate I/O penalty, use asynchronous logging adapters.

If your FIX engine doesn’t have such a thing from scratch, it’s usually a good idea to invest some time to build it by yourself.

Use pre-cached messages

Use pre-cached messages instead of creating e.g. NewOrderSingle or ExecutionReports (in our case) every time you need it.

If your FIX engine supports this, run warm-up procedures before hitting the gas with actual trading. Sometimes developers use lazy-load initialization, and creating particular objects might happen only when you send an actual message. Pity if this message is your NewOrderSingle when you are chasing a price.

Use pre-cached timestamps

If you profile your code, you will be surprised at how long it takes to transform timestamps from long (data format) into strings. It might be beneficial to pre-populate formatted strings into memory. This task is challenging (populate, update), but the performance gain is significant.

Crypto exchanges API changes update: February/March 2021

Based on trades we observe, most of the work in the infrastructure and API development by digital asset exchanges lies in the area of derivatives and margin trading.  


Binance introduced several new API end-points to manage BUSD loans. 

Sub-accounts also got a new boost with these calls:

  • Create a virtual sub-account: /sapi/v1/sub-account/virtualSubAccount
  • Get a list of all sub-accounts: /sapi/v1/sub-account/list
  • Enable BLTV for sub-account: /sapi/v1/sub-account/blvt/enable


OKEx’s push towards a unified account structure is a great development that turned into a small technological drama. 

Unified Accounts allow clients to use the same API keys and balances to trade on spot and derivative markets. In theory, it makes traders’ lives easier so they don’t have to transfer assets back and forth from wallet to wallet. From anintegration standpoint, it’s a very practical move because with V5 API we should care only about a single API key pair and connectivity. 

In reality, this transition turned into a small mess – V3 and V5 keys were incompatible, many integrations stopped working, and V3 API keys creation moved into manual mode with up to three days of waiting time. 


On Feb 28, Huobi stopped legacy v1 WebSockets. Shiny v2 with features such as client’s assigned order id, extended account, order, and balance update channels are waiting for integrators to pick it. 


Disregard all advances in technologies, people still tend to make human-related errors. Fat Finger is a well-known but still often occurring situation. It does not spare anyone – crypto traders or respectful institutional players such as Citigroup (search for the recent $900M payout of Revlon debt).

BitMEX is the place where traders make a fortune or become broke in a blink of an eye. In February, BitMEX introduced Fat Finger protection:

  • All market orders with price deviation +/- 5% from TOB will be rejected 
  • All limit orders with price deviation +/- 5% from TOB will be rejected. E.g. if you want to place a BUY order above the current best ask plus 5%, the system will consider it as an error. 

Market Data: December 11, 2019

Market data report provided by XTRD FIX API


EXMO contains 161 trading pairs consisting of 53 assets

Removed cryptocurrency pair: 



Yobit contains 8469 trading pairs consisting of 1413 assets

New cryptocurrency pair: 


GATE.IO contains 432 trading pairs consisting of 204 assets

Removed cryptocurrency pairs: 



Huobi contains 559 trading pairs consisting of 230 assets

New cryptocurrency pair: 


Binance contains 682 trading pairs consisting of 199 assets

New coin listed: TROY

Available cryptocurrency pairs: 

New cryptocurrency pairs: 


Kraken contains 117 trading pairs consisting of 36 assets

New coin listed: CHF

Available cryptocurrency pairs: 


Coinsuper contains 109 trading pairs consisting of 80 assets

Removed cryptocurrency pair: 



PROBIT presently contains 349 trading pairs consisting of 197 assets

New coins listed: ALPD, VXV, DAI

Available cryptocurrency pairs: 

Removed cryptocurrency pairs: 



STEX presently contains 412 trading pairs consisting of 330 assets

New coin listed: VRAB

Available cryptocurrency pairs: 

New cryptocurrency pairs: 


HitBTC contains 918 trading pairs consisting of 397 assets

New coins listed: KRL, FTT

Available cryptocurrency pairs: 

Removed cryptocurrency pairs: 



Bittrex contains 331 trading pairs consisting of 225 assets

New coin listed: HDAC

Available cryptocurrency pair: 

New cryptocurrency pair: 

XTRD CTO Serg Gulko – Voice of America – Crypto Market Volatility

XTRD CTO Serg Gulko – Voice of America – Crypto Market Commentary

XTRD CTO Serg Gulko Interview – Voice of America 5/18/18