The Client
The client is a prop trading firm established in 2010 and recognized as one of the leading players in the Indian capital market.
Business Challenge
The client set its sights on further expanding its investment offerings to include everything from equities to derivatives to government bonds. It obtained a license from the National Stock Exchange of India (NSE) with plans to start a proprietary trading business. The client needed a trading platform that would work seamlessly with select NSE segments:
- Equities
- Index Futures
- Index Options
The platform needed an interface allowing customers to execute strategies and monitor performance. The client wanted to employ numerous high-frequency trading (HFT) strategies for which trading speed should be paramount. The solution needed to maintain a list of passive arbitrage strategies including:
- Futures-to-futures
- Conversion-reversal
- Volatility
The platform also had to maintain active bidding strategies, namely, cash-futures arbitrage. The HFT strategies were sub-microsecond-level sensitive, so the platform required ultra-low latency software.
Solution
The client approached Devexperts with the project because the technology vendor is experienced in delivering reliable and secure software solutions to the capital markets industry.
Devexperts undertook a comprehensive, systematic, and evidence-based approach to HFT technology across the industry and in India. A minimum viable product (MVP) was developed to test all hypotheses as a series of experiments over one year. During the research phase, Devexperts was able to refute many common theories. For example, before the project, it had been widely believed that the early connection to the Quote engine generated faster quotes. Devexperts proved that wasn’t the case and began searching for a better solution.
Devexperts ended up developing much more than a run-of-the-mill HFT solution. After thorough R&D and iterations, the client received a sophisticated, customized HFT powerhouse that can be divided into two core components: 1) an Indian-based NSE collocation and 2) Devexperts’ OMS module. The solution comprised the following technologies:
- NSE Tap. A Trading Access Point facilitates IT Infrastructure consolidation and routes the orders and trades between the Client and Server in an optimized protocol.
- NSE (Tick-by-Tick) TbT receiver. This is the market data receiver application over the NSE TbT protocol.
- HFT core
- Memory
- HFT FIX gate. This is the gate that receives strategies through the FIX protocol.
- QD gate. This is the library that sends quotes back.
- dxCore server
- OMS Database
- Quote multiplexor
- Dealer. This is the interface where the client’s traders can set up and execute a strategy.
- Local admin. The dxPro interface shows information about accounts, trades, and strategies.
Devexperts considered many ways to minimize latency and focused on significantly improving the speed. The final techniques used to optimize the speed included:
- Customizing the TCP stack parameters
- Binding thread to the CPU Core (CPU affinity)
- Customizing the TCP for the localhost
- Boosting the server frequency
- Removing the system jitter
- Customizing the cache line usage and context switches.
The end solution fully complies with all Indian laws and regulations, including NSE rules.
Devexperts used various tools throughout development. The emulator was written using the Erlang programming language, and the algorithmic engine was written in pure С language to avoid nonlinear latency spikes, which can be caused by languages containing a Garbage Collector.
The hardware and SDK aspects included:
- Mellanox and WMA
- Solarflare and OpenOnLoad
Results
Devexperts conducted thorough research and analysis, implementing the MVP and successfully launching the high-frequency prop trading platform. Devexperts’ engineers, testers, and developers approached the project from an industry best practices framework to deliver a highly competitive HFT solution to the client. Not long after the platform debuted, its features became widely recognized as having speed comparable to that of the client’s main competitors.
Upon project completion, Devexperts identified room for further development and advised the client accordingly. Cooperation between the client and Devexperts continues today, and the client now ranks among the top three Indian stock trading companies.