📜 ⬆️ ⬇️

Why is a stock exchange an IT company?

“And what kind of material are you going to post on the corporate blog, you are not an IT company?” - that was the question we were asked when we contacted Habrahabr to open a corporate account. And once again they were convinced that it was time to get out of the shadows, and to tell that any stock exchange — and the Moscow Exchange, including — is, first of all, a high-tech company with its own trading and clearing systems, advanced IT infrastructure, large-scale developments and a wide range of different services.

The success of most large companies depends on IT-development, in particular, their modernity, reliability and performance. For example, on average, up to 30% of the employees of the world's leading exchanges are IT specialists involved in the development of trading platforms, their support, as well as hardware. And the Moscow Exchange is completely in trend.

The exchange is a trading platform whose main task is for the end customer to buy or sell the necessary amount of an asset at a price that suits him, at a point in time determined by him, and is guaranteed to receive this asset to his securities account or money from its sale to his settlement score.
')
Any of the above procedures today occurs electronically.
image

NSD (National Settlement Depository) - accounting of rights to securities, custody of securities.
NCC (National Clearing Center) - clearing according to the results of trades, as well as the central counterparty (central counterparty) in exchange markets.

Simply put, an ordinary investor only needs to enter into a service contract with a broker company that provides access to the exchange. All his subsequent interactions with the exchange and the broker occur exclusively in the IT plane. The exchange came to such a format of relations with its customers in 1998-1999. Then the first scheme of remote access to the exchange was developed and implemented. It was during this period that Internet trading appeared, which instantly made exchange trading accessible to any category of investor.

Moscow Exchange is one of the most complex stock exchanges in the world, including in terms of technological processes and system development. Why? First, because it combines 2 functions at once - trading and clearing. In standard world practice, risk management and clearing services are provided by large clearing houses - third-party organizations. Secondly, while most global sites trade only one or two classes of instruments, our product line is much broader and includes stocks, bonds, units, ETFs, futures, options, currencies, repos, gold, and soon time is also grain.
image

The main tasks of the exchange are matching, risk management and clearing.

Matching applications for the purchase and sale - mixing the seller and the buyer in one "glass".

Risk management is a real-time check of each application for the availability of collateral, the correctness of its parameters, etc.

Clearing - conducting settlements on the basis of all transactions after the end of a trading session and crediting a financial result or assets to customer accounts.

Today, in parallel, there are three trading platforms with different IT-systems: stock, currency (+ precious metals) and urgent. Thus, in total, the exchange functions 37 hours a day: the stock market is open for 9 hours, the currency market and the derivative financial instruments market (urgent) for 14 hours.

Trading systems / software systems

Three trading platforms are built on two platforms: ASTS and SPECTRA .

The first platform is ASTS (automated securities trading system). It is used in the stock, currency, money (repos and deposit and credit operations) and commodity markets. It is rooted in the system created by the Australian company FSDC (soon joined the Australian Compushare, then absorbed by the Swedish OMX, which later merged with the NASDAQ). Accordingly, until 2012, the system was licensed from the NASDAQ-OMX. In 2013, the license was purchased. Over the 20 years since the acquisition of the system, it has been very substantially reworked, not only in terms of introducing new features, but also introducing changes to its architecture. One of the features of the system was the emergence of a scheme with the deployment of remote access servers (Gateway), which enabled the Exchange customers from various regions of the country from St. Petersburg to Vladivostok to participate in the auction in the late 90s. Then came Internet trading and various protocols and access schemes (this will be a separate post). The systems of "warm" and "hot" redundancy are introduced. The platform has got dozens of auxiliary modules, among which is the index calculation system, including the well-known MICEX index.

The ASTS platform has grown a lot since it was bought from NASDAQ — the number of lines of kernel source code has increased about 15 times. The core of the system is written in C and runs on the RedHat Enterprise OS with a real-time core. And initially the system was under HP-UX, large-scale projects for the transition to 64-bit architecture and Linux were completed in 2010-2011.

It is worth noting that the NASDAQ was also actively developing this code and is now selling the X-stream exchange system created on its basis.
Schematically, the current architecture of the ASTS software package is as follows:
image


TKS SPECTRA

The second trading platform has a code base - SPECTRA. It is based on the derivatives market (futures and options market). This is a completely internal development, which has a modular architecture, a single high-speed data transmission bus and an integrated risk management system. SPECTRA, which took 1.5 years to develop, was introduced on the derivatives market at the end of 2012 and replaced the old core of the FORTS market of the derivatives market. The previous generation of FORTS systems is still functioning on the stock exchanges of Ukraine and Kazakhstan.

The SPECTRA architecture has improved fast online risk checking for complex derivative instruments. The modularity made it possible to improve the statistical characteristics: the number of processed applications increased from 2,500 (the previous generation of FORTS) to 36,000 applications per second, and also provided the ability to integrate with third-party match cores and risk management systems.
image


Specifications

Three parameters are important in the operation of an exchange trading platform: performance — the number of transactions performed per second; a delay in reacting to an event (latency), for example, the time between the arrival of the application and the time it enters the order book; the constancy of the reaction rate, i.e. the system should react with a more or less constant delay.

The ASTS platform processes up to 15–20 thousand transactions per second with an average delay range of 300–350 μs. What is included in this period of time?

Less than 100 µs after receiving the order on the access server (or on the input network switch of the exchange's technical center), the order will be delivered to the central link of the trading system. Next, it will begin to check for security (risk parameters) and register in the order book, including the possible conclusion of transactions. A message to the client who submitted the application, about the completion of its processing and the result of processing, will be sent on average 300-350 μs after receiving the application. The total amount of operations on ASTS reaches 75 million per day.

The performance of the SPECTRA platform is up to 36 thousand requests per second with an average latency of 400 microseconds. On average, about 30 million operations pass through the system per day.

For comparison, the latency at the London Stock Exchange (LSE) is 150 µs, and the Frankfurt Stock Exchange (Deutsche Boerse) for processing the application takes 150 - 200 µs. But speed is not the only requirement for exchange systems. Sometimes the pursuit of speed leads to mistakes that customers have to pay for, and this is an unacceptable risk. Therefore, another fundamental requirement for stock exchange systems is reliability, which we will definitely tell you about in the future.

I would like to tell a lot more, but it is difficult to fit everything into one post. That is why the first publication was more informative. But we still pursued a definite goal - to hear the comments of our readers and choose future topics together.

We are waiting for your comments about what you would like to read in our blog!

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


All Articles