📜 ⬆️ ⬇️

Stock Market Technologies: Brokerage Trading System

Trading on the stock exchange in the 21st century is an extremely high-tech process. In order for an investor to make a deal, various trading terminals are being developed, brokerage systems are being created that can handle a large load, APIs are implemented for them, high-speed communication channels are laid, new technologies are put into operation, etc. This is not surprising - after all, between success and failure, profit or loss in the stock market is often only a split second. Therefore, everything should work like a clock and very quickly.

image

We have already talked about direct connection technologies that are used to send trade orders directly to the exchange, bypassing broker systems. However, direct access costs a lot of money and is not affordable for all traders who, however less, want to make transactions with maximum speed. In this topic, we will describe how we implemented a full upgrade of our trading system, which allowed us to create an infrastructure product that meets international standards for stock market technology.
')

Welcome to the matrix


ITinvest has always been not just a broker that provides customers with the opportunity to trade on the exchange, but also a technological developer of products for trading. Our founders are people who have had experience in programming and in general have always been associated with technology. Therefore, part of the company's strategy has always been the development of its own software products.

Both money and time have always been invested in this. As a result, at the beginning of the two thousandths, its own trade system, it-trade, was created, which included modules for processing trade orders, the middle and back office, as well as a digital signature system for security. In addition, we have created a line of our own trading terminals. One of them, SmartTrade, has become very popular in the Russian market and, in principle, still remains a reliable and convenient means of bringing trading orders to the market and analyzing the market itself. Clients could carry out trading operations using the web interface.

The system has been operating for more than 13 years and the entire set of software products is objectively outdated. They were harder to maintain, develop functionality (more than 1 million lines of code in one SmartTrade terminal), besides, the architecture itself also ceased to meet modern requirements - we had two sales desks with servers, and in order to develop the company's business, their the number had to be increased, which would have caused problems with manageability and synchronization.

As a result, all efforts were spent on the maintenance and normal functioning of the shopping complex, but it was not a question of developing new products. The requirements for the speed of work and its quality were constantly growing, and it became increasingly difficult to comply with them within the framework of the old architecture and paradigm. In addition, in the “old” trading system there was one weak link - its core, the risk management system (RMS), which could not be parallelized and duplicated in principle. Accordingly, its failure could stop trading.

All this has put us in front of the need to create a new trading system that would meet the best international standards. Due to its matrix structure, as well as due to the fact that the matrix theory was applied in the calculation of risks, the new system was named MatriX , that is, “The Matrix”.

Architecture


If in the brokerage system of the previous generation, customers received all exchange data (orders, transactions, account status, etc.) connecting to a single access server, then in the Matrix project it was decided to divide these data streams into two main “banks”: receiving orders (Order Mamagemegent Servers - OMS), and servers providing market data and account information to customers.

The complex hardware uses PowerEdge blade servers and PowerVault storage systems from Dell.

Technology and iron


In addition to architecture, the quality of the brokerage trading system depends on the quality of software that implements the main functions, as well as the reliability of the hardware on which it works. In order to be sure that our product really meets international standards, tenders were held among suppliers of both iron solutions and software developers.

As a result, the iron part of the new system was provided by Dell, and the software (and some hardware) was supplied by IBM.

image

Dell PowerEdge Servers

Under each of such balancers, there are several more servers that solve local problems. Client connections are distributed between them so that each server receives the same load.

Between themselves and with the exchange trading system, our servers are connected using a special high-speed bus built on IBM Data Power X75 servers and MQ Low Latency Messaging software.

An interesting fact: the MatriX project is the first use of these servers in Russia. By the way, even some problems were connected with this - the United States recognizes these technologies as having a dual purpose. That is, there is a possibility that someone uses them for military purposes. Due to the delays associated with all this, the delivery time of the equipment has shifted by as much as six months - and we are lucky that the famous Jackson-Vanik amendment was canceled, otherwise it is unknown how everything would turn out in the end.

Behind this bus are already servers of exchange gateways. Through which of them to send a specific application, or from which of them to take the data, the bus decides on its own. In principle, this is sufficient for the normal functioning of the entire system, but we also added a risk management server to it, which, unlike the previous system, is no longer the central link, and any problems with it do not cause the entire system to stop.

Another innovation is the so-called FIX servers, which allow you to connect to the MatriX TS applications written for the FIX protocol. We will tell about this decision in more detail in a separate topic.

The final system architecture looks like this:

image

What did it do?


Such a “matrix” approach to building a system allowed reducing damage from possible failures (failure of a particular link does not lead to irreversible consequences), and also allows the system to be easily scaled in the future. What is most important - dramatically increased the speed of work. Now the application processing speed in the system ranges from 500 microseconds to 2 - this is a very good result. The total time it takes for an application to pass from the moment it hits the Matrix to its entry into stock exchange systems is 2 to 5 milliseconds (not including losses on communication channels to the system) - this is about 40/50 times faster than in the system of the previous generation of it- trade | SmartTrade ...
For traders who trade hands, this is certainly not so important, but for algorithmic traders who use robots connected via API is a significant advantage.

Among other advantages of the new trading system:


You can use the new trading system when working through the SmartX terminal, the new version of the web interface of the trading system or the SmartCOM API (version not lower than 3.0).

Single cash position


The single cash position service for customers has become one of the main features of the entire new trading system. Its essence is as follows:

When working with the previous version of theit-trade / SmartTrade trading system, the client was provided with a separate personal account for each trading platform. For example, the Moscow Exchange Stock Market is an MS account; Derivatives Market of the Moscow Exchange - RF account; The foreign exchange market of the Moscow Stock Exchange - FX account (non-deliverable) or CD account (deliverable) and others. With such a division, securities and cash located on the same trading platform cannot serve as collateral for transactions on the other.

When using a single cash position, the client is provided with a single account with the MO identifier, which includes several trading platforms at once:


This account becomes the same for all trading platforms, and assets (money, securities) located on the same trading platform of the market can be used as collateral in other markets included in a single cash position. (You can hear more about the single monetary position in the webinar recording of Vladimir Tvardovsky, Chairman of the Board of ITinvest, starting at 17:01).

image

The easiest way to understand the benefits of a single monetary position is a simple example. If in the old trading system it-trade, it would have taken 43,800 rubles to purchase 100 shares of Lukoil (LKOH) as security (the value of the share as of 10/22/2013 was 2030 rubles, the value of the security for the T + 2 market is 438 rubles, 100 x 438 - 43500 ), and for the sale of 10 futures contracts for shares of the same issuer LKOH-12.13 (on the same date, 1 futures cost 20,650 rubles, security - 2,132 rubles) would require 10 x 2132 = 21,320 rubles. In total, for the commission of two not very large transactions, the amount of funds required to secure the transaction would exceed 65,000 rubles.

In the new trading system, it would be equal to 26,746 rubles. The difference is quite significant - it turns out that you can manage your own funds more flexibly, they can work, rather than idle in a blocked state as a security.

Need for Speed


A single cash position, as you might guess, with all its advantages, may be of interest to traders and traders of any type - from investors who do not make very many deals, to scalpers who do not remove fingers from the keyboard.

At the same time, it is obvious that the high-speed advantages of the Matrix trading system most attract high-speed traders (HFT-traders), who trade on the stock exchange using mechanical trading systems. It is this type of merchants that "makes" most of the turnovers of all popular stock exchanges. Such traders play a large role in the stock market ecosystem (for more details on trends and prospects for algorithmic trading, read our special topic ). But no algorithmic trading strategy, even the most successful in theory, can work normally in practice unless proper rapid action is ensured.

Therefore, both the exchanges and brokers are constantly engaged in the development of their own infrastructure - only in 2010, exchanges, telecommunications companies, algorithmic hedge funds, corporate and private algorithmic traders spent more than $ 2 billion on technical re-equipment to increase trading speed worldwide.

Domestic stock exchanges (in particular, Moscow Exchange) also follow this trend. If in 2010 the execution time of orders in the ASTS trading systems (MICEX stock market) and FORTS (RTS derivatives market) were 5-15 and 15-50 ms, respectively, in 2013 the figures were 0.700 ms and 3-5 ms. Now the time of the execution of applications in the core of the exchange system does not exceed 50 microseconds.

When looking at all these efforts, it is clear that brokers simply do not have the right to lag behind, so a further upgrade and improvement of this link of the chain, which the application passes along the path from the user to the exchange, is simply inevitable.

Source: https://habr.com/ru/post/218431/


All Articles