SPECTRA Plaza-2 gate

Revision History
31.08.2015

Table of Contents

Introduction
SPECTRA system overview
Trading participants
Instruments
Trading operations
Delivery of assets and expiration of options
Trading and clearing schedule
Risk management and limitation of trading operations
Trading gate description
SPECTRA Plaza-2 gateway. Components, installation and setup.
Market data structure
Gate usage specifics
Handling abnormal situations
Replication scheme FORTS_PUBLIC
Stream FORTS_FUTTRADE_REPL - Futures: orders and trades
Stream FORTS_OPTTRADE_REPL - Options: orders and trades
Stream FORTS_ORDLOG_REPL – anonimous orders
Stream FORTS_DEALS_REPL – anonimous trades
Stream FORTS_FEE_REPL - exchange fees
Stream FORTS_FUTORDERBOOK_REPL - Futures: order book snapshot
Stream FORTS_OPTORDERBOOK_REPL - Options: order book snapshot
Stream FORTS_ORDERBOOK_REPL - Depersonalized order book snapshot
Stream FORTS_FUTCOMMON_REPL - Futures: common information
Stream FORTS_OPTCOMMON_REPL - Options: common information
Aggregated orderbook streams
Stream FORTS_POS_REPL - information on positions
Stream FORTS_PART_REPL - information on fund, limits and risk parameters for clients
Stream FORTS_FUTINFO_REPL - Futures: reference and session information
Stream FORTS_OPTINFO_REPL - Options: reference and session information
Stream FORTS_MISCINFO_REPL - miscellaneous information
Stream FORTS_MM_REPL - information on MM's obligations
Stream FORTS_CLR_REPL - clearing information
Stream RTS_INDEX_REPL - online indices
Stream RTS_INDEXLOG_REPL - indices history
Stream FORTS_VM_REPL - online variational margin stream
Stream FORTS_VOLAT_REPL - online volatility information
Stream FORTS_INFO_REPL - additional reference information
Stream FORTS_TNPENALTY_REPL - information about Transaction fees
Stream MOEX_RATES_REPL - online currency rates
Commands description
Method FutAddOrder - Add order
Method FutAddMultiLegOrder - Add multileg order
Method FutDelOrder - Cancel order
Method FutDelUserOrders - Mass cancel order
Method FutMoveOrder - Modify order
Method OptAddOrder - Add order
Method OptDelOrder - Cancel order
Method OptDelUserOrders - Mass cancel order
Method OptMoveOrder - Modify order
Method FutChangeClientMoney - Modify client limits and risk parameters
Method FutChangeClientVcb - Modify client's parameters for an underlying asset
Method FutChangeBrokerVcb - Modify brokerage company’s parameters for an underlying asset
Method FutChangeBFMoney - Change brokerage firm limits
Method FutChangeMoney - Modify limits for buying RTS standard instruments on underlying assets
Method OptChangeExpiration - Add order for expiration of options
Method FutChangeClientProhibit - Modify client's restrictions for futures
Method OptChangeClientProhibit - Modify client's restrictions for options
Method FutExchangeBFMoney - Tranfer funds within brokerage firm
Method OptRecalcCS - Recalculate central strike request
Method FutTransferClientPosition - Transfer futures client position
Method OptTransferClientPosition - Transfer options client position
Method CODHeartbeat - Heartbeat message for Cancel on Disconnect Service
A. Plaza-2 data types
B. List of return codes

Introduction

Document purpose

This document is aimed to overview all the details which users may demand to architect and develop software applications for accessing the SPECTRA market using the SPECTRA Plaza-2 gate. The following parts are available in this document:

  • The SPECTRA system general overview, including overview of trading instruments, trading participants, trading operations, risk management, limiting of operations, etc.

  • Configuration, installation and setup of the SPECTRA Plaza-2 gate software in the form of user manuals on software installation and setup with information on minimum hardware and software requirements. Also, some general references on using the SPECTRA Plaza-2 gate software are added.

  • Information on the structure of transmitted data, including description of replication streams and transmitted tables.

  • List of commands.

  • Help information.

Target group

This document is intended for business-analysts, system architects and developers, taking part in architecting and developing software for accessing the SPECTRA market using the SPECTRA Plaza-2 gate.

SPECTRA system overview

Trading participants

Trading participants are:

  • Clearing firms

  • Brokerage firms

  • Clearing firms and brokerage firms' clients

Clearing firms

Clearing firms are firms which incur liabilities for risks and cover risks of their clients and sub-brokers.

Clearing firms are authorized to:

  • Perform trades on behalf of themselves and at for their own accounts;

  • Perform trades on behalf of themselves and for their clients' accounts;

  • Perform settlement directly with National Clearing Centre.

  • Service their clients, including brokers;

  • Exercise control over their clients and brokers during trading sessions.

Clearing firms are obliged to:

  • Become members of Derivatives Market Section;

  • Perform commodity futures and option trading trades on exchange on the authority of exchange merchant licence issued by the Central Bank of Russia;

  • Pay fees to Insurance fund;

  • Provide collaterals for their own trades and for their clients' trades.

Brokerage firms

Unlike clearing firms, brokerage firms do not settle up with exchange directly; instead, they use their clearing firms. Also, brokerage firms are not obliged to obtain licences and pay fees to the Insurance fund.

Brokerage firms are authorized to:

  • Perform trades on behalf of themselves;

  • Perform trades on behalf of their clients;

  • Place orders in the Trading system via the client terminal application

  • Exercise control over their clients during trading sessions.

Brokerage firms are obliged to:

  • Provide guarantees for their own trades and for their clients' trades.

Clients

Any physical or corporate person can participate in the SPECTRA market as a client on the authority of trading service agreement signed with a brokerage firm or with clearing firm directly.

System code pattern

There is a 7-symbol code pattern (XXYYZZZ) to identify each participant in the system, where

  • XX — indicates a clearing firm

  • YY — indicates a brokerage firm

  • ZZZ — indicates a client

The 00 brokerage firm code indicates state of account of the clearing firm.

Example 1. 

Q100 — indicates the Q1 clearing firm

Q1DU — indicates the DU sub-broker of the Q1 clearing firm


The 000 client code indicates state of account of the brokerage firm.

Example 2. 

Q1DU000 — indicates state of account of the DU sub-broker of the Q1 clearing firm


Disclosure of data on participants

The list of clearing and brokerage firms is stored in the 'diler' table of the 'FORTS_FUTINFO_REPL' stream, and the list of clients is stored in the 'investr' table of the 'FORTS_FUTINFO_REPL' stream. Disclosure of data on brokerage firms and clients is limited in accordance with user access rights.

Streams and tables also contain links to 7-symbol clients' codes and 4-symbol brokerage firms' codes.

Users. How a user is linked to a trading participant

A user (login) can be associated with various levels of participants:

  • Clearing firm login. Users connected with this login are allowed to view data and perform trading operations on behalf of any brokerage firm or of any client of the clearing firm (please note that performing trading actions is only allowed when the user has sufficient rights!). Users also allowed to set limits for clients and sub-brokers by calling the appropriate operations. A gate software which is used by and in behalf of an clearing firm has to implement 'Technical Center Interface' (for details, see Technical Center Interface).

  • Brokerage firm login. Users connected with this login are allowed to view data and perform trading operations on behalf of all broker's clients within the clearing firm, and also set limits for the broker's clients.

  • Client login. Users connected with this login are allowed to perform trading operations on behalf of a certain client of a brokerage firm and view data in accordance with the client login rights.

There is a special 4-symbol 'broker_code' field within the scheme of EACH message-command (see Commands description). Every application using the clearing firm account is to fill in this field with a 4-symbol code of a brokerage company registered with SPECTRA when sending any message. Applications which use the client or the brokerage firm account are exempt from this rule.

Instruments

The SPECTRA instruments are structured hierarchically. Below you will find descriptions of the SPECTRA instruments starting from the root level.

Underlying assets

An underlying asset is an entity related to a certain contract. Therefore, it can be a stock in a stock exchange, a lot of tradable commodity in a commodities exchange or an index/exchange rate/indicator for settling futures. There are certain attributes characterising an underlying asset along with its instruments, which are:

  • Trade section name;

  • Various commision fees rates and signs of scalping when fees are calculated. If an asset shows a sign of scalping, the comission fee will be only levied on opening trades.

  • Delivery type according to the contract (for details, see Delivery of assets and expiration of options):

    • Delivery of the asset itself;

    • The asset delivery by opening a position in the spot-market;

    • Settlement type. The margin between the opening price and the closing price is the single amount of money to be paid after the trade is closed.

  • Price step calculation currency. Now it can be one of the following:

    • RUR — when cost of price step is indicated in Russian roubles. The cost of price step is not typically a subject to change during the life of contract;

    • USD — when cost of price step is indicated in Russian roubles. The cost is converted into USD at the opening according to the exchange rate issued by the Central Bank of Russia. Cost of price step is also a subject to change upon every opening.

    • USR — when cost of price step is indicated in Russian roubles. The cost is converted into USD by using a special Moscow Exchange method of conversion (for details, see http://moex.com/n6126). Step price is a subject to change twice a day, i. e. during the main clearing session and during the intermediate clearing session taking place at 2 PM daily.

  • Types of trading, where two types are existing: collateralized and non-collateralized. For the collateralized trading, a part of deposit can be pledged by transferring shares and other securities in accordance with the authorized list.

An underlying asset IS IN NO WAY A TRADING INSTRUMENT!

Data concerning underlying assets are contained in the 'fut_vcb' table of the 'FORTS_FUTINFO_REPL' stream.

Futures

Futures contracts are the main trading instruments in the SPECTRA system.

Each futures contract is linked to a certain underlying asset and has its own unique characteristics of the maturity (the date of delivery), lot characteristics, minimum price step and cost of the price step value.

The date of delivery is specified with 3-months interval for every future contract, i.e. mid-March, mid-June, mid-September and mid-December. There can be more than one futures contract for each underlying asset.

Futures contract with various dates of delivery may form a calendar spread. In this case, when risks are calculated, the price correlation is always taken into account. As a result, the total collateral for the spread can be less than sum of collaterals for each futures contract itself.

Futures are typically quoted in price points; however, the future contracts for interest rates and bonds are quoted in annual percentage rate.

The price in roubles for the futures quoted in price points is calculated as following:

, where:

  • PricePoints — indicates price in points;

  • step_price — indicates cost of minimum price step

  • min_step — indicates minimum price step in points.

The price in roubles for the futures quoted in annual percentage rate is calculated as following:

  • PricePoints — indicates price in points;

  • d — indicates number of days left to expiration of the futures contract.

Three more fields are required to fill when it comes about future contracts quoted in USR:

  • Cost of price step in initial currency, i.e. in USD;

  • Cost of price step in Russian roubles, which is fixed upon intermediate clearing session opening;

  • Cost of price step in Russian roubles, which is fixed upon the main clearing session opening.

When a trading instrument is put into system, it becomes available only upon opening of the evening trading session (for more info, see Trading and clearing schedule).

Futures contract data ara stored in following tables of trade interface:

  • 'FORTS_FUTINFO_REPL' stream, 'fut_sess_contents' table. This is the main table, which contains a list of futures contract available on the current trade session;

  • 'FORTS_FUTINFO_REPL' stream, 'fut_instruments' table. The table contains limited data amount about all future contracts put into the system, including non-tradable contracts. These data are necessary for client application to calculate volatility index and variable margin values.

  • 'FORTS_INFO_REPL' stream, 'futures_params' table. This table contains data about option contracts. According to the data format the table can be loaded by the ClientGo client application for calculating risks.

Options

At present, the SPECTRA system supports American futures options. These options can be divided into two types: 1) so called futures-style margining options type, when variable margin to be paid is based on the settling price, which is calculated twice per trade session; 2) premium options type, when seller receives option premium upon exercising of the option.

Once an option is exercised, its position turns into a futures position which the option was initially linked to.

There are various expiration dates for various options. Unlike futures, there may exist "short" option positions, aimed to be exercised in the middle of the next month. Once the option is exercised, its position turns into a 3-months futures position.

At opening, an amount of strike price values is specified for each option. These strike price values are dispersed near the price value of the futures contract, which the option was initially linked to.

Options data are stored in the following tables:

Multi-leg instruments

The SPECTRA system supports multi-leg trading instruments, i.e. the instruments consisting of more than one components. This allows to use a trading strategy, when a client gets additional positions on two or more instruments when trade is complete. The instruments available now are calendar spreads for futures.

The list of the multi-leg instruments available in the system can be obtained in the 'fut_sess_contents' table of the 'FORTS_FUTINFO_REPL' stream, by looking at the 'multileg_type' field. If a value in the field is not equal 0, than the record describes a compound instrument.

To obtain the list of components of compound instruments you should use the 'multileg_dict' table of the 'FORTS_FUTINFO_REPL' stream, where every multi-leg instrument has two or more entries describing components of such instrument (see pic. 1). The 'multileg_dict' table entries refer back to 'fut_sess_contents', because the components of these instruments present as common trading instruments. We indicate a special coefficient for every single part, which should be multiplied by the amount from initial order to acquire the amount of a compound part of the order. The sign of this coefficient indicates the direction of order of the component — a positive value means that the component will be in the same direction as in the order by a multi-leg instrument, while a negative value means the opposite direction.

Figure 1. Multileg instruments

Multileg instruments

Identification of instruments

The SPECTRA system has four fields to identify each instrument:

  1. 'isin_id' field, which contains the unique numeral code for each instrument.

  2. 'isin' field, which contains the instrument's symbol code.

  3. 'short_isin' field, which contains short symbol code for using in order books etc.

  4. 'name' field, which contains a long 'humanized' instrument's description.

Example 3. Futures on RTS index value, to exercise in December 2010.

isin_id=

isin = RTS-12.10

short_isin = RIZ0

name = Futures contract on the RTS index value, to exersice on 15, December 2010.


A value in the 'isin_id' field is the primary unique instrument's code, which is used throughout of data structure of the system wherever a corresponded reference exists.

The 'isin' field contains the main symbol futures' code, which is used in order's instructions. The exercise time is unique and guaranteed.

The 'short_isin' field is an alternative symbol contract code. It has been implemented in order to ease access to the SPECTRA system data for news agencies. Unlike 'isin', the 'short_isin' field can change.

Trading operations

Orders — general information

Order — a command, which is sent into the trading system by a trading participant, aimed to perform an action of buying or selling an instrument at specified price. There are two main types of orders available: private and system.

System orders — a common type of orders available for all users of the system. System orders have to participate in auction along with offsetting orders. If there is an offsetting order available for any system order at a better or equal price, the order itself has to be exercised at the price equal to that of the offsetting order. The unexercised part of the order remains in the system as an order with less amount of instruments.

Orders can be subdivided into three types: quoted, offsetting, and fill-or-kill orders. A quoted order remains in queue after it has been fully or partly exercised. An offsetting orders have to be removed from the system after auction ended, no matter whether it has been exercised fully or partly. At last, the fill-or-kill orders — the offsetting orders which can only be exercised fully.

All orders can be also subdivided into common and multy-day orders, in accordance with their lifetime. Common orders do not have the date of expiration specified; such orders remain in queue until the end of the current trading session. Contrary, the expiration date for multi-day orders is specified, ranged from 1 day up to one year. Such orders are relisted automatically at opening of the next session; additionally each order receives a new ID and a link to the initial order's ID. When relisting, the orders are checked for having sufficient instrument, client and funds. Orders which are out-of-date are automatically removed after the evening session ends.

There are two additional fields added to meet the developers' needs:

  • 'comment field' - a 20-symbol string;

  • 'ext_id field' - a 4-byte number to store order's ID in the client application.

Note

The SPECTRA system does not check values of the additional fields for being unique.

Orders data are stored in the 'orders_log' tables of the 'FORTS_FUTTRADE_REPL', 'FORTS_OPTTRADE_REPL' and 'FORTS_ORDLOG_REPL' streams. The tables contain orders changing log, where every change is recorded as a separate record in the table. The table 'orders_log' of the streams FORTS_FUTTRADE_REPL and FORTS_OPTTRADE_REPL contains information on the 'own' orders only. The 'own' orders are:

  • For a client login - records about all orders, placed on behalf of this client;

  • For brokerage firm or clearing firm login - records about all orders placed on behalf of clients of these firms.

Users can view all data on the 'own' orders, including data in service fields and user fields.

Clients are able to be subscribed for receiving the table 'orders_log' of the stream 'FORTS_ORDLOG_REPL; in this case, they will receive complete history of changes for all orders in the trading system in anonymous mode.

Users can do the following:

  • Add an order;

  • Delete a single order according to its code in the SPECTRA system;

  • Move an order (the 'MoveOrder' command). Moving of an order is implemented in two steps: deleting an 'old' order and adding a new one into the system (with a new code, which is sent to user after the order was added). Thus, at least two records (about deleting an order and adding a new one) will be added in the 'orders_log' table. You can move two orders at time by adding parameters ('order_id1', 'order_id2') to the 'MoveOrder' command, which can be useful for market-makers' needs. If you move only one order, then you should specify the 'order_id1' parameter only.

  • Delete orders by mask. The following masks can be applied:

    • Direction of operation: buying or selling;

    • Order type: private order or system order;

    • Client's code;

    • Underlying asset's code;

    • Order's ID in the client system ('ext_id');

    • Instrument's code.

Private orders

An order addressed to a certain client are called private order. Unlike system orders, the private orders have some limitations for users in managing orders and selecting counterparts, namely the following:

  • When listing a private order, it is impossible to specify any other counterpart except a brokerage firm. Also, it is impossible to make trades between two random tradin accounts.

  • For specifying a counterpart, the counterpart's RTS code is used in orders in 'broker_to' field. The brokerage firms which do not have the RTS code act as counterparts for private orders.

  • Instead of moving, the private orders can only be deleted and listed anew manually.

  • Private orders can only be exercised when price of one order exactly matches that of the counterpart order. Private orders can also be exercised partly.

Trades

In the SPECTRA trading system, trades are settles if an instrument price in one order meets the instrument price in an opposite order, i.e. selling or buying one for the same instrument. The price of order settled first is the price of the trade. There are two types of trades: private and system. Many trade's attributes are equivalent of that of the orders. Trades cannot be edited or deleted from the system.

Data on own trades are stored in the user_deal and user_multileg_deal tables of the 'FORTS_FUTTRADE_REPL' and 'FORTS_OPTTRADE_REPL' streams. The data on all trades in the system are distributed among all users via table deal of the stream 'FORTS_DEALS_REPL' in accordance with the following rules: a user gets access only to his/her own part of the trade (buyer's or seller's). If a user acts on behalf of a brokerage firm or a clearing firm, and both buyer and seller are the clients of the same firm, the user gets access to the data concerning both parts of the trade.

Along with records regarding common trades, some additional records are stored in the deal table. These records cannot be classified as trades legally, but still they show some operations in the system, which influence the participant's status. These are:

  • Delivery of assets is made upon the expiration of the instrument.

  • Expiration of options.

  • If a client does not provide the required collateral, the position is closed.

These trades are called 'technical trades'. You can tell trading trades from the technical ones by values in the fields status_sell and status_buy of the tables user_deal and user_multileg_deal of the streams 'FORTS_FUTTRADE_REPL' and 'FORTS_OPTTRADE_REPL', or by the flag nosystem in the table deal of the stream 'FORTS_DEALS_REPL' (for details see Trade types, created upon exercising and expiration of futures and options).

Specifics of trading multileg instruments

The SPECTRA system supports multileg trading instruments, i.e. the instruments consisting of more than one components. This allows to use a trading strategy, when a client gets additional positions on two or more instruments when trade is complete. The instruments available now are calendar spreads for futures.

The main specifics of trading multileg instruments:

  • Prices in OrderBook can be ranked in two directions: straight or reverse.

  • When listing the multileg order, a client is obliged to buy or sell two or more components. Therefore, calculation of collateral for such positions should be made in the appropriate way.

  • Multileg orders cannot be moved or deleted by mass cancel.

Delivery of assets and expiration of options

Deliveries on futures

There are three types of futures exist in terms of deliveries:

  • Non-deliverable futures upon expiration, difference between the contract price and the current price of the asset are delivered. The delivery is performed as technical closing of the position, and is marked with a special sign in the 'status_sell' and 'status_buy' fields (for details see Trade types, created upon exercising and expiration of futures and options).

  • Commodity futures: upon expiration, the assets and money are delivered. The delivery is performed as technical closing of the position, and is marked with a special sign in the 'status_sell' and 'status_buy' fields.

  • Stock futures: upon settlement, the position for futures turns into a position on the T+ market (Moscow Exchange Main Market). The settlement is processed as a technical position closing trade on derivatives market (the trade is marked with special flag in the 'status_sell' and 'status_buy' fields) and position opening trade on T+ market (added into the ASTS system of derivatives market). For more information see the section below.

Settlement of futures contracts of derivatives market for stock market (T+2 mode)

All deliverable futures contracts are settled via the automatic matching procedure for T+2 trades in the 'FB MMVB' Main market section (ASTS trading and clearing system).

In the SPECTRA clearing system, each Brokerage firm in order to make settlement is obtained with the firm code along with the trading-and-clearing account (TCA), both registered in the Trading and clearing system of the securities market. These two entities are used to perform the T+2 trades in order to fulfill obligations for the futures contracts. The client's account of the positions account register may have a separate TCA and client's code registered in the ASTS Securities Market.

The T+2 trades are matched on the ASTS Securities Market in a separate trading mode (SPEQ), with the settlement code Y2. The trades are matched between the National Clearing Centre and Securities Market Participants, with no additional confirmation by the Securities Market Participants.

If a T+2 trade cannot be matched due to absence of trade details (or wrong Firm and TCA details), then the Participant must provide a real TCA bound to the appropriate Brokerage Firm not later than 3 PM Moscow time. After 3 PM Moscow time, all positions for futures contracts which cannot be matched into trades are compulsorily closed by the Clearing Centre. Also, the whole amount of collateral is taken as a fee.

After the settlement for securities has been fulfilled on the securities marked (in case of sufficient collateral amount), the futures position in SPECTRA system closes, and the collateral for this position releases. If the collateral amount is insufficient for the T+2 market position, then the futures position and its collateral remain blocked in the SPECTRA system until the margin request is executed on the T+2 market.

After the futures for securities are settled, the technical trades for closing futures positions appear in the trades table, marked with the 'Futures settlement trade' value in the 'status_sell' and 'status_buy' fields. The technical trades for closing futures positions will also appear in the derivatives market reports 'f04.csv' and 'fut_deal.csv'.

For more information see http://moex.com/s1262.

Option exercise

At present, the SPECTRA system supports American futures options. When exercising, the option position turns into a futures position with the price equal to strike of the exercising option contract. The exercise is processed during clearing session, and, technically, consists of closing of the option position and opening a futures position. Both of the positions are marked with a special flag in the fields 'status_sell' and 'status_buy' (for details see Trade types, created upon exercising and expiration of futures and options.

There are two types of exercise available:

  • Prescheduled exercise, processed according to a participant's order. A buyer is allowed, at any time, put the corresponding order into the system (for details see Method OptChangeExpiration - Add order for expiration of options). The orders are accepted during the whole trading session, while exercised only twice a day: during the intraday clearing session and the evening clearing sessions.

  • Automatic exercise, on the option expiration date. On the expiration date, each in the money option exercises automatically.

For on the money option contracts (the call and put ones with their strike prices strictly equal to the appropriate futures settlement prices), automatic exercise is processed for the half of the open option position with the specified strike price. If the open position value is uneven, then rounding up (where 0.5=1) is applied for options call and rounding down is applied for options put (0.5=0) to calculate the settlement position value.

You can turn off the automatic exercise feature by adding a negative amount of option contracts into the 'Option contract exercise' request ('OptChangeExpiration', field 'amount'). The amount of option contracts specified will not exercise automatically.

There is an another scenario applied when calculating amount of collateral for non quarterly option 2 clearing sessions before exercise. Exercise scenarios are used along with volatility change scenarios for risk evaluation procedure. A portfolio equal to what generates on automatic exercise of on the money option contracts (or non-exercise of out of the money option contracts) is modelled for every exercise scenario, along with calculation of risk profile. A Brokerage Firm may turn on an exercise scenario calculation for their client in advance by using a non-trading order 'FutChangeClientMoney', field 'num_clr_2delivery (i4)', where the number of clearing sessions to turn on automatic exercise is specified. Value of the field 'num_clr_2delivery (i4)' is translated in the table 'part' of the stream .FORTS_PART_REPL'.

Trade types, created upon exercising and expiration of futures and options

Bitmask of signs of the user_deal table, the 'FORTS_FUTTRADE_REPL' and 'FORTS_OPTTRADE_REPL' streams (the 'status_buy' and 'status_sell' fields):

  • 0x4 – OTC-trade;

  • 0x8 – position transfer trade;

  • 0x20 – option exercise trade;

  • 0x80 – flag of instrument expiration (exercise for futures, expiration for options);

  • 0x20000 – repo trade;

  • 0x40000 – series of trade;

  • 0x800000 – option expiration trade;

  • 0x2000000 – clearing session trade;

  • 0x4000000 – negotiated trade;

  • 0x8000000 – multi-leg trade;

  • 0x10000000 – trade on non-delivery;

  • 0x40000000 - futures exercise trade.

The data in the Plaza-2 gateways and orders are synchronized for providing convenience work of the back-offices. The 'signs' field is used in the f04_XXYY.dbf, f04clXXYYZZZ.dbf, o04_XXYY.dbf, o04clXXYYZZZ.dbf reports. This field is based on the bitmask of Plaza-2.

Trade types, created upon execution and expiration of futures and options are listed in the table below:

Operation typePosition closing tradePosition opening tradeDate and time of trades availability in reports and in the gateway
Classical execution of futures
  • id in reports is 0, id in gateways is nonzero.

  • Trade price is rounded to minimal step price.

  • Technical trade is not a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x80 (expiration of the instrument), 0x40000000 (futures exercise trade).

No.On the execution day, in the morning.
Execution of non-deliverable futures
  • id in reports is 0, id in gateways is nonzero.

  • Trade price is rounded to the minimal price step.

  • Technical trade is not a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x80 (expiration of the instrument), 0x40000000 (futures exercise trade).

No.On the execution day, in the evening.
Exercising of option
  • id in gateways is nonzero. id in reports is 0 (trade at the evening clearing session), nonzero id (trade at the intermediate clearing session).

  • Trade price is 0.

  • Technical trade is not a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x20 (option exercise trade).

  • id in gateways is nonzero. id in reports is 0.

  • Trade price is rounded to 5 places.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x20 (option exercise trade).

  • At the intermediate clearing session

  • At the evening clearing session

Depending on time of applying the option (the next clearing session after applyinh).

Expiration of option
  • id in gateways is nonzero. id in reports is 0.

  • Trade price is 0.

  • Technical trade is not a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x80 (expiration of the instrument), 0x800000 (option expiration trade).

No.On the futures execution day, in the evening.

Trades are shown as following:

Operation typeOperations info
Stock futures trade based on a private order
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to the minimal price step.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x4000000 (negotiated trade).

Stock futures trade based on a system order
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to the minimal price step.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask):bits value is 0.

Stock futures option trade based on a private order
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to the minimal price step.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x4000000 (negotiated trade).

Stock futures option trade based on a system order
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to the minimal price step.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask):bits value is 0.

Position transfer trade
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is not a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x8 (position transfer trade), 0x4000000 (negotiated trade).

Technical trade based on repo private order (1st part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x20000 (repo trade), 0x4000000 (negotiated trade), 0x8000000 (multi-leg trade).

Technical trade based on repo private order (2nd part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x20000 (repo trade), 0x4000000 (negotiated trade), 0x8000000 (multi-leg trade).

Technical trade based on repo system order (1st part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is not a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x20000 (repo trade), 0x8000000 (multi-leg trade).

Technical trade based on repo system order (2nd part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is not a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x20000 (repo trade), 0x8000000 (multi-leg trade).

Technical trade based on the private pseudo-repo (1st part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 OTC-trade), 0x40000 (bulk of trades), 0x4000000 (negotiated trade), 0x8000000 (multi-leg trade).

Technical trade based on the private pseudo-repo (2nd part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x40000 (bulk of trades), 0x4000000 (negotiated trade), 0x8000000 (multi-leg trade).

Technical trade based on the system pseudo-repo (1st part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x40000 (bulk of trades), 0x8000000 (multi-leg trade).

Technical trade based on the system pseudo-repo (2nd part)
  • id in gateways and reports is unique and nonzero.

  • Trade price is rounded to 5 places.

  • This trade is a trade legally.

  • Signs in gateways and reports (bitmask): 0x4 (OTC-trade), 0x40000 (bulk of trades), 0x8000000 (multi-leg trade).

Trading and clearing schedule

Trading schedule. Trading sessions.

In the SPECTRA system, the trading session is subdivided into two parts (not related to the astronomical day!), which are:

  • Evening trading session — takes place from 7PM till 11.50 PM (Moscow time)

  • Main trading session — takes place from 10 AM till 6.45 PM (Moscow time).

During a trading session, the same trading instruments are traded and the same parameters are used to calculate the collateral to pledge. There are very important operations taking place in the SPECTRA system between the two sessions: clearing, contracts expirations, reports generating and forwarding and many others.

There is also a technical possibility available to set up one more trading session in the morning (not used for now).

Intermediate clearing session

There is a gap in the main trade session (2 PM - 2.03 PM, Moscow time), during which the intermediate clearing session takes place. It is used to fix new prices for instruments and transfer variable margins to participants.

The following values are changed during the intermediate clearing:

  • The settling prices of the instruments traded in the evening session and in the first half of the main session. The new and the previous prices are displayed in the special fields of the 'fut_sess_contents' and 'opt_sess_contents' tables of the 'FORTS_FUTINFO_REPL' and 'FORTS_OPTINFO_REPL' streams, respectively.

  • Clients' amounts of funds after the variating margins were calculated and transferred. The transferred variating margins values are displayed in the appropriate field of the part table of the 'FORTS_PART_REPL' stream.

The following values are not changed during the intermediate clearing:

  • Trading instruments limitation values.

  • The trading instruments list. Deleting of expired instruments and adding of new ones is taking place during the main clearing session.

Main clearing session

The main clearing session is taking place in the end of the trading session, from 6.45 PM till 7 PM (Moscow time). The following operations are performed:

  • Calculation and fixation of settling prices in accordance with the trading session results.

  • Calculation and transferring of variating margins between participants.

  • Deletion of expired instruments and adding new ones.

  • Renewing information on clients, brokerage and clearing firms by deleting obsolete data and loading newly calculated data.

After the main clearing session has finished, the corresponding reports are generated and sent out.

How different entities act on assigning a new trading session

Reference data and session data

When a new trading session is assigned, the data in the tables linked to the session number are loaded anew. For the tables that are not linked to the session number, new records are added in accordance with the new data available in the trading session; the records which do not correspond the actual trading session data will be deleted. The reference data are sent out within the tables of the 'FORTS_FUTINFO_REPL' and 'FORTS_OPTINFO_REPL' streams. As a result, the new record with a new session number is added into the 'session' table.

Funds and positions

When a trade session changes, the data on funds, limitations and clients positions are updated as following: only the records which have been modified are subject to change (including the 'FORTS_PART_REPL', 'FORTS_POS_REPL' and 'FORTS_INFO_REPL' streams and the 'diler_params' and 'client_params' tables).

Orders and trades

The main trading data (the 'FORTS_FUTTRADE_REPL' and 'FORTS_OPTTRADE_REPL' streams) i.e. the orders and trades which were made until 7:00 PM of the currrent trading session are available in the system till 12:00 PM on the current day.

Upon changing the trading session, the multi-day orders are relisted automatically except those which are expired. The relisting is made by deleting an old order and adding a new one with a new number, with no data added into the 'orders_log' table. Therefore, the client system should act as following: after finding a new trading session number in the 'session' table, the client system should 'forget' all the orders stored in memory by the moment and 'listen' to the replication stream for new orders with the new trading session number.

Instruments

When switching the trading sessions, the system deletes expired trading instruments and adds new ones, which cannot be traded during the evening trading session (7:00 PM till 11:50 PM); however, these new instruments appear in the system and are transmitted in the replication stream. They are also marked with a special sign in the 'fut_sess_contents' and 'opt_sess_contents' tables.

Replication streams

The replication streams can be closed and then reopen again by the trading system servers, yet some streams may transmit notification about changing the life number of a scheme.

For now, the following streams can be reopen without changing life numbers:

The following streams are not subjects to reopen:

Event-sensitive scheme for data synchronizing

If a developed system demands the possibility of synchronizing the consistent states of data, then the event-sensitive scheme should be used, which is available starting from the 3.8.2 version of SPECTRA. The following events are used to start synchronization:

  • All data for a new trading session are loaded and calculated (~18:49-18:50, Moscow time zone)

  • Intraday clearing session has started (14:00, Moscow time zone)

  • Funds have been recalculated after intraday clearing session (~14:01:30, Moscow time zone)

  • All clearing procedures has finished for intraday clearing session (~14:02, Moscow time zone)

  • Main clearing session has started (~18:45, Moscow time zone)

  • All data after the main clearing session are recalculated (~18:49, Moscow time zone)

  • Limits have been extended (during the trading session)

The new 'sys_events' table is added to the replication streams in order to inform outer systems about the events occurred:

FieldTypeDescription
replIDi8Replication subsystem service field
replRevi8Replication subsystem service field
replActi8Replication subsystem service field
event_idi8Unique event ID
sess_idi4Trading session ID
event_typei4Event type
messagec64Text description

The table is added into the following replication streams:

The rules of the synchronization are the following: when a global event occurs in the system, and when all the data regarding this event are generated by all the subsystems, the new record is added to the 'sys_event' table containing the same 'event_id' value, with the 'event_type' value corresponding to the following event occurred:

  • 1 (session_data_ready) - all data from the clearing system have been loaded into the trading system; this type of event is transmitted in all streams containing sys_events, except the 'FORTS_CLR_REPL' stream

  • 2 (intraday_clearing_finished) - all clearing procedures have been finished in the intraday clearing session; this type of event is transmitted in all streams containing sys_events, except the 'FORTS_CLR_REPL' stream

  • 3 (clearing_data_ready) - data are ready after the main clearing session; this type of event is transmitted only in the 'FORTS_CLR_REPL' stream

  • 4 (intraday_clearing_started) - intraday clearing session has started; this type of event is transmitted in all streams containing sys_events, except the 'FORTS_CLR_REPL' stream

  • 5 (clearing_started) - main clearing session has started; this type of event is transmitted in all streams containing sys_events, except the 'FORTS_CLR_REPL' stream

  • 6 (extension_of_limits_finished) - limits have been extended; this type of event is transmitted in all streams containing sys_events, except the 'FORTS_CLR_REPL' stream

  • 8 (broker_recalc_finished) - Funds have been recalculated after intraday clearing session; this type of event is transmitted in all streams containing sys_events, except the 'FORTS_CLR_REPL' stream

An outer system may subscribe to receive the event table via all the available replication streams; when the data are ready, a notification will be sent to the outer system. The 'sys_event' table records, relating to the same event, will have the same 'event_id' field value in every replication stream. There are additional data available in the 'sess_id' and 'message' fields: the number of the current or upcoming trading session and a text message, respectively. Please also note that:

  • The identity of service fields values (the 'replID' and 'replRev' fields) cannot be guaranteed for the same event in the different replication streams. You should view the 'event_id' value instead.

  • The notification for the 'sys_event' table arrives AFTER all other data. It means that working in on-line mode, the system receives the newest data available, for example, instruments or the multi-day orders rolled over from the previous session, before adding records into the 'sys_events' table.

Game and test mode trading schedule

Except for the real SPECTRA trading system, there are also game and test systems available.

X-points — a point on the arrow of time, upon reaching which the private trades are allowed only when both seller and buyer are clients of the same brokerage firm. This period of time is necessary for brokers to close all the positions, where deliveries are physically impossible.

Game system trading schedule:

  • Evening trading session: 7:15 PM — 10:00 PM.

  • Morning trading session: 06:00 AM — 09:00 AM.

  • Main trading session: 09:00 AM — 18:45 AM.

  • Intermediate clearing session: 2:00 PM — 2:03 PM.

  • X-points and delivery: 4:00 PM — 4:30 PM.

Test system trading schedule (for outsourcers):

  • Evening trading session: 3:30 PM — 11:50 PM.

  • Morning trading session: 07:00 AM — 07:15 AM.

  • Main trading session: 07:15 AM — 2:45 AM.

  • Intermediate clearing session: 12:00 AM — 12:05 AM.

  • X-points: 1:00 PM, 1:15 PM.

  • Delivery: 1:30 PM — 2:00 PM.

Risk management and limitation of trading operations

Collaterals

The Risk Management System implemented into SPECTRA allows to dramatically reduce risks of non-fullfilment of obligations by permanent evaluation of market risks for every participant's position. The core of the system is the initial margin calculation algorithm.

One of the key features of the SPECTRA system is the calculating collaterals on orders and positions per one trading transaction in online mode. Therefore, it is almost impossible for non-pledged orders and trades to appear in the system, because the collateral is always checked before any relating order appears in the system.

Another important feature of the SPECTRA Risk Management System is the three-level calculating scheme, in accordance to which the trade participants are subdivided into three groups:

  • Clearing firm, which incur liabilities for risks and cover risks of their clients and sub-brokers. Clearing firms are obliged to:

    • Belong to the Derivatives Market Section.

    • Obtain the exchange intermediary license issued by the Federal Financial Markets Service, which allows to perform commodity, futures and option trades.

    • Pay fee to the Insurance fund.

    • Provide collaterals for own trades, the clients and sub-brokers' trades.

  • Brokerage firm. Unlike clearing firms, brokerage firms do not settle up with exchange directly; instead, they use their clearing firms. Also, brokerage firms are not obliged to obtain licences and pay fees to the Insurance fund. Brokerage firms are obliged to provide collaterals for own trades and for the clients and sub-brokers' trades.

  • Client. Any physical or corporate person can participate in the SPECTRA market as a client on the authority of trading service agreement signed with a brokerage firm or with clearing firm directly. Any action taken by clients is taken on behalf of their brokerage or clearing firm.

According to the implemented solution, risks and amount of collateral are calculated separately for each group: clearing firms, brokerage firms and clients. This makes the solution unique and guarantees that clients will never exceed the limits they had been set for.

Trading limits

Trading limitations of clearing firms and brokerage firms are the firms' funds allocated on trading accounts of the RTS Clearing Center. The brokerage firm's funds is the sum all its clients' funds, while the clearing firm's funds is the sum of all its brokerage firms and include the funds of the clearing firm itself. A clearing firm is eligible to transfer funds between its brokerage firms and also between the brokerage firms and the clearing firm directly; the amount of clearing firm's funds remains unchanged.

Trading limits are used to reserve negative variating margins, withdraw fees and premiums, accrue premiums and reserve collaterals.

The trading limitations for clients are set up by brokerage firm or by clearing firm and are called the client trading limit. If there is any funds limitation set for a client, then, after the client order has been put into the system, the system checks if there are enough funds available on the client's account. In case there is no limitation has been set, the system checks funds availability on the accounts of brokerage firm and its clearing firm. Generally, an order will be listed only if there are enough funds available on all three accounts: the client's, brokerage firm's and clearing firm's.

There are only two types of funds available in the SPECTRA trading system: money and pledges. The pledges may consist of securities or of currencies, which the RTS Clearing Center accepts as collateral. Funds and non-monetary pledges are accepted in non-equal shares: the share of pledge cannot exceed 50% of the whole funds amount.

There is the 'FutChangeClientMoney (Setting up the client limits)' method available, which is used for setting up the client limits. It provides the following possibilities:

  • Set up/change/delete trading limits (separately for funds and for pledges)

  • Tightening/releasing demands for collaterals by adding a special multiplier to the total amount of collaterals.

  • Automatic accounting mode for the client trading result. This affects limits values for the next trading session.

The 'FutChangeBFMoney (Setting up the brokerage firms limits)' method is used for setting up the brokerage firms limits. The method allows only to set up or change trading limits.

Separated accounting of funds and positions for clearing participants and their clients

Separated accounting of money and positions has been implemented in order to have Brokerage firms (BFs) used for the following purposes:

  • accounting of a Participant's own funds and positions;

  • accounting of a Participant's clients' funds and positions;

  • accounting funds and positions which have been delegated to a Participant for the accounting management.

A separate accounting code of the National Clearing Centre is used to account funds (roubles and other currencies) of the same type. Also, each Participant is able to create some additional accounting codes (for example, it is possible to create its own accounting code for each Brokerage firm).

Limitations on trading operations and opening positions for clients

The SPECTRA system allows to set up the additional limits on client trading operations, i.e. prohibitions, when it is possible to prohibit opening positions and placing orders for a certain client (or for all clients), a certain instrument (or for all instruments) or a certain underlying asset (or for all underlying assets). The following methods are used: FutChangeClientProhibit method — Changing client limits for futures and OptChangeClientProhibit method — Changing client limits for options.

Risk transfer between derivatives market and FX market

The SPECTRA system provides two technical instruments (not trading instruments, juridically) which allow to manage risks. The instruments are 'EURRUB_RSK' and 'USDRUB_RSK', and they have the special status in their 'signs 0х20000' fields.

In the TCS of the FX Market, these instruments are added into the RSKC board.

In the SPECTRA Clearing system, each Brokerage Firm (BF) has its own Settlement code, registered in the TCS of the FX Market.

In order to change the single limit for FX market, a Participant (Brokerage Firm) should add negotiated order without confirmation containing a risk-managing instrument name (for example,'EURRUB_RSK'), with their own name as the counterpart's name. The order should not contain any price value (instead, the current settlement price for the risk-managing instrument is used).

After the order has added, the negotiated order with the National Clearing Centre as the counterparty appears in the system. Then, the order passes the standard risk management procedures. After the order has been verified for collateral sufficiency, it matches into trade, and the single limit recalculates. The trade is accounted at the current central rate, and no guarantee transfers accrue.

A risk transfer technical trade appears in the SPECTRA trading system. The trade is visible in the gateway interfaces in the table 'deals' with the flag 'nosystem=1', and is added into reports with ‘type=16’.

As a result of the trade, a permanent position appears. It can be closed by performing an opposite trade for the same instrument.

Position (obligation) transfer

The SPECTRA system provides possibility to transfer a positions from one Brokerage Firm client to another client of the same Brokerage Firm.

To transfer a position from one clearing register to another, a clearing participant should add a new transaction into the Trading system.

Verification procedures on position transfer are the same as that of adding an order. Additionally, it is verified that volume of the position to be transferred does not exceed that of the donor account. Also, the VAT/personal data (including separated brokerage firms accounts) must be equal for both accounts.

Technically, the position transfer is a trade with the special status for ('status_buy==status_sell==0x4/0x8/0x4000000') for the donor account and recipient account. Juridically, it is not a trade. Position transfer is visible both in the gateway and in the reports (f04/o04).

Pausing trading session for extending limits of trading prices fluctuations

Technically, the following actions take place in the SPECTRA system when pausing trading:

  • When the condition is set to pause trading for a certain underlying asset, then the trading pauses for this asset.

  • The trading administrators calculate the new extended limits of prices fluctuations.

  • The amount of collateral is recalculated for every position, which includes the underlying asset (if the limits extend, then the amount grows)

  • After the collateral is recalculated, the trading still pauses, allowing participants to delete orders.

  • The trading resumes in the standard mode.

The corresponding notifications are sent on every action listed above (see the 'sys_message' table of the 'FORTS_FUTINFO_REPL' stream):

  • Warning about the upcoming trading pausing for a certain instrument if the prices remain unchanged.

  • Notification about pausing the trading.

  • Notification about successful recalculation of collateral (orders can now be deleted).

  • Notification about resuming the trading.

Trading gate description

SPECTRA Plaza-2 gateway. Components, installation and setup.

Components and architecture

The SPECTRA Plaza-2 gate consists of the following software components:

  • The 'P2MQRouter' module. This module provides the following services:

    • Establishing TCP-connections to the Exchange servers.

      Normally, the SPECTRA Plaza-2 gate uses four TCP-connections to the Exchange servers: one outcoming default connection and three outcoming direct connections. This structure is used as the standard to establish connection directly to the Exchange server farm, but connection via a Brokerage Firm server server may require a different structure; in this case, clients should apply to the server's owners for more details about connection.

    • Receiving/sending P2-messages.

    • Encrypting data sent by participants and decrypting data received from the Exchange.

    • Authentication of participants in the Exchange network.

  • 'cgate' - the gateway library.

    The library is the official software interface, provided to trading participants along with their clients as well as to software developers. The interface provides availability to create and send messages into the trading system and receive trading data from the trading system (data replication). There are x32 and x64 versions available for Windows systems, as well as a version for Linux OS.

  • Plaza-2 system libraries.

  • Software development kit, including additional utilities, command files, documentation and test examples.

Figure 2. Gateway architecture

Gateway architecture

Hardware and software requirements

Hardware requirements

Hardware requirements may vary depending on usage of the Plaza-2 gate.

The minimum system requirements for individual login without disk saving option are as follows:

  • CPU: Core 2 duo 1 Ghz or better

  • Memory: 2 GB or more for x32 systems, 4 GB or more for x64 systems.

The minimum system requirements for brokerage firm login without disk saving option are as follows:

  • CPU: Intel Xeon E5 2 cores or better

  • Memory: 16 GB or more

  • Separate SAS controller. Minimum 2 hard drives in RAID1. Two partitions, 30 GB each.

The minimum system requirements for brokerage firm login with disk saving option are as follows:

  • CPU: Intel Xeon E5 2 cores or better

  • Memory: 16 GB or more

  • Separate SAS controller powered with the write-back cache policy. Minimum 4 hard disks in RAID10. Two partitions, 30 GB each.

Software requirements

The following operation systems are supported by the gateway software:

  • Microsoft Windows 2003/XP

  • Microsoft Windows 7

  • Microsoft Windows Server 2008 R2 and older

  • Linux RedHat 6.0 (CentOS 6.0) and older

  • Ubuntu 14.04 LTS / Debian and older

Any programming language which supports the COM technology can be used for developing software application, for example, C++, .NET languages, Delphi, etc.

Installation for Windows

Download the latest gateway software version from ftp://ftp.moex.com/pub/FORTS/Plaza2/CGate/. The installation file's name is 'setup_SpectraCGate_x86_vx.x.x .exe' ('setup_SpectraCGate_x64_vx.x.x .exe'), where х.х.х is the software version number, for example 1.3.10.

Run 'setup_SpectraCGate_x86_vx.x.x.exe' ('setup_SpectraCGate_x64_vx.x.x.exe'). The installation wizard will guide you through the installation process:

Figure 3. Installation start

Installation start

Click the 'Next' button to continue with installation:

Figure 4. Select components to install

Select components to install

Select the installation mode you want to use, full or custom. The full install mode will install all the gateway components including module P2MQRouter, library cgate, additional utilities and the software development kit. The custom install mode allows you to manually select software components to install.

Click the 'Next' button to continue with installation:

Figure 5. Custom install

Custom install

Select the software components you need to install and the destination folder. The destination folder should be selected in accordance with the administrative recommendations.

Click the 'Next' button to continue with installation:

Figure 6. Select an address to connect

Select an address to connect

For selecting the proper connections you should contact your brokerage firm and/or the Exchange technical support service.

Click the 'Next' button to continue with installation:

Figure 7. Enter username and password

Enter username and password

Enter a username and a password to get access to the SPECTRA trading system. After the installation complete, the username and the password will be added to the ini-file of the 'P2MQRoutel' module for automatic authentication in the Exchange network on next login. Please note that usernames and passwords differ for each connection type (real, testing and gaming).

Click the 'Next' button to continue with the installation:

Figure 8. Registering router as OS service

Registering router as OS service

If you need to install the Router as Windows service, check the appropriate checkbox and click the 'Next' button to continue with the installation.

If you do not register the P2MQRouter as an OS service, you can do it later manually using the command file 'install_router.cmd (uninstall_router.cmd)'. The file is a part of distribution kit.

Figure 9. Starting installation

Starting installation

Click 'Install' to begin installation.

Figure 10. Finishing installation

Finishing installation

Click 'Finish' to finish the installation.

Installation for Linux

The distribution kit for Linux OS consists of installation script ('install.sh') and archive file 'tar.gz' (for example, 'cgate-1.3.9.8.x86_64.tar.gz'); the archive file contains loadable modules 'cgate' and 'cgate_java', files 'include', documentation files and test examples. The distribution kit can be download at ftp://ftp.moex.com/pub/FORTS/Plaza2/CGate/.

Installation order:

  1. Execute the command:

    chmod 755 ./install.sh
  2. Execute the command:

    ./install.sh ./cgate-1.3.9.8.x86_64.tar.gz

    Note

    If you executed command './install.sh ./cgate-1.3.9.8.x86_64.tar.gz' and got message 'Access denied' in reply, execute 'chmod 755 ./install.sh' to add the necessary permissions for the file's attributes.

  3. When you receive 'Please, enter cgate install path', specify the full path to the folder to decompress the cgate software.

  4. When you receive 'Please, enter P2 login', specify the user's login.

  5. When you receive 'Please, enter P2 password', specify the user's password.

  6. The next installation steps may vary depending on the Linux OS software version installed:

    • Debian 6:

      • Install 'ant'

      • Install 'openjdk-6-jdk' (java examples compilation)

      • Install g++ (C++ examples compilation).

    • CentOS 6:

      • Install 'gcc'

      • Install 'gcc-c++' (C++ examples compilation)

      • Install 'ant' (java examples compilation).

Developer guidelines

Usage of test examples

In order to verify the installation accuracy you can compile and run the test examples included into the distribution kit.

The examples can be found either in folder Moscow Exchange\SpectraCGate\SDK\samples for Windows OS, or /usr/share/doc/cgate-examples for Linux OS. To compile examples, you should run the special scripts, which may vary depending on the operation system and programming language used. For Linux OS, it is recommended to copy the examples into your login directory to compile them.

Description of examples:

  1. Example 'aggrspy'

    'aggrspy' is an example which is used to build aggregated orderbook for to buy and sell a fixed instrument for the stream 'FORTS_FUTAGGR50_REPL'. Press 'Enter' to display the orderbook snapshot.

    Execute:

    aggrspy ISIN_ID depth outfile [r]

    Input arguments:

    • 'isin_id' - instrument's ID;

    • 'depth' - depth of orderbook (up to 50);

    • 'outfile' - orderbook file for printing;

    • 'r' - reverse the sorting order (for instrument with reversed sorting order).

  2. Example 'repl'

    'repl' is an example which is used for receiving replication data and printing all incoming messages into a log-file. When disconnected, the replica transfer process starts anew from the beginning. No input parameters required.

  3. Example 'repl_resume'

    'repl_resume' is an example very similar to 'repl'. When disconnected, it allows to resume replica transfer process starting from the last message 'TN_COMMIT'. No input parameters required.

  4. Example 'send'

    'send' is used to add order into the SPECTRA and write incoming replies into the trading system log. No input parameters required.

  5. Example 'orderbook'

    'orderbook' is an example which is used to build aggregated orderbook for to buy and sell a fixed instrument for the online stream 'FORTS_ORDLOG_REPL' along with the snapshot stream 'FORTS_FUTORDERBOOK_REPL'. It is recommended to use it for developing 'late join', and also for minimizing inactivity time when archival data is being downloaded. Press 'Enter' to display the orderbook snapshot.

    Execute:

    orderbook ISIN_ID depth outfile [r]

    Input arguments:

    • 'isin_id' - instrument's ID;

    • 'depth' - depth of orderbook (up to 50);

    • 'outfile' - orderbook file for printing;

    • 'r' - reverse the sorting order (for instrument with reversed sorting order).

  6. Example 'p2sys'

    'p2sys' is an example, which is used for authorising the Router from cgate side. The following actions are executed cyclically:

    • Send erroneous login/pwd pair, get the 'logon failed' in reply;

    • Send the correct login/pwd pair;

    • Receive an 'authorisation successful' message, send 'logout' request;

    • Go back to the beginning.

  7. Example 'send_mt'

    'send_mt' is an example of multi-thread order adding. (Please note, that only C++11compilers are supported!). Thread 1 is used for adding orders, while thread 2 is used for processing 'reply' messages received.

Before executing the examples, please make sure that 'P2MQRouter' has started and connected to the Plaza-2 network (with touter massages analyzed), the INI files are accessible for the example file, as well as the Plaza-2 libraries (it may be necessary to add 'Moscow Exchange\SpectraCGate\bin' folder into the PATH environment variable or specify Moscow Exchange\SpectraCGate\bin for your development environment).

Note

The examples above are not intended to be used with data other than test data! It is strictly prohibited to use these examples for working with the real logins!

Distributed configurations

The 'cgate' application and the 'P2MQRouter' module can be distributed to different computers. To distribute the modules in the brokerage firm network, you should do the following: a) install the 'Router 'module to the computer connected to the Exchange network; b) install 'cgate' to the client computer with the client application installed; c) specify the following settings:

  • On the client side:

    • Specify the 'Host 'and 'Port' settings in accordance with that of your corporate network router.

    • Specify the Password settings (the local AppName application password for the router, which must be applied every time the application connects router from outside of the same computer). Please note that the local connection password is not the same as the Plaza-2 authentication password!

  • On the router side:

    • Add the '<AppName>=<local password>' string into the 'router.ini' file, [AS:Local] section, where 'AppName' (the application name) and 'Password' (the local password) should match the parameters transmitted by the client application.

Recommendations for third-party companies on including the Moscow Exchange runtimes into user application when distributing the user software

Users should copy the file set from the installation folder (Moscow Exchange\SpectraCGate\bin), as well as data and messages schemes (Moscow Exchange\SpectraCGate\SDK\scheme) into the folder containing user application. All these software parts should be distributed together.

It is not allowed to use different versions of 'P2MQRouter' and 'cgate' due to incompatibility. Before installing user application, please make sure that the 'P2MQRouter' version matches the one used in developing.

Market data structure

This section describes the structure of information sent by Plaza-2 gateway.

All transmitted data is divided into the following logical groups:

  • Reference information

  • Trade information

  • Recovery information

  • Funds and limits information

  • Clearing information

  • Rates and indices information

  • Auxiliary data streams

Reference information

The reference information includes the following data:

  • Trading session status and schedule

    Trading session time information and all its components: intermediate clearing, evening clearing, evening session time are available in 'session' table of the FORTS_FUTINFO_REPL stream. You can find trading session status in the same table, that helps to track current session status.

  • Instruments and underlying assets dictionary, properties

    Futures Instruments assigned to the trading session are available in the 'fut_sess_contents' table of the 'FORTS_FUTINFO_REPL' stream. Compound istruments (REPO, for example) are also listed in the table. Options instruments are sent in the 'opt_sess_content' table of the 'FORTS_OPTINFO_REPL' stream. Dictionary of the futures' underlying assets is represented by the 'fut_vcb' table of the 'FORTS_FUTINFO_REPL' stream.

    These directories can be updated during the trading session, for example, as a result of the suspension of trading on any instrument or during the price limit enlargement procedure

  • Companies and clients references

    Are sent in the 'diler' and 'investr' tables from the 'FORTS_FUTINFO_REPL' stream. Personal clients' information is available in these references.

  • Bond references

    Bonds are desribed by a set of tables from the 'FORTS_FUTINFO_REPL' stream: bond's settings references 'fut_bond_registry', bond's instruments references 'fut_bond_isin', ACI (Accrued Coupon Income) for coupon payment dates 'fut_bond_nkd', nominal payout value for a bond 'fut_bond_nominal'.

  • Parametric volatility curve parameters

    Are sent in the 'volat_coeff' table of the 'FORTS_MISCINFO_REPL' stream.

To carry out operations on all of the SPECTRA trading system markets user's system should receive at least the following reference information on-line:

  • Sessions' schedule (session)

  • Instruments dictionary (fut_sess_contents, opt_sess_contents)

Trade information

Trade information includes:

  • Aggregate orderbooks

    Are generated on the basis of user system requests by adding up the volume for each instrument, the price level and the direction of an order. Updated online and comes to be the main way to get information by current prices and volumes. User can select the desired depth of an orderbook from 5, 20 or 50 of quotations in each direction; this choice is made when configuring a login and can not be changed during the trading session.

    Orderbooks are sent by multiple Plaza-2 replication streams:

  • Market activity

    The best bid/ask price,opening price, closing price, current settlement prices, etc are sent as a part of market activity information. This information is sent in the streams 'FORTS_FUTCOMMON_REPL' and 'FORTS_OPTCOMMON_REPL' for futures and options, respectivily.

  • User's orders log (and full orders log in the trade system)

    The entire history of user's operarions with orders is sent in user's orders log. User's orders logs are available in 'orders_log' table of the 'FORTS_FUTTRADE_REPL' stream for futures; the 'orders_log' table of the 'FORTS_OPTTRADE_REPL' stream for options; the 'multileg_orders_log' table of the 'FORTS_FUTTRADE_REPL' stream for REPO instruments and multileg instruments.

    In case the user configures his login with option to receive "full orders log", he will receive the complete log of all operations with orders on market (including own operations with orders) in anonymous mode. The log will be available in the table 'orders_log' of the stream FORTS_ORDLOG_REPL.

  • User's deals log

    It contains a list of user's committed deals in the current session. User's deals log are available in the 'user_deal' table of the 'FORTS_FUTTRADE_REPL' stream for futures and the 'user_deal' table of the 'FORTS_OPTTRADE_REPL' stream for options; the table 'user_multileg_deal' of the 'FORTS_FUTTRADE_REPL' stream contains logs for REPO instruments deals and multileg instruments.

  • All trade system deals log

    It contains a list of all committed deals from all users in the current session. Information of somebody else's deals is presented in anonymous mode. User's deals logs are available in the 'deal' table of the 'FORTS_DEALS_REPL' stream for futures and options; the table 'multileg_deal' contains logs for REPO instruments deals and multileg instruments.

Recovery information

To ensure fast recovery of trade information receiving after losing connection with SPECTRA, and same with late start scenario connecting to exchange, Plaza-2 gateway receives periodic snapshots from recent orderbooks in a non-aggregated form. This helps to receive the recent status of personal orders (in case when the 'full orders log' option is set - all orders in the trade system) at the current time.

Snapshots of active orders are sent with 1 minute interval in 'FORTS_FUTORDERBOOK_REPL' for futures and 'FORTS_OPTORDERBOOK_REPL' for options. Repo orders are currently not present due to the fact that the volume of transmitted data by such an instruments is small and allows the recovery with the use of the trade information stream.

Funds and limits information

Includes the following:

Position information

  • Positions information

    Is sent in form of time snaps in the 'FORTS_POS_REPL' stream and last deal ID, included in position calculation by each position value, is available.

  • User's funds and limits information

    Is sent in form of time snaps in the 'FORTS_PART_REPL' stream. Money amount (both money and pledge), money amount at the beginning of the trade session, also current and reserved funds - all of them are available for each value of the client's account.

Clearing information

Clearing information, sent by Plaza-2 gateway, includes the following data:

  • Clearing settlement prices

    Are formed by the time of evening clearing and available in the 'fut_sess_settl' table of the 'FORTS_FUTINFO_REPL' stream. The table with settlement prices also includes the instruments whose validity period has ended allowing this table to be used to receive right prices when delivery comes.

  • Intermediate clearing's variation margin

    Intermediate clearing's variation margin is available in the 'fut_intercl_info' table of the 'FORTS_FUTINFO_REPL' stream for futures and 'opt_intercl_info' of the 'FORTS_OPTINFO_REPL' stream for options.

  • Delivery report

    Provides information about delivered and not delivered assets in the context of client - instrument. Report is available in the 'delivery_report' table of the 'ORTS_FUTINFO_REPL' stream.

  • Registries, containing orders rejected during the clearing session.

    Contain the orders, which were not replaced during the clearing session due to lack of funds. The futures registry is transmitted in the 'fut_rejected' table of the 'FORTS_FUTINFO_REPL' stream.

  • Rejected during clearing orders' registries

    Include information on the amount of funds in the accounts, account activity, fees, total initial and variation margin by the time of clearing. Are sent in the 'FORTS_CLR_REPL' stream.

  • Option execution orders

Indices and rates information

The following information is sent as a part of this group:

  • Current values of RTS indices

    Includes current values of RTS index, as well as all Exchange indices values. The values ​​in this table are updated with 15 seconds intervals. The composition of the index information includes of USD rate value, which is used in index calculation. The data is sent in the 'RTS_INDEX_REPL' stream.

  • Currencies rates values

    Contain rates ​​of currencies used in the trading system for processing contracts, calculated in a currency other than rubles. The currencies values are available in the 'curr_online' table of the 'MOEX_RATES_REPL' stream.

Auxiliary information streams

That group includes the streams providing the following additional functions:

  • Current values of variation margin

    are sent in the 'FORTS_VM_REPL' in the context of client's positions.

  • Current volatility values and theoretical prices for options

    Are sent in the 'FORTS_VOLAT_REPL' stream.

Gate usage specifics

Service replication fields

Each replicated table contains three fields of the fixed type i8 in the top, which are used for replication purpose:

  • replID — the unique record ID. When a new record appears in the table, the record is assigned with a unique ID. Even though a table may already have a primary ID-key, the one and only ID for replication purpose is the ID contained in the field 'replID'.

  • replRev — when there is a change made in the table such as record insert, record edit or record deletion, this record will be assigned with a new value in the field 'replRev' (maximum previous 'replRev' value + 1).

  • replAct — flag of a deleted record. If 'replAct' contains a value other than 0, then the record has been deleted. If 'replAct' contains 0, then the record is active.

Commands

To send a command, you should create a publisher with parameters 'NAME = FORTS_SRV', 'catеgory = FORTS_MSG'. If you need to receive replies to the messages sent, you should specify the flag 'CG_PUB_NEEDREPLY ' within the message sending function and create a type 'p2mqreply' listener.

In case of the message delivery and handling errors, the client receives either sending message function error or the 'system error' message in return.

FieldTypeDescription
codei4Return code
messagec255Message body

Please note that the 'system error' message can be received in reply to any business-logic command.

Flood control

The control system of clients' application flood control is functioning in the SPECTRA trade system. It restricts client's application to send more transactions per time unit (for single login on SPECTRA) than it is stated in the connection agreement. At present moment you can acquire login on SPECTRA with 30, 60, 90, etc. trading transactions per second. Trade operations are all transactions associated with order managing. Amount of non-trade (all the rest) operations for any type of login is limited in 500 transactions per second.

If you exceed the limit of messages, the control system does not transmit a message into the trade system core, and sends the user a reply message with the notification of denial of service. It is P2_Type = 99 and has the following structure:

FieldTypeDescription
queue_sizei4Number of messages for a single user
penalty_remaini4Time in milliseconds after which the next message from this user will be successfully received.
messagec128Error text message

Please pay attention to the two details:

  1. The number of messages for the elapsed second is estimated while receiving every single message. Thus, if a user constantly sends requests with the frequency greater than it is allowed, then his messages will not be processed at all.

  2. A reject message with 99 type can be sent in a reply to any user's message.

Latency monitoring by the client side

There is a possibility in P2ClientGate to automatically monitor data distribution latencies by marking a period of time between sending a message and receiving a reply message or a replication record; the time difference between two marks allows to calculate the latency. The data collected are available for further analysis by the SPECTRA centralized monitoring system. Please note that you should install the Plaza2 software and use the new messages scheme versions compatible with SPECTRA 3.8.2 and later; otherwise, there will be no possibility of usage the latency monitoring feature. The string below (can be found in the message description) points to the new message schemes:

LocalTimeField=<field
  name>

Please also note that using the new message schemes with old Plaza2 binary modules will cause problems, and is strictly not recommended!

Cancel On Disconnect

The Trading System SPECTRA provides a client connection control feature ('Cancel On Disconnect' or 'COD'). This option allows to automatically cancel some client's orders (anonymous orders without specified expiration time) on disconnect.

To enable/disable the 'COD' option, a trading participant should apply the appropriate request to the Client Center. The 'COD' option will be enabled for the ID (p2login) belonging to the trading participant.

When an ID connects to the trading system having the 'Cancel On Disconnect' option enabled, the trading system starts to monitor its connection activity in the 'COD' mode.

The connection activity monitoring algorithm is as following:

  • If the 'COD' mode is enabled for the client, the system monitors the client's activity on transaction layer. Each and every client's command or message registered by the Trading System is considered as activity, no matter whether it was complete or not.

  • If the client does not send a single message, or does not reconnect to the Trading System after loosing connection within the time period specified (now is 20 seconds), all they active orders are automatically cancelled.

The order cancellation conditions are as following:

  • A client has not sent any transaction within the specified time limit.

  • Client application has lost connection to the Router. Orders will be cancelled after reaching the specified time limit.

  • Router has lost connection to the Access Server. Active orders will be cancelled after reaching the specified time limit.

  • Access Server has lost connection to the Trading System or become unable to operate properly due to an error. All active orders of all clients connected to this Access Server will be cancelled after reaching the specified time limit.

  • There may occur an issue when FIX server or an API clients access server connected to the Trading System via gateway becomes unable to operate properly: it loses connections to a client but does not inform the Trading System about it. The Trading System cannot handle such issues; if occurs, the issue should be resolved on the client side.

All orders added by clients with COD-mode enabled are cancelled when the evening trading session ends and when the Trading System has been restored after a failure.

The orders cancelled via the 'Cancel On Disconnect' option are marked with a special status (field 'xstatus') in the table.

If clients need to simulate their transaction activity, they should sent command ‘CODHeartbeat (P2_Type=10000) into the Trading System at least once per at least once per 10 seconds. The command structure is as following:

FieldTypeDetails
seq_numberi4Heartbeat-message number (not used in the current version).

The command is not included into transaction fee.

The connection control service does not send replies to the Heartbeat messages, so that clients should set 0 (no reply expected) when calling the message sending function: (cg_pub_post(pub, msgptr, 0). Any attempt to call the function 'cg_pub_post' with 'CG_PUB_NEEDREPLY' on sending a Heartbeat message will result the error 'CG_MSG_P2MQ_TIMEOUT'.

Handling abnormal situations

Recovery on loss of connection with Exchange servers

In the standard configuration of Plaza 2 gate, there are four TCP-connections to the Exchange servers:

  • Connection for sending requests and commands

  • Connection for receiving the main market data such as aggregated order-books streams and the streams 'FORTS_ORDLOG_REPL', 'FORTS_DEALS_REPL', 'FORTS_FUTTRADE_REPL', 'FORTS_OPTTRADE_REPL', 'FORTS_FUTCOMMON_REPL' and 'FORTS_OPTCOMMON_REPL'.

  • Connection for receiving auxiliary and reference streams

  • Connection for receiving snapshots (at the first connection or when recovering after loss of connection)

Figure 11. Connection scheme

Connection scheme

In order to obtain stability, the trading system uses load balancing method to connect clients to the least loaded server at the moment.

Connection loss detection

P2MQRouter software handles all TCP-connections, with settings specified in the INI file where connection 'Other Data' is specified as the default outcoming connection and the other connections are specified as outcoming direct connections. This structure is used as the standard to establish connection directly to the Exchange server farm, but connection via a Brokerage Firm server server may require a different structure; in this case, clients should apply to the server's owners for more details about connection.

The P2MQRouter software also handles connection recovery in case of loss of connection. After disconnecting, P2MQRouter starts attempting to reestablish the connection periodically in accordance with the specified time value, while the client software is not able to interfere with the process. P2MQRouter status then changes from 'ROUTER_CONNECTED' to 'ROUTER_RECONNECTING' by receiving the appropriate notifications from object 'connection', and this is a way for client to check whether connection is still active or not.

Clients with different APIs

The way an application acts is depending on the application program interface it uses.

P2ClientGate

If the loss of connection occurs, P2ClientGate neither returns any notifications, nor changes 'DataStream' objects of API. The 'DataStream' objects act as following: every instance of the object waits for incoming data or service messages from the server within the replication timeout which is equal for every stream and is 5 minutes. Therefore, if connection to the server is lost and the application cannot handle the router status change to 'ROUTER_RECONNECTING', then within the next 5 minutes one or more 'DataStream' objects may change their state to error.

The messages 'P2MQ_TIMEOUT' in reply on request messages indicate that connection to the incoming request processing gateway is lost. This is the only way to detect the loss of connection in this case.

In order to quickly detect the loss of connection, it is recommended to the application to close down all its replication streams ('DataStream' objects) and try to create them anew upon receiving the 'ROUTER_RECONNECTING' router status change notification. If any of the streams cannot be created anew being worked via faulty network connection, it is recommended to try to open this stream cyclically, with a several seconds time interval between attempts. Another recommended way is to wait until the failure stream will close down after 5 minutes timeout, and then to try to reopen it anew.

In order to work with the incoming request processing gateway in the proper way, it is recommended to call 'Connection.ResolveService' for service 'FORTS_SRV' upon receiving the 'ROUTER_RECONNECTING' router status change notification. If there were no errors during executing the call, then the address returned in 'ResolveService' should be used for sending orders. Any error occurred means that the incoming request processing gateway is unreachable. In this case, it is recommended to call 'ResolveService' cyclically, until the call will execute properly.

CGate, versions up to 1.3.9 inclusive

When you use any version of CGate up to 1.3.9 inclusive, you should act in the different way. When the loss of connection occurs, every object (publisher and listener) linked to a local connection with the router will change their states to 'ERROR' automatically. After that, you should release all objects in the 'ERROR' state and then try to reopen them anew periodically, for example, once in a few seconds.

CGate, version 1.3.10

CGate version 1.3.10 is implemented with significantly reworked connection loss handling algorithm.

When the loss of connection to the incoming request processing gateway occurs, it is detected directly on the moment of receiving the TCP-connection error. All the 'publisher' objects concerned go to the error state.

When the loss of connection for receiving the main market data occurs, it is detected within 15 seconds for 'collocation' (streams '_FASTREPL') and within 30 seconds for the main server farm (streams '_REPL'). All the 'listener' objects concerned go to the error state.

All object in error state should be released. After that, it is necessary to try to reopen them anew periodically, for example, once in a few seconds.

Recovery algorithm

In general, the connection recovery algorithm is as follows:

  • After start-up, try to open connection to P2MQRouter periodically;

  • When the router is reconnected to the Plaza 2 network, the object 'connection' will go to the ACTIVE state;

  • Open the necessary streams. To make it faster, it is recommended to receive data starting from the last update. When opening a stream, you should use the 'repl state' value received on closing the stream; also, you can directly specify revision numbers for tables and scheme life number by using that of the last received data.

  • Recover the list of active orders (see below)

  • Register 'publisher' for orders and commands.

The table below contains the recommended methods for recovering data depending on the stream:

Stream (table) nameInformation typeRecovery method
FORTS_FUTTRADE_REPL
  • orders_log

FORTS_OPTTRADE_REPL

  • orders_log

Own orders activity log (futures and options)List of active orders:
  • use stream 'FORTS_FUTORDERBOOK_REPL' ('FORTS_OPTORDERBOOK_REPL') to receive snapshot, then open stream 'FORTS_FUTTRADE_REPL' ('FORTS_OPTTRADE_REPL') using the revision number specified in snapshot

Orders activity log:

  • open 'FORTS_FUTTRADE_REPL' ('FORTS_OPTTRADE_REPL') starting from the last received revision number

FORTS_FUTTRADE_REPL
  • multileg_orders_log

Own orders activity log (multileg orders)Orders activity log:
  • open 'FORTS_FUTTRADE_REPL' starting from the last received revision number

FORTS_ORDLOG_REPL
  • orders_log

Complete anonymous orders activity log (futures and options)List of active orders:
  • use stream 'FORTS_ORDRBOOK_REPL' to receive snapshot, then open stream 'FORTS_ORDLOG_REPL' using the revision number specified in the snapshot

Orders activity log:

  • open 'FORTS_ORDLOG_REPL' starting from the last received revision number

FORTS_ ORDLOG _REPL
  • multileg_orders_log

Complete anonymous orders activity log (multileg orders)Orders activity log:
  • open 'FORTS_ORDLOG_REPL' starting from the last received revision number

FORTS_DEALS_REPL
  • deal

  • multileg_deal

FORTS_FUTTRADE_REPL

  • user_deal

  • multileg_deal

FORTS_OPTTRADE_REPL

  • user_deal

Orders log (futures, options, multileg instruments)Reopen the appropriate stream using the last received revision number or 'repl state' value received on closing the stream.
FORTS_FUTCOMMON_REPL

FORTS_OPTCOMMON_REPL

General market information (futures and options)Reopen the appropriate stream anew
FORTS_FUTAGGR##_REPL

FORTS_OPTAGGR##_REPL

Order books for futures and options. (### - depth of order book)Reopen the appropriate stream anew
FORTS_FUTINFO_REPL

FORTS_OPTINFO_REPL

Reference and session informationQuick method:
  • Reopen the appropriate stream using the last received revision number or 'repl state' value received on closing the stream.

Allowable method:

  • Reopen the appropriate stream anew

FORTS_PART_REPLInformation on limitsReopen the stream anew
FORTS_POS_REPLInformation on positionsReopen the stream anew
FORTS_VM_REPLInformation on variation marginReopen the stream anew
FORTS_VOLAT_REPLInformation on volatility and theoretical prices on optionsReopen the stream anew
RTS_INDEX_REPLExchange indices valuesReopen the stream anew
RTS_INDEXLOG_REPLExchange indices values historyReopen the stream using the last received revision number or 'repl state' value received on closing the stream.

Note

Data recovery algorithm for streams 'collocation' with suffix '_FASTREPL' is the same as for the common streams with the same names.

Upon recovery, it is very important to receive the lists of the client's current orders:

  1. List of orders which are active during the recovery procedure period

  2. Orders activity log during the connection loss period.

For the first case, you should receive the order-book snapshot ('FORTS_FUTORDERBOOK_REPL/FORTS_OPTORDERBOOK_REPL'). The orders missed in the snapshot have been either already matched or cancelled during the connection loss period.

For the second case, you should receive your own orders activity log (the table 'orders_log' of the streams 'FORTS_FUTTRADE_REPL' and 'FORTS_OPTTRADE_REPL', also, the table 'multileg_orders_log' of the stream 'FORTS_FUTTRADE_REPL') covering the connection loss period. To do this, you should open the appropriate stream using revision number of the last record actually received before the loss of connection occurred. Every order activity happened during the connection loss period will be recorded in these tables. Changing the stream state to 'ONLINE' indicates that all orders activity data have been successfully received.

Note

The recovering procedure described above can be also used for the late start connection.

General recommendations

In general case, to minimize possibility of loss of connection, the Exchange recommends to do the following:

  • establish alternative connections

  • obtain two client's IDs for the gateway, with the same user rights in order to have possibility to receive the same data by running two client applications simultaneously. Therefore, in case of any failure, you will be able to switch between two applications.

Alternatively, it is recommended to enable a feature in your application allowing to switch to another connection (a P2MQRouter connected to the Exchange servers using an alternative connection) in case of any failure.

Figure 12. Channel duplication scheme

Channel duplication scheme

Recovery in case of the Exchange infrastructure failure

By the Exchange infrastructure failure we mean failures on the Exchange side caused by the Trading System kernel errors, or by errors in market data generating services. Then, as a rule, the services halt and restart.

Data cleanup by streams

In case of any routine maintenance, normal or abnormal service restarts on the Exchange side, or after reestablishing connection to a client, the publishing services send out notifications about obsolete data cleanup before sending the current snapshot to clients.

There are two types of data cleanup notifications:

  • CG_MSG_P2REPL_CLEARDELETED - by every table, with use of revision number. The notification gives client the order to cleanup all records with the 'replRev' value smaller than the one in notification. In order to optimise data transfer, the notification may have a revision number value as 'MAX(int64) – 1'. This means that client should cleanup all data from the specified table, as the entire table will be transferred anew.

  • CG_MSG_P2REPL_LIFENUM - for the entire replication stream, using the new stream life number. This notification means, that data have been significantly changed since the last connection. Client should cleanup all data in all tables. All data will be transferred anew.

Possible data change in case of abnormal work of publishing services

In normal work mode, including routine works at non-trading time, when opening or reopening any replication stream except those related to history of orders and trades ('FORTS_FUTTRADE_REPL', 'FORTS_OPTTRADE_REPL', 'FORTS_ORDLOG_REPL' and 'FORTS_DEALS_REPL'), a client may receive both 'CG_MSG_P2REPL_CLEARDELETED' or 'CG_MSG_P2REPL_LIFENUM' notification types, and should process them correctly.

In normal work mode, for the streams related to history of orders and trades (see above), the notification CG_MSG_P2REPL_LIFENUM' is sent only in case of system version change, after the testing-mode trades, in order to make clients cleanup the user data. The notification 'CG_MSG_P2REPL_CLEARDELETED' has the 'replRev' value for the first available order or trade at the moment.

A 'CG_MSG_P2REPL_LIFENUM' with a new stream life number during a trading session indicates a severe failure in the Trading System, so the system is to resend data on orders and trades which could be already delivered to clients.

Additionally, there are some other information channels (the Exchange web site, etc.), where information about possible data issues (whether the data already delivered to clients were affected by the last data correction or not) will be posted. This includes information about possible system rollback to the state it was before the failure, along with the last number of order and trade available to client after the system restart.

Replication scheme FORTS_PUBLIC

Stream FORTS_FUTTRADE_REPL - Futures: orders and trades

This stream contains tables from the log of changes to your orders and trades.

Note

Please, note that the table orders_log contains only orders submitted by your brokerage company or direct orders addressed to your brokerage company. Orders from other companies can be received only in aggregated form as a stream of aggregated orders (please, see section 4.5). Trades are sent together (including your trades and trades by other companies), with all data except for your data filtered out.

Table user_deal contains only own deals. This table may be useful for late join.

Data scheme

Tables:

Table orders_log: Log of operations with orders

Table 1. Fields of table orders_log

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
isin_idi4Instrument unique ID
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
id_deali8Deal ID for this operation
xstatusi8Extended order's status
statusi4Order's status
priced16.5Price
momenttOrder update time
diri1Direction
actioni1Operation with the order
deal_priced16.5Price of the deal
client_codec7Client code
login_fromc20Login of the user who has entered the order
commentc20Trader's comment
hedgei1Attribute of a hedging order
trusti1Attribute of an order from an asset management company
ext_idi4External ID number. It is added to orders, trades
broker_toc7FORTS code of the company to whom the direct order is addressed
broker_to_rtsc7RTS code of the company to whom the direct order is addressed
broker_from_rtsc7RTS code of the company who has entered the order
date_exptOrder's expiration date
id_ord1i8ID number of the first order
local_stamptUser's local time


Notes:

  • Field status is a bit mask

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x10

    Client’s collateral was not checked while adding order

    0x1000

    End-of-transaction bit

    0x80000

    Fill-or-kill

    0x100000

    The record is a result of moving the order

    0x200000

    The record is a result of cancelling the order

    0x400000

    The record is a result of cancelling the group of orders

    0x20000000

    Sign of cancelling the left balance of the order because of the cross-trade

  • Field action describes an action with the order

    0

    Order cancelled

    1

    Order added

    2

    Order is exercised in the trade

  • Field id_ord1 contains the initial order ID number, i.e. the ID number which was assigned to order before the order has once been relisted

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table multileg_orders_log: Log of operations with multileg orders

Table 2. Fields of table multileg_orders_log

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
isin_idi4Multileg instrument ID
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
id_deali8Deal ID for this operation
xstatusi8Extended order's status
statusi4Order's status
priced16.5Price
momenttOrder update time
diri1Direction
actioni1Operation with the order
deal_priced16.5Price of the deal
rate_priced16.5Rate price
swap_priced16.5Swap price
client_codec7Client code
login_fromc20Login of the user who has entered the order
commentc20Trader's comment
hedgei1Attribute of a hedging order
trusti1Attribute of an order from an asset management company
ext_idi4External ID number. It is added to orders, trades
broker_toc7FORTS code of the company to whom the direct order is addressed
broker_to_rtsc7RTS code of the company to whom the direct order is addressed
broker_from_rtsc7RTS code of the company who has entered the order
date_exptOrder's expiration date
id_ord1i8ID number of the first order
local_stamptUser's local time


Notes:

  • Field status is a bit mask

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x1000

    End-of-transaction bit

    0x2000

    REPO Order with Clearing Center

    0x20000

    REPO Order

    0x40000

    Regular multileg order

  • Field action describes action with order

    0

    Order cancelled

    1

    Order added

    2

    Order exercised in a trade

  • Field rate_price contains 0 for the instruments traded in swap-price.

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table deal: Trades

Table 3. Fields of table deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Instrument unique ID
id_deali8Deal ID number
id_deal_multilegi8Deal ID number for multileg deals
id_repoi8ID number of the other leg of a repo trade
posi4Number of positions in the instrument in the market after the trade
amounti4Volume, number of units of the instrument
id_ord_buyi8ID number of the buyer's order
id_ord_selli8ID number of the seller's order
priced16.5Price
momenttTime when the deal was made
nosystemi1Sign of non-system deal
xstatus_buyi8Extended status of the trade from the buyer's side
xstatus_selli8Extended status of the trade from the seller's side
status_buyi4Status of the trade from the buyer's side
status_selli4Status of the trade from the seller's side
ext_id_buyi4External ID number from the buyer's order
ext_id_selli4External ID number from the seller's order
code_buyc7Buyer's code
code_sellc7Seller's code
comment_buyc20Comment from the buyer's order
comment_sellc20Comment from the seller's order
trust_buyi1Sign of an asset management company's order from the buyer's order
trust_selli1Sign of an asset management company's order from the seller's order
hedge_buyi1Sign of a hedging deal from the buyers's side
hedge_selli1Sign of a hedging deal from the seller's side
fee_buyd26.2Fee of the buyer's deal
fee_selld26.2Fee of the seller's deal
login_buyc20Login of the buyer user
login_sellc20Login of the seller user
code_rts_buyc7RTS code of the buyer company
code_rts_sellc7RTS code of the seller company


Notes:

  • Fields code_sell, comment_sell, ext_id_sell, trust_sell, hedge_sell, login_sell, code_rts_sell, fee_sell, code_buy, comment_buy, ext_id_buy, trust_buy, hedge_buy, login_buy, code_rts_buy, fee_buy, are filled with info only for "own" deals.

  • Fields status_sell and status_buy are bit masks (for details see Trade types, created upon exercising and expiration of futures and options)

  • For technical trades that are results of trades with multileg instruments filed nosystem always equals 1, regardless the fact whether the trade is regular or negotiated one. To define whether the initial trade is regular the sign of the field nosystem should correspond to the record in the table multileg_deal.

  • The field id_repo contains the ID of the opposite REPO deal part. It contains ID of the second part for the first part, and ID of the first part for the second one.

  • Field id_deal_multileg contains code of the trade with multileg intrument, if this record is about technical trade. the field equals 0 if the trade is with an ordinary instrument.

  • In exercise trades, field id_ord_buy contains the order ID (option call). In exercise trades, field id_ord_sell contains the order ID (option put).

  • In fields xstatus_sell and xstatus_buy, the first 32 bits are equal to that of fields status_sell and status_buy, respectively. The other bits are reserved for order status extra details.

Table multileg_deal: Multileg trades

Table 4. Fields of table multileg_deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Multileg instrument ID
isin_id_rdi4Repo direct instrument ID
isin_id_rbi4Repo back instrument ID
isin_id_repoi4Repo instrument ID
durationi4Repo duration
id_deali8Deal ID number
id_deal_rdi8ID of the first part of repo in deals table
id_deal_rbi8ID of the second part of repo in deals table
id_ord_buyi8ID number of the buyer's order
id_ord_selli8ID number of the seller's order
amounti4Volume, number of units of the instrument
priced16.5Price of the first part of multileg trade
rate_priced16.5Rate price
swap_priced16.5Swap price
buyback_amountd16.2Price of the second part of multileg trade
momenttTime when the deal was made
nosystemi1Sign of non-system deal
xstatus_buyi8Extended status of the trade from the buyer's side
xstatus_selli8Extended status of the trade from the seller's side
status_buyi4Status of the trade from the buyer's side
status_selli4Status of the trade from the seller's side
ext_id_buyi4External ID number from the buyer's order
ext_id_selli4External ID number from the seller's order
code_buyc7Buyer's code
code_sellc7Seller's code
comment_buyc20Comment from the buyer's order
comment_sellc20Comment from the seller's order
trust_buyi1Sign of an asset management company's order from the buyer's order
trust_selli1Sign of an asset management company's order from the seller's order
hedge_buyi1Sign of a hedging deal from the buyers's side
hedge_selli1Sign of a hedging deal from the seller's side
login_buyc20Login of the buyer user
login_sellc20Login of the seller user
code_rts_buyc7RTS code of the buyer company
code_rts_sellc7RTS code of the seller company


Notes:

  • Fields code_sell, comment_sell, ext_id_sell, trust_sell, hedge_sell, code_rts_sell, fee_sell, code_buy, comment_buy, ext_id_buy, trust_buy, hedge_buy, code_rts_buy, fee_buy, are filled with info only for "own" deals.

  • Field rate_price contains 0 for the instruments traded in swap-price.

  • In fields xstatus_sell and xstatus_buy, the first 32 bits are equal to that of fields status_sell and status_buy, respectively. The other bits are reserved for order status extra details.

Table heartbeat: Server times table

Records in this table are added periodically by the trading system's core. It can be used for synchronization purposes (e.g. to check whether all the trades were received at specified moment of time). The table is insert-only, no modifications or deletions occur during trading session.

Table 5. Fields of table heartbeat

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
server_timetServer date and time


Table sys_events: table of events

Table 6. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Table user_deal: User trades

Table 7. Fields of table user_deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Instrument unique ID
id_deali8Deal ID number
id_deal_multilegi8Deal ID number for multileg deals
id_repoi8ID number of the other leg of a repo trade
posi4Number of positions in the instrument in the market after the trade
amounti4Volume, number of units of the instrument
id_ord_buyi8ID number of the buyer's order
id_ord_selli8ID number of the seller's order
priced16.5Price
momenttTime when the deal was made
nosystemi1Sign of non-system deal
xstatus_buyi8Status of the trade from the buyer's side
xstatus_selli8Status of the trade from the seller's side
status_buyi4Status of the trade from the buyer's side
status_selli4Status of the trade from the seller's side
ext_id_buyi4External ID number from the buyer's order
ext_id_selli4External ID number from the seller's order
code_buyc7Buyer's code
code_sellc7Seller's code
comment_buyc20Comment from the buyer's order
comment_sellc20Comment from the seller's order
trust_buyi1Sign of an asset management company's order from the buyer's order
trust_selli1Sign of an asset management company's order from the seller's order
hedge_buyi1Sign of a hedging deal from the buyers's side
hedge_selli1Sign of a hedging deal from the seller's side
fee_buyd26.2Fee of the buyer's deal
fee_selld26.2Fee of the seller's deal
login_buyc20Login of the buyer user
login_sellc20Login of the seller user
code_rts_buyc7RTS code of the buyer company
code_rts_sellc7RTS code of the seller company


Notes:

  • Fields code_sell, comment_sell, ext_id_sell, trust_sell, hedge_sell, login_sell, code_rts_sell, fee_sell, code_buy, comment_buy, ext_id_buy, trust_buy, hedge_buy, login_buy, code_rts_buy, fee_buy, are filled with info only for "own" deals.

  • Fields status_sell and status_buy are bit masks (for details see Trade types, created upon exercising and expiration of futures and options)

  • For technical trades that are results of trades with multileg instruments filed nosystem always equals 1, regardless the fact whether the trade is regular or negotiated one. To define whether the initial trade is regular the sign of the field nosystem should correspond to the record in the table multileg_deal.

  • The field id_repo contains the ID of the opposite REPO deal part. It contains ID of the second part for the first part, and ID of the first part for the second one.

  • Field id_deal_multileg contains code of the trade with multileg intrument, if this record is about technical trade. the field equals 0 if the trade is with an ordinary instrument.

  • In exercise trades, field id_ord_buy contains the order ID (option call). In exercise trades, field id_ord_sell contains the order ID (option put).

  • In fields xstatus_sell and xstatus_buy, the first 32 bits are equal to that of fields status_sell and status_buy, respectively. The other bits are reserved for order status extra details.

Table user_multileg_deal: User’s multileg orders trades

Table 8. Fields of table user_multileg_deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Multileg instrument ID
id_deali8Deal ID number
isin_id_rdi4Repo direct instrument ID
isin_id_rbi4Repo back instrument ID
isin_id_repoi4Repo instrument ID
durationi4Repo duration
id_deal_rdi8ID of the first part of repo in deals table
id_deal_rbi8ID of the second part of repo in deals table
id_ord_buyi8ID number of the buyer's order
id_ord_selli8ID number of the seller's order
amounti4Volume, number of units of the instrument
priced16.5Price of the first part of multileg trade
rate_priced16.5Rate price
swap_priced16.5Swap price
buyback_amountd16.2Price of the second part of multileg trade
momenttTime when the deal was made
nosystemi1Sign of non-system deal
xstatus_buyi8Extended status of the trade from the buyer's side
xstatus_selli8Extended status of the trade from the seller's side
status_buyi4Status of the trade from the buyer's side
status_selli4Status of the trade from the seller's side
ext_id_buyi4External ID number from the buyer's order
ext_id_selli4External ID number from the seller's order
code_buyc7Buyer's code
code_sellc7Seller's code
comment_buyc20Comment from the buyer's order
comment_sellc20Comment from the seller's order
trust_buyi1Sign of an asset management company's order from the buyer's order
trust_selli1Sign of an asset management company's order from the seller's order
hedge_buyi1Sign of a hedging deal from the buyers's side
hedge_selli1Sign of a hedging deal from the seller's side
login_buyc20Login of the buyer user
login_sellc20Login of the seller user
code_rts_buyc7RTS code of the buyer company
code_rts_sellc7RTS code of the seller company


Notes:

  • Fields code_sell, comment_sell, ext_id_sell, trust_sell, hedge_sell, code_rts_sell, fee_sell, code_buy, comment_buy, ext_id_buy, trust_buy, hedge_buy, code_rts_buy, fee_buy, are filled with info only for "own" deals.

  • Field rate_price contains 0 for the instruments traded in swap-price.

  • In fields xstatus_sell and xstatus_buy, the first 32 bits are equal to that of fields status_sell and status_buy, respectively. The other bits are reserved for order status extra details.

Stream FORTS_OPTTRADE_REPL - Options: orders and trades

This stream contains tables from the log of changes to your orders and trades.

Note

Please, note that the table orders_log contains only orders submitted by your brokerage company or direct orders addressed to your brokerage company. Orders from other companies can be received only in aggregated form as a stream of aggregated orders (please, see section 4.5). Trades are sent together (including your trades and trades by other companies), with all data except for your data filtered out.

Table user_deal contains only own deals. This table may be useful for late join.

Data scheme

Tables:

Table orders_log: Log of operations with orders

Table 9. Fields of table orders_log

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
isin_idi4Instrument unique ID
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
id_deali8Deal ID number
xstatusi8Extended order's status
statusi4Order's status
priced16.5Price
momenttOrder update time
diri1Direction
actioni1Operation with the order
deal_priced16.5Price of the deal
client_codec7Client code
login_fromc20Login of the user who has entered the order
commentc20Trader's comment
hedgei1Attribute of a hedging order
trusti1Attribute of an order from an asset management company
ext_idi4External ID number. It is added to orders, trades
broker_toc7FORTS code of the company to whom the direct order is addressed
broker_to_rtsc7RTS code of the company to whom the direct order is addressed
broker_from_rtsc7RTS code of the company who has entered the order
date_exptOrder's expiration date
id_ord1i8ID number of the first order
local_stamptUser's local time


Notes:

  • Field status is a bit mask

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x10

    Client’s collateral was not checked while adding order

    0x1000

    End-of-transaction bit

    0x80000

    Fill-or-kill

    0x100000

    The record is a result of moving the order

    0x200000

    The record is a result of cancelling the order

    0x400000

    The record is a result of cancelling the group of orders

    0x2000000

    Sign of cancelling the left balance of the order because of the cross-trade

  • Field action describes an action with the order

    0

    Order cancelled

    1

    Order added

    2

    Order is exercised in the trade

  • Field id_ord1 contains the initial order ID number, i.e. the ID number which was assigned to order before the order has once been relisted

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table deal: Trades

Table 10. Fields of table deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Instrument unique ID
id_deali8Deal ID number
id_deal_multilegi8Deal ID number for multileg deals
posi4Number of positions in the instrument in the market after the trade
amounti4Volume, number of units of the instrument
id_ord_buyi8ID number of the buyer's order
id_ord_selli8ID number of the seller's order
priced16.5Price
momenttTime when the deal was made
nosystemi1Sign of non-system deal
xstatus_buyi8Extended status of the trade from the buyer's side
xstatus_selli8Extended status of the trade from the seller's side
status_buyi4Status of the trade from the buyer's side
status_selli4Status of the trade from the seller's side
ext_id_buyi4External ID number from the buyer's order
ext_id_selli4External ID number from the seller's order
code_buyc7Buyer's code
code_sellc7Seller's code
comment_buyc20Comment from the buyer's order
comment_sellc20Comment from the seller's order
trust_buyi1Sign of an asset management company's order from the buyer's order
trust_selli1Sign of an asset management company's order from the seller's order
hedge_buyi1Sign of a hedging deal from the buyers's side
hedge_selli1Sign of a hedging deal from the seller's side
fee_buyd26.2Fee of the buyer's deal
fee_selld26.2Fee of the seller's deal
login_buyc20Login of the buyer user
login_sellc20Login of the seller user
code_rts_buyc7RTS code of the buyer company
code_rts_sellc7RTS code of the seller company


Notes:

  • Fields code_sell, comment_sell, ext_id_sell, trust_sell, hedge_sell, login_sell, code_rts_sell, fee_sell, code_buy, comment_buy, ext_id_buy, trust_buy, hedge_buy, login_buy, code_rts_buy, fee_buy, are filled with info only for "own" deals.

  • Fields status_sell and status_buy are bit masks and define the following values:

    0x20

    The deal is option's exercise deal

  • In option contracts exercise trades field id_ord_sell contains ID of the exersice order.

  • In fields xstatus_sell and xstatus_buy, the first 32 bits are equal to that of fields status_sell and status_buy, respectively. The other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table heartbeat: Server times table

Records in this table are added periodically by the trading system's core. It can be used for synchronization purposes (e.g. to check whether all the trades were received at specified moment of time). The table is insert-only, no modifications or deletions occur during trading session.

Table 11. Fields of table heartbeat

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
server_timetServer date and time


Table sys_events: table of events

Table 12. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Table user_deal: User trades

Table 13. Fields of table user_deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Instrument unique ID
id_deali8Deal ID number
id_deal_multilegi8Deal ID number for multileg deals
posi4Number of positions in the instrument in the market after the trade
amounti4Volume, number of units of the instrument
id_ord_buyi8ID number of the buyer's order
id_ord_selli8ID number of the seller's order
priced16.5Price
momenttTime when the deal was made
nosystemi1Sign of non-system deal
xstatus_buyi8Status of the trade from the buyer's side
xstatus_selli8Status of the trade from the seller's side
status_buyi4Status of the trade from the buyer's side
status_selli4Status of the trade from the seller's side
ext_id_buyi4External ID number from the buyer's order
ext_id_selli4External ID number from the seller's order
code_buyc7Buyer's code
code_sellc7Seller's code
comment_buyc20Comment from the buyer's order
comment_sellc20Comment from the seller's order
trust_buyi1Sign of an asset management company's order from the buyer's order
trust_selli1Sign of an asset management company's order from the seller's order
hedge_buyi1Sign of a hedging deal from the buyers's side
hedge_selli1Sign of a hedging deal from the seller's side
fee_buyd26.2Fee of the buyer's deal
fee_selld26.2Fee of the seller's deal
login_buyc20Login of the buyer user
login_sellc20Login of the seller user
code_rts_buyc7RTS code of the buyer company
code_rts_sellc7RTS code of the seller company


Notes:

  • Fields code_sell, comment_sell, ext_id_sell, trust_sell, hedge_sell, login_sell, code_rts_sell, fee_sell, code_buy, comment_buy, ext_id_buy, trust_buy, hedge_buy, login_buy, code_rts_buy, fee_buy, are filled with info only for "own" deals.

  • Fields status_sell and status_buy are bit masks and define the following values:

    0x20

    The deal is option's exercise deal

  • In option contracts exercise trades field id_ord_sell contains ID of the exersice order.

  • In fields xstatus_sell and xstatus_buy, the first 32 bits are equal to that of fields status_sell and status_buy, respectively. The other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Stream FORTS_ORDLOG_REPL – anonimous orders

Data scheme

Tables:

Table orders_log: Log of operations with orders

Table 14. Fields of table orders_log

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
isin_idi4Instrument unique ID
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
id_deali8Deal ID for this operation
xstatusi8Extended order's status
statusi4Order's status
priced16.5Price
momenttOrder update time
diri1Direction
actioni1Operation with the order
deal_priced16.5Price of the deal


Notes:

  • Field status is a bit mask

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x10

    Client’s collateral was not checked while adding order

    0x1000

    End-of-transaction bit

    0x80000

    Fill-or-kill

    0x100000

    The record is a result of moving the order

    0x200000

    The record is a result of cancelling the order

    0x400000

    The record is a result of cancelling the group of orders

    0x20000000

    Sign of cancelling the left balance of the order because of the cross-trade

  • Field action describes an action with the order

    0

    Order cancelled

    1

    Order added

    2

    Order is exercised in the trade

  • Field id_ord1 contains the initial order ID number, i.e. the ID number which was assigned to order before the order has once been relisted

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table multileg_orders_log: Log of operations with multileg orders

Table 15. Fields of table multileg_orders_log

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
isin_idi4Instrument unique ID
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
id_deali8Deal ID for this operation
xstatusi8Extended order's status
statusi4Order's status
priced16.5Price
momenttOrder update time
diri1Direction
actioni1Operation with the order
deal_priced16.5Price of the deal
rate_priced16.5Rate price
swap_priced16.5Swap price


Notes:

  • Field status is a bit mask

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x1000

    End-of-transaction bit

    0x2000

    REPO Order with Clearing Center

    0x20000

    REPO Order

    0x40000

    Regular multileg order

  • Field action describes action with order

    0

    Order cancelled

    1

    Order added

    2

    Order exercised in a trade

  • Field rate_price contains 0 for the instruments traded in swap-price.

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table heartbeat: Server times table

Records in this table are added periodically by the trading system's core. It can be used for synchronization purposes (e.g. to check whether all the trades were received at specified moment of time). The table is insert-only, no modifications or deletions occur during trading session.

Table 16. Fields of table heartbeat

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
server_timetServer date and time


Table sys_events: table of events

Table 17. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Stream FORTS_DEALS_REPL – anonimous trades

Data scheme

Tables:

Table deal: Trades

Table 18. Fields of table deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_deali8Deal ID number
sess_idi4Trading session ID
isin_idi4Instrument unique ID
posi4Number of positions in the instrument in the market after the trade
amounti4Volume, number of units of the instrument
id_ord_selli8ID number of the seller's order
id_ord_buyi8ID number of the buyer's order
priced16.5Price
momenttTime when the deal was made
nosystemi1Sign of non-system deal


Notes:

  • In exercise trades, field id_ord_sell contains the order ID (option trade). In exercise trades, field id_ord_buy contains the order ID (futures trade for option call). In exercise trades, field id_ord_sell contains the order ID (futures trade for option put).

Table multileg_deal: Multileg trades

Table 19. Fields of table multileg_deal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_deali8Deal ID number
sess_idi4Trading session ID
isin_idi4Multileg instrument ID
id_ord_buyi8ID number of the buyer's order
id_ord_selli8ID number of the seller's order
amounti4Volume, number of units of the instrument
priced16.5Price of the first part of multileg trade
rate_priced16.5Rate price
swap_priced16.5Swap price
buyback_amountd16.2Price of the second part of multileg trade
momenttTime when the deal was made
nosystemi1Sign of non-system deal


Table sys_events: table of events

Table 20. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Table heartbeat: Server times table

Records in this table are added periodically by the trading system's core. It can be used for synchronization purposes (e.g. to check whether all the trades were received at specified moment of time). The table is insert-only, no modifications or deletions occur during trading session.

Table 21. Fields of table heartbeat

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
server_timetServer date and time


Stream FORTS_FEE_REPL - exchange fees

Data scheme

Tables:

Table adjusted_fee: exchange fees

Table 22. Fields of table adjusted_fee

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_deali8Deal ID number
momenttTime when the deal was made
code_buyc7Buyer's code
code_sellc7Seller's code
initial_fee_buyd26.2Initial fee of the buyer's deal
initial_fee_selld26.2Initial fee of the seller's deal
adjusted_fee_buyd26.2Adjusted fee of the buyer's deal
adjusted_fee_selld26.2Adjusted fee of the seller's deal
id_repoi8ID number of the other leg of a repo trade
id_deal_multilegi8Deal ID number for multileg deals


Table sys_events: table of events

Table 23. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Stream FORTS_FUTORDERBOOK_REPL - Futures: order book snapshot

Data scheme

Tables:

  • orders - Current futures orderbook
  • info - Orderbook snapshots information

Table orders: Current futures orderbook

Table 24. Fields of table orders

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
client_codec7Client code
momenttOrder update time
xstatusi8Extended order's status
statusi4Order's status
actioni1Operation with the order
isin_idi4Instrument unique ID
diri1Direction
priced16.5Price
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
commentc20Trader's comment
hedgei1Attribute of a hedging order
trusti1Attribute of an order from an asset management company
ext_idi4External ID number. It is added to orders, trades
login_fromc20Login of the user who has entered the order
broker_toc7FORTS code of the company to whom the direct order is addressed
broker_to_rtsc7RTS code of the company to whom the direct order is addressed
date_exptOrder's expiration date
id_ord1i8ID number of the first order
broker_from_rtsc7RTS code of the company who has entered the order
init_momenttTime of the order placement
init_amounti4Initial amount in the order


Notes:

  • Field status is a bit mask and defines the following values:

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x100000

    The record is a result of moving the order

    0x200000

    The record is a result of cancelling the order

    0x400000

    The record is a result of cancelling the group of orders

    0x20000000

    Sign of cancelling the left balance of the order because of the cross-trade

  • Field action describes an action with the order

    1

    Order added

    2

    Order is exercised in the trade

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table info: Orderbook snapshots information

Table 25. Fields of table info

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
infoIDi8Unique key
logRevi8Revision for futures upon snapshot generation
lifeNumi4In stream life number
momenttSnapshot time


Stream FORTS_OPTORDERBOOK_REPL - Options: order book snapshot

Data scheme

Tables:

  • orders - Current options orderbook
  • info - Orderbook snapshots information

Table orders: Current options orderbook

Table 26. Fields of table orders

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
client_codec7Client code
momenttOrder update time
xstatusi8Extended order's status
statusi4Order's status
actioni1Operation with the order
isin_idi4Instrument unique ID
diri1Direction
priced16.5Price
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
commentc20Trader's comment
hedgei1Attribute of a hedging order
trusti1Attribute of an order from an asset management company
ext_idi4External ID number. It is added to orders, trades
login_fromc20Login of the user who has entered the order
broker_toc7FORTS code of the company to whom the direct order is addressed
broker_to_rtsc7RTS code of the company to whom the direct order is addressed
date_exptOrder's expiration date
id_ord1i8ID number of the first order
broker_from_rtsc7RTS code of the company who has entered the order
init_momenttTime of the order placement
init_amounti4Initial amount in the order


Notes:

  • Field status is a bit mask and defines the following values:

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x100000

    The record is a result of moving the order

    0x200000

    The record is a result of cancelling the order

    0x400000

    The record is a result of cancelling the group of orders

    0x20000000

    Sign of cancelling the left balance of the order because of the cross-trade

  • Field action describes an action with the order

    1

    Order added

    2

    Order is exercised in the trade

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table info: Orderbook snapshots information

Table 27. Fields of table info

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
infoIDi8Unique key
logRevi8Revision for futures upon snapshot generation
lifeNumi4In stream life number
momenttSnapshot time


Stream FORTS_ORDERBOOK_REPL - Depersonalized order book snapshot

Data scheme

Tables:

  • orders - Current orderbook
  • info - Orderbook snapshots information

Table orders: Current orderbook

Table 28. Fields of table orders

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
id_ordi8Order ID number
sess_idi4Trading session ID
momenttOrder update time
xstatusi8Extended order's status
statusi4Order's status
actioni1Operation with the order
isin_idi4Instrument unique ID
diri1Direction
priced16.5Price
amounti4Number of lots in the operation
amount_resti4Remaining number in the order
init_momenttTime of the order placement
init_amounti4Initial amount in the order


Notes:

  • Field status is a bit mask and defines the following values:

    0x01

    Quote

    0x02

    Couter

    0x04

    Non-system

    0x100000

    The record is a result of moving the order

    0x200000

    The record is a result of cancelling the order

    0x400000

    The record is a result of cancelling the group of orders

    0x20000000

    Sign of cancelling the left balance of the order because of the cross-trade

  • Field action describes an action with the order

    1

    Order added

    2

    Order is exercised in the trade

  • In field xstatus the first 32 bits are equal to that of field status, the other bits are reserved for order status extra details.

    0x100000000

    The record is a result of order deletion via 'Cancel On Disconnect' service.

Table info: Orderbook snapshots information

Table 29. Fields of table info

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
infoIDi8Unique key
logRevi8Revision at moment of snapshot's creation
lifeNumi4In stream life number
momenttSnapshot time


Stream FORTS_FUTCOMMON_REPL - Futures: common information

Data scheme

Tables:

Table common: Market fundamentals

The table contains

Table 30. Fields of table common

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
best_selld16.5Best bid
amount_selli4Size of the best bid
best_buyd16.5Best offer
amount_buyi4Size of the best offer
priced16.5Price of the last trade
trendd16.5Price trend (difference between the prices of the last two trades)
amounti4Size of the last trade
deal_timetDate and time of the last trade
min_priced16.5The low
max_priced16.5The high
avr_priced16.5Average weighted price
old_kotird16.5Settlement price of the previous session
deal_counti4Number of trades
contr_counti4Total number of contracts in the trades
capitald26.2Total volume of trades in Russian rubles
posi4Current open interest
mod_timetDate and time of changing the entry in the table
cur_kotird16.5Current quote
cur_kotir_reald16.5Market quote
orders_sell_qtyi4Number of offer orders
orders_sell_amounti4Total number of contracts in offer
orders_buy_qtyi4Number of bid orders
orders_buy_amounti4Total number of contracts in bid
open_priced16.5Opening price
close_priced16.5Closing price
local_timetTime stamp for monitoring purposes


Notes:

  • Field open_price contains the price of the first transaction in the current session, and if not, then 0

  • Field close_price contains the price of the last trade in the current session, and if not, then 0

Stream FORTS_OPTCOMMON_REPL - Options: common information

Data scheme

Tables:

Table common: Market fundamentals

The table contains

Table 31. Fields of table common

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
best_selld16.5Best bid
amount_selli4Size of the best bid
best_buyd16.5Best offer
amount_buyi4Size of the best offer
priced16.5Price of the last trade
trendd16.5Price trend (difference between the prices of the last two trades)
amounti4Size of the last trade
deal_timetDate and time of the last trade
min_priced16.5The low
max_priced16.5The high
avr_priced16.5Average weighted price
old_kotird16.5Settlement price of the previous session
deal_counti4Number of trades
contr_counti4Total number of contracts in the trades
capitald26.2Total volume of trades in Russian rubles
posi4Current open interest
mod_timetDate and time of changing the entry in the table
isin_is_speci1Currently you may submit a request for quote for this instrument
orders_sell_qtyi4Number of offer orders
orders_sell_amounti4Total number of contracts in offer
orders_buy_qtyi4Number of bid orders
orders_buy_amounti4Total number of contracts in bid
open_priced16.5Opening price
close_priced16.5Closing price
local_timetTime stamp for monitoring purposes


Notes:

  • Field open_price contains the price of the first transaction in the current session, and if not, then 0

  • Field close_price contains the price of the last trade in the current session, and if not, then 0

Aggregated orderbook streams

There are several streams of aggregated quotes defined with different depths.

Futures:

  • FORTS_FUTAGGR50_REPL – 50 quotes depth

  • FORTS_FUTAGGR20_REPL – 20 quotes depth

  • FORTS_FUTAGGR20_REPL – 5 quotes depth

For options:

  • FORTS_OPTAGGR50_REPL – 50 quotes depth

  • FORTS_OPTAGGR20_REPL – 20 quotes depth

  • FORTS_OPTAGGR20_REPL – 5 quotes depth

Note

The ability to receive particular stream depends on user account rights.

Data scheme

Tables:

Table orders_aggr: Netted orders

The table contains list of aggregate quotes. Each aggregate quote is a result of summing up volumes of active quotes on the same instrument, price and direction.

Table 32. Fields of table orders_aggr

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
priced16.5Price level
volumei8Volume
momenttMoment of the last quote update
diri1Direction


Note:

  • Records in the table can be completely updated, i.e. not only quote's volume can be updated but also the instrument, price, direction. When this event occurs it is considered that previous quote left the order-book and the new one appeared.

  • There can be records with zero volume in the table (volume = 0). These records should be ignored. Nulling of existing quotes may take place – this means that quote left the order-book or zero quote was filled in by any values – this means that quote with new values was placed in the order-book.

Stream FORTS_POS_REPL - information on positions

Data scheme

Tables:

Table position: Client positions

The table contains information on clients positions.

Table 33. Fields of table position

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
client_codec7Client code
open_qtyi4Number of positions at the start of the session
buys_qtyi4Number of contracts bought during the session
sells_qtyi4Number of contracts sold during the session
posi4Current position
net_volume_rurd26.2Net value of trades in Russian rubles. Positive number – cash is credited, negative number – cash is debited
last_deal_idi8ID of the last deal
wapriced16.5Average weighted price


Table sys_events: table of events

Table 34. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Stream FORTS_PART_REPL - information on fund, limits and risk parameters for clients

Data scheme

Tables:

  • part - Client’s funds, limits and risk parameters
  • sys_events - table of events

Table part: Client’s funds, limits and risk parameters

The table contains information on clients limits.

Table 35. Fields of table part

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
client_codec7Client code
coeff_god16.5Client’s collateral ratio
coeff_liquidityd16.5Liquidity ratio
money_oldd26.2Total amount of funds at the end of the previous session
money_amountd26.2Total cash amount
money_freed26.2Available cash amount
money_blockedd26.2Blocked cash amount
pledge_oldd26.2Collateral in form of securities at the start of the session
pledge_amountd26.2Total collateral in form of securities
pledge_freed26.2Available collateral in form of securities
pledge_blockedd26.2Blocked collateral in form of securities
vm_reserved26.2Amount reserved for negative variation margin on closed positions
vm_intercld26.2Variation margin debited or credited during the intraday clearing
feed26.2Debited fee
fee_reserved26.2Blocked amount reserved for fees under the orders
limit_spot_buyd26.2Limit for buying RTS standard instruments
limit_spot_buy_usedd26.2Limit used for buying RTS standard instruments
is_auto_update_limiti1Flag of automatic adjustment of the limit by the amount of income during downloading after clearing: 0-no, 1-adjust.
is_auto_update_spot_limiti1Flag of automatic adjustment of limits for RTS standard instruments (limit for sell trades and limit for buy trades) when downloading after clearing: 0-no, 1-adjust.
no_fut_discounti1Flag of ban to provide discounts for futures: 1-ban, 0-no.
limits_seti1Flag of set limits. 0 for no limits
premiumd26.2Premium
premium_order_reservefPremium reserve for orders
balance_moneyd26.2Money transfers balance for current trading session
vm_order_reservefAmount reserved for negative variation margin on orders
money_pledge_amountd26.2Sum of estimated value of collateral
num_clr_2deliveryi4Number of clearing sessions (including intraday clearing sessions) to turn on automatic exercise scenario of risk calculation for the non-quarterly series of options with the closest expiration date for this account
calc_exp_extra_riski1The sign that extra risk calculation for non-quarter options is on


Table sys_events: table of events

Table 36. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Stream FORTS_FUTINFO_REPL - Futures: reference and session information

Data scheme

Tables:

Table delivery_report: Delivery report

Table 37. Fields of table delivery_report

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
datetDate of clearing
client_codec7Client code
typec2Flag of Clearing Member/Brokerage Company/client. Here it is always 'CL'.
isin_idi4Instrument ID number
posi4Number of positions subject to settlement, as of the start of the current delivery stage (except for positions excluded based on the coinciding Taxpayer ID (codes))
pos_excli4For the first delivery stage – it is the number of futures positions that were closed out because they were recorded in registers with the same Taxpayer ID (code). For the second delivery stage is always 0
pos_unexeci4Number of positions that were not settled during the current delivery stage
unexeci1Flag of settlement/failure to settle by the client whose positions are referred to in the field pos_unexec
settl_pairc12Settlement accounts pair code
asset_codec25Trading code of the asset being delivered
issue_codec25Depository code of the asset being delivered
oblig_rurd16.2Amount of obligations in Russian rubles
oblig_qtyi8Amount of obligations in units of securities
fulfil_rurd16.2Amount of performed obligations in Russian rubles
fulfil_qtyi8Amount of performed obligations in units of securities
stepi4Number of delivery stage
sess_idi4Trading session ID
id_geni4ID number of the stage of report generation


Notes:

  • Field unexec can take the following values:

    0

    Settlement

    1

    Non-settlement

  • Field step always has a value of 1 when delivery of RTS Standard instrument

Table fut_rejected_orders: register of orders rejected during the clearing

Table 38. Fields of table fut_rejected_orders

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
order_idi8Order ID number
sess_idi4Trading session ID
client_codec7Client code
momenttOrder update time
moment_rejecttTime when the order was rejected
isin_idi4Instrument unique ID
diri1Direction
amounti4Volume, in units of the instrument
priced16.5Price
date_exptOrder's expiration date
id_ord1i8ID number of the first order
ret_codei4Return code of the re-entering procedure
ret_messagec255Text of the message containing the reason for rejection of the order when it is re-entered
commentc20Trader's comment
login_fromc20Login of the user who has entered the order
ext_idi4External ID number. It is added to orders, trades


Table fut_intercl_info: Information of the variation margin calculated based on the results of the intraday clearing

Table 39. Fields of table fut_intercl_info

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
client_codec7Client code
vm_intercld16.2Variation margin debited or credited during the intraday clearing


Table fut_bond_registry: Guide on parameters of bonds

Table 40. Fields of table fut_bond_registry

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
bond_idi4ID of the bond
small_namec25Trading code for corporate bonds trading on RTS
short_isinc25Bonds issue
namec75Bond’s name
date_redempttBond’s maturity date
nominald16.5Bond’s face value
bond_typei1Type: share/bond
year_basei2Day-count basis


Notes:

  • Field bond_type is a bit mask and defines the following values:

    0

    not set

    0x1

    Share

    0x2

    Bond (not amortized, actual formula)

    0x4

    Amortized bond

    0x8

    Bond, virtual American formula

    0x10

    Bond, virtual European formula

Table fut_bond_isin: Guide on bond instruments

Table 41. Fields of table fut_bond_isin

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
bond_idi4ID of the bond
coeff_conversiond5.4Conversion ratio


Table fut_bond_nkd: Accrued interest as of the coupon payment date

Table 42. Fields of table fut_bond_nkd

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
bond_idi4ID of the bond
datetCoupon payment date
nkdd16.7Accrued interest as of the coupon payment date
is_cuponi1Flags: 0 - accrued interest as of the bond futures contract settlement date, 1 - coupon, 2 - accrued interest as of the bond settlement date


Table fut_bond_nominal: Payment of bonds’ face value

Table 43. Fields of table fut_bond_nominal

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
bond_idi4ID of the bond
datetCoupon payment date
nominald16.5payment of bonds’ face value
face_valued16.5Payment of bonds’ rest face value
coupon_nominald8.5Coupon value in % of face value
is_nominali1Type of record in the table


Notes:

  • Field is_nominal may contain the following values:

    0

    Residual face value as of the bond futures contract settlement date

    1

    Residual face value as of the coupon payment date

    2

    Residual face value as of the bond settlement date

Table usd_online: USD rate online

Table 44. Fields of table usd_online

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
idi8Rate ID
rated16.4USD rate
momenttTime of the rate


Notes:

  • At current moment filed id can take value = 1 (rub to usd)

Table fut_vcb: Traded assets dictionary

The table contains directory of base contracts for instruments.

Table 45. Fields of table fut_vcb

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
code_vcbc25Base contract code
namec75Name
exec_typec1Settlement type
currc3Payment currency
exch_payd16.2Exchange fee per 1 contract in Russian rubles
exch_pay_scalpedi1Flag of scalping the exchange fee
clear_payd16.2Clearing fee per 1 contract in Russian rubles
clear_pay_scalpedi1Flag of scalping the clearing fee
sell_feed7.3Commission payable by the seller. Not relevant
buy_feed7.3Commission payable by the buyer. Not relevant
trade_schemec1Trading mode
sectionc50Market section. 'Securities', 'Commodities', 'Money'
exch_pay_spotd16.5Exchange fee for RTS standard instrument per 1 lot in percentage of the price
client_codec7Client code
exch_pay_spot_repod16.5Exchange fee on repo
rate_idi4Rate ID


Notes:

  • Field exec_type can take the following values:

    A

    Alternative

    D

    Settlement

    I

    Index

    S

    Settlement via T+ mode, ASTS

  • Field trade_scheme can take the following values:

    F

    With 100% collateral

    G

    With pledge

Table session: Information about a trading session

The table contains trading sessions timetable.

Table 46. Fields of table session

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
begintOpening time
endtClosing time
statei4Session status
opt_sess_idi4ID number of the relevant session for options
inter_cl_begintTime when the intraday clearing begins
inter_cl_endtTime when the intraday clearing is over
inter_cl_statei4Status of the intraday clearing
eve_oni1Flag of holding an additional evening session
eve_begintTime when the additional evening session starts
eve_endtTime when the additional evening session is over
mon_oni1Flag of holding an additional morning session
mon_begintTime when the additional morning session starts
mon_endtTime when the additional morning session is over
pos_transfer_begintTime when the special period for position transfer starts
pos_transfer_endtTime when the special period for position transfer finishes


Notes:

  • Fields pos_transfer_begin and pos_transfer_end specify the period of trading session during which special mode of concluding trades with instruments that are delivered during this current trading day is in power. During this special mode all orders with this certain instrument are prohibited excluding negotiated trades within one Clearing member.

  • Field state can take the following values:

    0

    Session is scheduled. Orders can't be placed but can be cancelled.

    1

    Session is running. Orders can be both placed and cancelled.

    2

    Trading with all instruments is suspended. Orders can't be placed but can be cancelled.

    3

    Session is closed compulsorily. Orders can be neither placed nor cancelled.

    4

    Session is completed because the time is up. Orders can be neither added nor cancelled.

  • Field inter_cl_state is a bit mask:

    0x0

    It is not defined. Orders can be both placed and cancelled.

    0x01

    It is scheduled today. Orders can be placed and cancelled.

    0x02

    It is cancelled. Orders can be placed and cancelled.

    0x04

    Current, i.e.it is running, nothing can be done. Orders can't be placed and cancelled.

    0x08

    Current, i.e. it is running (due to time schedule), but actually it is over and intraday clearing data is already available. Orders can't be placed but can be cancelled.

    0x10

    It is successfully over (due to time schedule as well). Orders can be placed and cancelled.

Table multileg_dict: Multileg instruments dictionary

Table 47. Fields of table multileg_dict

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Multileg instrument ID
isin_id_legi4ID of the instrument which is a component of specified multileg instrument
qty_ratioi4Quantity ratio


Notes:

  • The meaning of the filed qty_ratio is specifying the number and direction of the multileg instrument: If the value equals qty_ratio > 0 then this instrument is a multileg instrument with the same direction with which is the multileg order, if qty_ratio < 0 – with opposite. Absolute value of qty_ratio specifies the coefficient by which the number of multileg instruments in the order should be multiplied in order to get the number of instruments isin_id_leg.

Table fut_sess_contents: Traded instruments dictionary

The table contains dictionary of instruments which are traded in specified trading session.

Table 48. Fields of table fut_sess_contents

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Instrument unique ID
short_isinc25Description of the instrument
isinc25Symbol code of the instrument
namec75Instrument name
inst_termi4Shift from RTS standard instruments
code_vcbc25Base contract code
is_limitedi1Flag of limits established for trading
limit_upd16.5Upper price limit
limit_downd16.5Lower price limit
old_kotird16.5Adjusted settlement price of the previous session
buy_depositd16.2Collateral of the buyer
sell_depositd16.2Collateral of the seller
roundtoi4Number of decimal places after the decimal point for the price
min_stepd16.5Minimum price increment
lot_volumei4Lot, i.e. number of units of the underlying asset in the instrument
step_priced16.5Value of the minimum price incrememnt
d_pgtExpiration date
is_spreadi1Flag of the futures contract’s being part of an intermonth spread 1 – spread; 0 – no spread.
coeffd9.6Ratio of the intermonth spread
d_exptInstrument’s settlement date
is_percenti1Flag of futures contract. 1 – interest rate futures, 0 – common futures, 2 - weather and electricity futures, 3 - Eurobonds futures, 4 - futures on repo rate
percent_rated6.2Variation margin rate for interest rate futures
last_cl_quoted16.5Quote after the last clearing session
signsi4Flags field
is_trade_eveningi1Flag of being traded during the evening trading session
tickeri4Unique ID number of the primary RTS standard instruments
statei4State of trading in the instrument
price_diri1Direction of price sorting for the instrument
multileg_typei4Type of multileg instrument
legs_qtyi4Number of instruments for multileg instrument
step_price_clrd16.5Value of the minumum increment for the clearing session
step_price_interclrd16.5Value of the minumum increment for the intraday clearing session
step_price_currd16.5Value of the minimum increment in USD
d_starttInstrument's start trade date
exch_payd16.5Exchange fee
pctyield_coeffd16.5Coef. for yield calculation on percent rates futures
pctyield_totald16.5Sum of rates for yield calculation on percent rates futures


Notes:

  • Trading session state has priority over instrument state. That is, if a session is in "suspended" or "finished" state, then all instruments can't be traded regardless their states.

  • Field state can take the following values:

    0

    Session for this instrument is scheduled. One can cancel orders for this instrument

    1

    Session for this instrument is running. One can both add and cancel orders for this instrument

    3

    Session for this instrument has been closed compulsorily. Orders can be neither added nor cancelled

    4

    Session for this instrument has been completed because the time is up. Orders can't be neither added nor cancelled

    5

    Trading in this instrument has been suspended. One can cancel orders for this instrument

  • Field signs is a bit mask and defines the following values:

    0x01

    The instrument is traded in the evening session

    0x02

    Futures-style (1) or equity-style (0)

    0x10

    Sign of anonymous trading

    0x20

    Sign of non-anonymous trading

    0x40

    Sign of trading in the main session

    0x100

    Sign of multileg-instrument

    0x1000

    Sign of primary price for multileg instruments:

    • 0 for swap price

    • 1 for rate price

  • Field price_dir can take the following values:

    0

    Standard order of price graduation

    1

    Reverse order of price graduation

  • Field multileg_type can take the following values:

    0

    Ordinary instrument, not the multileg one

    1

    The instrument that is traded in the REPO mode

    2

    The instrument is RTS Money swap

    3

    The instrument is calendar futures spread

  • Field is_trade_evening is bit mask:

    0

    Instrument is not traded

    1

    Instrument is traded in the evening trading session

    2

    Instrument is traded in the main trading session

Table fut_instruments: Instruments dictionary

Table 49. Fields of table fut_instruments

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
short_isinc25Description of the instrument
isinc25Symbol code of the instrument
namec75Instrument name
inst_termi4Shift from RTS standard instruments
code_vcbc25Base contract code
is_limitedi1Flag of limits established for trading
old_kotird16.5Adjusted settlement price of the previous session
roundtoi4Number of decimal places after the decimal point for the price
min_stepd16.5Minimum price increment
lot_volumei4Lot, i.e. number of units of the underlying asset in the instrument
step_priced16.5Value of the minimum price incrememnt
d_pgtExpiration date
is_spreadi1Flag of the futures contract’s being part of an intermonth spread 1 – spread; 0 – no spread.
coeffd9.6Ratio of the intermonth spread
d_exptInstrument’s settlement date
is_percenti1Flag of futures contract. 1 – interest rate futures, 0 – common futures, 2 - weather and electricity futures, 3 - Eurobonds futures, 4 - futures on repo rate
percent_rated6.2Variation margin rate for interest rate futures
last_cl_quoted16.5Quote after the last clearing session
signsi4Flags field
volat_mind20.15Volatility lower edge
volat_maxd20.15Volatility upper edge
price_diri1Direction of price sorting for the instrument
multileg_typei4Type of multileg instrument
legs_qtyi4Number of instruments for multileg instrument
step_price_clrd16.5Value of the minumum increment for the clearing session
step_price_interclrd16.5Value of the minumum increment for the intraday clearing session
step_price_currd16.5Value of the minimum increment in USD
d_starttInstrument's start trade date
is_limit_opti1Flag of calculation of the limits on options on this future
limit_up_optd5.2For options in the money: the upper limit of deviation from the central strike volatility
limit_down_optd5.2For options in the money: the lower limit of deviation from the central strike volatility
adm_limd16.5For options in the money: limit of the theoretical price deviation set by the administrator
adm_lim_offmoneyd16.5For options out of the money: limit of the theoretical price deviation
apply_adm_limiti1For options in the money: 1 - apply administrative limits, 0 - apply volatility deviation limits
pctyield_coeffd16.5Coef. for yield calculation on percent rates futures
pctyield_totald16.5Sum of rates for yield calculation on percent rates futures


Table diler: Companies’ names dictionary

Table 50. Fields of table diler

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
client_codec7Client code
namec200Company name
rts_codec50RTS code of the company
transfer_codec7Account code for position transfer
statusi4Sign of segregated account


Notes:

  • Fields client_code, name, transfer_code are filled only for client's brokerage company (-ies).

  • Status field is a bit mask:

    • 0x01 - control section

    • 0x02 - separate register

    • 0x04 - BF is control

Table investr: Clients dictionary

Table 51. Fields of table investr

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
client_codec7Client code
namec200Client name
statusi4Client's flags


Notes:

  • Status field is a bit mask:

    • 0x01 - control section

    • 0x02 - separate register

    • 0x04 -BF is control

Table fut_sess_settl: Clearing results: settlement prices

The table contains settlement instruments prices of the last clearing.

Table 52. Fields of table fut_sess_settl

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
date_clrtClearing date
isinc25Symbol code of the instrument
isin_idi4Instrument unique ID
settl_priced16.5Settlement price


Table sys_messages: Trading system messages

Table 53. Fields of table sys_messages

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
msg_idi4Unique message ID
momenttMessage date and time
lang_codec8Message language
urgencyi1Urgency
statusi1Message status
textc255Short text
message_bodyc4000Full text


Table prohibition: Prohibitions

Table 54. Fields of table prohibition

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
prohib_idi4Number of prohibition
client_codec7Client code
initiatori4Originator of prohibition
sectionc50Section
code_vcbc25Base contract code
isin_idi4Instrument unique ID
priorityi4Priority of prohibition
group_maski8Bitmask of groups for which there is a prohibition
typei4Type of prohibition
is_legacyi4Symptom adding bans through legacy-komandyBitovaya mask groups for which there is a prohibition


Notes:

  • Field Initiator - Initiator of the prohibition:

    0

    BF;

    1

    CF Chief trader;

    2

    CC Administrator;

    3

    TS Administrator.

  • Field Type - Prohibition type

    0

    No prohibitions (when cancelling a previous prohibition with lower priority, otherwise simply delete the line);

    1

    prohibited to open positions;

    2

    prohibited to perform all trading operations;

    3

    prohibited to open sell positions;

    0x08

    BF prohibition to add orders for exercising.

    0x10

    Only Chief Trader is allowed to add orders for exercising.

  • Field ProhibitionGroupMask - Instrument type bitmask:

    0x1

    T+0

    0x2

    T+1

    0x4

    T+2

    ...

    ...

    0x8000000

    T+27

    0x10000000

    T-1

    0x20000000

    spots

    0x40000000

    futures

    0x80000000

    options

  • Field Priority - From high to low

    Client code, instrument

    9

    Client code, UA

    8

    Client code, all UAs

    7

    BF code, instrument

    6

    BF code, UA

    5

    BF code, all UAs

    4

    CF code, instrument

    3

    CF code, UA

    2

    CF code, all UAs

    1

  • Field SectionID - Name:

    1

    Securities

    2

    Commodities

    3

    FX

    4

    MOSENEX

    5

    SPBEX

    6

    SPBEX_OAO

    7

    NAMEX

Table rates: Currency rates dictionary

Table 55. Fields of table rates

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
rate_idi4Payment currency identifier
curr_basec15Base currency code
curr_coupledc15Linked currency code
radiusd16.5Price indicator change radius (in percent)


Table sys_events: table of events

Table 56. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Stream FORTS_OPTINFO_REPL - Options: reference and session information

Data scheme

Tables:

Table opt_rejected_orders: register of orders rejected during the clearing

Table 57. Fields of table opt_rejected_orders

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
order_idi8Order ID number
sess_idi4Trading session ID
client_codec7Client code
momenttOrder update time
moment_rejecttTime when the order was rejected
isin_idi4Instrument unique ID
diri1Direction
amounti4Volume, in units of the instrument
priced16.5Price
date_exptOrder's expiration date
id_ord1i8ID number of the first order
ret_codei4Return code of the re-entering procedure
ret_messagec255Text of the message containing the reason for rejection of the order when it is re-entered
commentc20Trader's comment
login_fromc20Login of the user who has entered the order
ext_idi4External ID number. It is added to orders, trades


Table opt_intercl_info: Information of the variation margin calculated based on the results of the intraday clearing

Table 58. Fields of table opt_intercl_info

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
client_codec7Client code
vm_intercld16.2Variation margin debited or credited during the intraday clearing


Table opt_exp_orders: Register of orders for expiration of option

Table 59. Fields of table opt_exp_orders

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
exporder_idi8Unique ID number of the order for expiration
client_codec7Client code
isin_idi4Instrument unique ID
amounti4Number of expiring positions
sess_idi4Trading session ID
datetDate and time
amount_applyi4Number of positions detailed in orders as of intraday clearing


Table opt_vcb: Traded assets dictionary

The table contains dictionary of base contracts for instruments.

Table 60. Fields of table opt_vcb

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
code_vcbc25Base contract code
namec75Name
exec_typec1Settlement type
currc3Payment currency
exch_payd16.2Exchange fee per 1 contract in Russian rubles
exch_pay_scalpedi1Flag of scalping the exchange fee
clear_payd16.2Clearing fee per 1 contract in Russian rubles
clear_pay_scalpedi1Flag of scalping the clearing fee
sell_feed7.3Commission payable by the seller. Not relevant
buy_feed7.3Commission payable by the buyer. Not relevant
trade_schemec1Trading mode
coeff_outd7.3Approximation ratio for options priced beyond limits
is_speci1Flag of an RFQ specialist for this contract
spec_spreadd16.5Maximum width of the specialist’s spread
min_voli4Minimum volume of quotes from the specialist
client_codec7Client code
rate_idi4Rate ID


Table opt_sess_contents: Traded instruments dictionary

The table contains dictionary of instruments which are traded in specified trading session.

Table 61. Fields of table opt_sess_contents

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
isin_idi4Instrument unique ID
isinc25Symbol code of the instrument
short_isinc25Description of the instrument
namec75Instrument name
code_vcbc25Base contract code
fut_isin_idi4ID of the futures instrument
is_limitedi1Flag of limits established for trading
limit_upd16.5Upper limit on premium
limit_downd16.5Lower limit on premium
old_kotird16.5Quote (theoretical price of the option) of the previous session
bgo_cd16.2Basic size of the collateral to be posted on one open position of the option writer (Russian rubles)
bgo_ncd16.2Basic size of collateral to be posted on one unsecured position of the option writer (Russian rubles)
europei1Option’s kind. 0 – American option, 1 – European option
puti1Option’s type. 0 - Call option, 1 - Put option
striked16.5Strike price
roundtoi4Number of decimal places after the decimal point for the price
min_stepd16.5Premium’s minimum increment
lot_volumei4Lot, i.e. number of units of the underlying asset in the instrument
step_priced16.5Value of the minimum premium's increment
d_pgtExpiration date
d_exec_begtDay when the instrument’s expiration begins
d_exec_endtDay when the instrument’s expiration is over
signsi4Flags field
last_cl_quoted16.5Settlement Price (theoretical price of the option) after the last clearing session
bgo_buyd16.2Basic size of Collateral requested in order to buy a futures-style option
base_isin_idi4ID of the base futures instrument
d_starttInstrument's start trade date
exch_payd16.2Exchange fee per 1 contract in Russian rubles


Notes:

  • Field signs is a bit mask and defines the following values:

    0x01

    The instrument is traded in the evening session

    0x02

    Futures-style (1) or equity-style (0)

    0x10

    Sign of anonymous trading

    0x20

    Sign of non-anonymous trading

    0x40

    Sign of trading in the main session

Table opt_sess_settl: Clearing results: volatility and theoretical prices

The table contains volatility and theoretical prices of the last clearing.

Table 62. Fields of table opt_sess_settl

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
date_clrtClearing date
isinc25Symbol code of the instrument
isin_idi4Instrument ID number
volatd16.5Option’s volatility
theor_priced16.5Option’s theoretical price


Table sys_events: table of events

Table 63. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Stream FORTS_MISCINFO_REPL - miscellaneous information

Data scheme

Tables:

Table volat_coeff: Parametric volatility curve's parameters

Table 64. Fields of table volat_coeff

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
ad16.10Coefficient A of the parametric volatility curve
bd16.10Coefficient B of the parametric volatility curve
cd16.10Coefficient C of the parametric volatility curve
dd16.10Coefficient D of the parametric volatility curve
ed16.10Coefficient E of the parametric volatility curve
sd16.10Coefficient S of the parametric volatility curve


Stream FORTS_MM_REPL - information on MM's obligations

Data scheme

Tables:

Table fut_MM_info: MM's obligations in futures

Table 65. Fields of table fut_MM_info

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
spreadd16.5Spread in points
price_edge_selld16.5Price of the worst sell order included in the spread
amount_sellsi4Number of contracts in the sell order included in the spread
price_edge_buyd16.5Price of the worst buy order included in the spread
amount_buysi4Number of contracts in the buy order included in the spread
mm_spreadd16.5Agreed spread
mm_amounti4Number in accordance with the agreement
spread_signi1Sign: 1-spread is not maintained, 0-spread is maintained
amount_signi1Sign: 1- number is not maintained, 0- number is maintained
percent_timed6.2% of fulfilled obligations
period_starttStart of the period of MM rules coming into force
period_endtEnd of the period of MM rules coming into force
client_codec7Client code
active_signi4Sign: 1-note is deleted (stopped being active), 0-is active
agmt_idi4Identifier of the MM agreement
fulfil_mind6.2Minimum percentage of the liabilities for the trading session
fulfil_partiald6.2Percentage of partial fulfillment of the obligations of the trading session
fulfil_totald6.2Percentage of fulfillment of obligations of the trading session
is_fulfil_mini1Minimum sign of the liabilities for the trading session
is_fulfil_partiali1Sign of partial fulfillment of the obligations of the trading
is_fulfil_totali1Sign of fulfillment of obligations of the trading session
is_rfi1Sign of clearing member market-maker requirement
id_groupi4ID of market-maker group of instrument


Notes: The 'fut_MM_info' table of the 'FORTS_MM_REPL' stream contains market-makers obligations accurate to 7-digit client code.

Table opt_MM_info: MM's obligations in options

Table 66. Fields of table opt_MM_info

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
spreadd16.5Spread in points
price_edge_selld16.5Price of the worst sell order included in the spread
amount_sellsi4Number of contracts in the sell order included in the spread
price_edge_buyd16.5Price of the worst buy order included in the spread
amount_buysi4Number of contracts in the buy order included in the spread
mm_spreadd16.5Agreed spread
mm_amounti4Number in accordance with the agreement
spread_signi1Sign: 1-spread is not maintained, 0-spread is maintained
amount_signi1Sign: 1- number is not maintained, 0- number is maintained
percent_timed6.2% of fulfilled obligations
period_starttStart of the period of MM rules coming into force
period_endtEnd of the period of MM rules coming into force
client_codec7Client code
cstrike_offsetd16.5Central Strike offset
active_signi4Sign: 1-note is deleted (stopped being active), 0-is active
agmt_idi4Identifier of the MM agreement
fulfil_mind6.2Minimum percentage of the liabilities for the trading session
fulfil_partiald6.2Percentage of partial fulfillment of the obligations of the trading session
fulfil_totald6.2Percentage of fulfillment of obligations of the trading session
is_fulfil_mini1Minimum sign of the liabilities for the trading session
is_fulfil_partiali1Sign of partial fulfillment of the obligations of the trading
is_fulfil_totali1Sign of fulfillment of obligations of the trading session
is_rfi1Sign of clearing member market-maker requirement
id_groupi4ID of market-maker group of instrument


Notes: The 'opt_MM_info' table of the 'FORTS_MM_REPL' stream contains market-makers obligations accurate to 7-digit client code.

Table cs_mm_rule: Instruments for recalculating the central strike price.

Table 67. Fields of table cs_mm_rule

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
client_codec4Client code
isin_idi4Instrument unique ID


Table mm_agreement_filter: Table numbers and types of contracts for the provision of market-making services

Table 68. Fields of table mm_agreement_filter

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
agmt_idi4Identifier of the agreement
agreementc50Number of the agreement
client_codec7Client code
is_futi1Type of obligation


Stream FORTS_CLR_REPL - clearing information

Data scheme

Tables:

Table money_clearing: Status of clients’ cash accounts after clearing

Table 69. Fields of table money_clearing

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
client_codec7Client code
sharei1Account type
amount_begd16.2At the start of the day
vmd16.2Variation margin including variation margin on futures-style options
premiumd16.2Premium on options
payd16.2Account operations
fee_futd16.2Exchange fee on futures
fee_optd16.2Exchange fee on options
god16.2Total collateral on futures and options
amount_endd21.2At the end of the day
freed22.2Available funds
ext_reserved26.2Additional provision


Notes:

  • Tool box RUONIA ext_reserve contains the sum funds set aside for possible rate change RUONIA

Table clr_rate: Currency and Index rates

Table 70. Fields of table clr_rate

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
rated16.5Index value
momenttDate and time value was fixed
signsi1Sign, that corresponds to the current value
sess_idi4Trading session ID
rate_idi4Rate ID


Table fut_pos: Open interest in futures as a result of evening clearing session

Table 71. Fields of table fut_pos

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
isinc25Symbol code of the instrument
client_codec7Client code
accounti1Account type (0 - CF; 1 - BF; 2 - client)
pos_begi4Position on trading session start
pos_endi4Position on trading session end
vmd16.2Total variation margin at clearing time
feed16.2Total fee
accum_god16.2Accumulated Collateral Deposit
fee_exd16.2Exchange fee
vat_exd16.2VAT included in exchange fee
fee_ccd16.2Clearing fee
vat_ccd16.2VAT included in clearing fee


Table opt_pos: Open interest in options as a result of evening clearing session.

Table 72. Fields of table opt_pos

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
isinc25Symbol code of the instrument
client_codec7Client code
accounti1Account type (0 - CF; 1 - BF; 2 - client)
pos_begi4Position on trading session start
pos_endi4Position on trading session end
vmd16.2Total VM after the main clearing session per client/firm and instrument. Equals to the sum of VAR_MARG_P and VAR_MARG_D fields.
feed16.2Total fee of the client/firm and instrument. Coincide with the SBOR field of reports
fee_exd16.2Exchange fee
vat_exd16.2VAT included in exchange fee
fee_ccd16.2Clearing fee
vat_ccd16.2VAT included in clearing fee


Table fut_sess_settl: Futures settlement prices

Table 73. Fields of table fut_sess_settl

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
date_clrtClearing date
isinc25Symbol code of the instrument
isin_idi4Instrument unique ID
settl_priced16.5Settlement price


Table opt_sess_settl: options' settlement price

Table 74. Fields of table opt_sess_settl

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
sess_idi4Trading session ID
date_clrtClearing date
isinc25Symbol code of the instrument
isin_idi4Instrument ID number
volatd16.5Option’s volatility
theor_priced16.5Option’s theoretical price


Table pledge_details: Pledgs details table

Table 75. Fields of table pledge_details

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
client_codec7Client code
pledge_namec10Foreign currency/security code
amount_begd10.0Foreign currencies/securities amount at session opening
payd10.0Amount of foreign currencies/securities deposited or withdrawn, in units
amountd10.0Current amount of foreign currencies/securities
rated16.5Assessed value of foreign currency/security unit (in Russian roubles)
amount_beg_moneyd16.2Foreign currency/securities amount at session opening (in Russian rubles)
pay_moneyd16.2Amount of foreign currencies/securities deposited or withdrawn, in units (in Russian roubles)
amount_moneyd16.2Current amount of foreign currencies/securities (in Russian rubles)
com_ensurei1Collateral type


Notes:

  • Field 'amount_money' - Current amount of foreign currencies/securities (in Russian rubles) (calculated as 'amount' * 'rate')

  • Field 'amount_beg_money' - Foreign currencies/securities amount at session opening (in Russian rubles) (in Russian roubles) (calculated as 'amount_beg' * 'rate')

  • Field 'pay_money' - Amount of foreign currencies/securities deposited or withdrawn, in units (in Russian roubles) (calculated as 'pay' * 'rate')

  • Field 'com_ensure' - Collateral type:

    0

    partial collateral;

    1

    full collateral.

Table sys_events: table of events

Table 76. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events:

    event_type = 3

    message = "clearing_data_ready"

    Data are ready after main clearing session

Stream RTS_INDEX_REPL - online indices

Data scheme

Tables:

Table rts_index: Indices

The table contains data about Stock Exchange Indices values.

Table 77. Fields of table rts_index

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
namec25Index ID
momenttTime of the last update
valued18.4Index value
prev_close_valued18.4Close value
open_valued18.4Open value
max_valued18.4Max value
min_valued18.4Min value
usd_rated10.4USD rate for indices which include both RUB and USD contract prices
capd18.4Index capitalization
volumed18.4Volume of trades that compose index value


Stream RTS_INDEXLOG_REPL - indices history

Data scheme

Tables:

Table rts_index_log: Indices values log

The table contains history of Stock Exchange Indices values. The table is truncated every night during technical break.

Table 78. Fields of table rts_index_log

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
namec25Index ID
momenttTime of the last update
valued18.4Index value
prev_close_valued18.4Close value
open_valued18.4Open value
max_valued18.4Max value
min_valued18.4Min value
usd_rated10.4USD rate for indices which include both RUB and USD contract prices
capd18.4Index capitalization
volumed18.4Volume of trades that compose index value


Stream FORTS_VM_REPL - online variational margin stream

Data scheme

Tables:

  • fut_vm - Variation margin for futures
  • opt_vm - Variation margin for options

Table fut_vm: Variation margin for futures

Table 79. Fields of table fut_vm

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
client_codec7Client code
vmd16.5The accumulated variation margin on futures trades calculated according to the current quote
vm_reald16.5The accumulated variation margin on futures trades calculated based on the current market quote


Table opt_vm: Variation margin for options

Table 80. Fields of table opt_vm

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
client_codec7Client code
vmd16.5The accumulated variation margin on futures-style options trades calculated based on the current option quote
vm_reald16.5The accumulated variation margin on futures-style options trades calculated based on the current option quote


Stream FORTS_VOLAT_REPL - online volatility information

Data scheme

Tables:

Table volat: Volatility

Table 81. Fields of table volat

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isin_idi4Instrument unique ID
sess_idi4Trading session ID
volatd16.5Option’s volatility
theor_priced16.5Option’s theoretical price
theor_price_limitd16.5Theoretical option price with limits
up_premd16.5Upper limit for option price
down_premd16.5Lower limit for option price


Stream FORTS_INFO_REPL - additional reference information

Data scheme

Tables:

Table base_contracts_params: Base contracts parameters

Table 82. Fields of table base_contracts_params

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
code_vcbc25Code of the underlying contract
code_mcsc25Intercontract spread ID
volat_numi1Number of volatility curves
points_numi1Number of risk points
subrisk_stepfNumber of risk subpoints
is_percenti1Flag of futures contract
percent_rated16.5Variation margin rate for interest rate futures
currency_volatd16.5Volatility of currency rate
is_usdi1Sign of USD contract
usd_rate_curv_radiusfUSD rate curvature radius
somcfCollateral rate for uncovered sells


Notes:

  • Field is_percent may contain the following values:

    0

    common futures

    1

    interest rate futures

    2

    weather and electricity futures

    3

    eurobonds futures

    4

    futures on repo rate

Table futures_params: Futures parameters

Table 83. Fields of table futures_params

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isinc25Instrument ID
isin_idi4Instrument unique ID
code_vcbc25Code of the underlying contract
limitfLimit of contract price variations
settl_priced16.5Settlement price
spread_aspecti1Flag of making up futures spread
subriski1Sign of accounting risks in risks subpoints
step_pricefValue of the minimum price incrememnt
base_god26.2Basic collateral
exp_datetDate of expiration
spot_signsi1Sing of RTS Standard instrument
settl_price_reald16.5Real settlement price
min_stepfMinimal price increment


Notes:

  • Field spread_aspect can take the following values:

    0

    It is not included in spread

    2

    It is included into calendar spread

  • Fieldspot_signs can take the following values:

    0

    Ordinary futures

    1

    RTS Standard instrument

    3

    Primary RTS Standard instrument

Table virtual_futures_params: Virtual futures parameters

Table 84. Fields of table virtual_futures_params

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isinc25Instrument ID
isin_basec25Real futures ID
is_net_positivei1Sign of accounting positive risk on this virtual futures
volat_rangefVolatility range
t_squaredfValue of the square root from time to date of expiration of options to this virtual futures
max_addriskfUpper limitation on additional risks
afParameter a
bfParameter b
cfParameter c
dfParameter d
efParameter e
sfParameter s
exp_datetDate of expiration
fut_typei1Sign of marginal calculation system for the options to this virtual futures
use_null_volati1Sign of zero volatility
allow_use_extra_exp_riski1Allow broker to turn on calculation of extra expiration risks for this option series
calc_extra_exp_riski1Force system to turn on calculation of extra expiration risks for this option series


Table options_params: Options parameters

Table 85. Fields of table options_params

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
isinc25Instrument ID
isin_idi4Instrument unique ID
isin_basec25Virtual futures ID
striked16.5Option's strike
opt_typei1Option's type: 1 - PUT, 2 - CALL
settl_priced16.5Settlement price
base_go_selld26.2Base collateral to sell
synth_base_god26.2Base collateral of synthetic sell position
base_go_buyd26.2Base collateral to buy


Table broker_params: Brokerage firms parameters

Table 86. Fields of table broker_params

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
broker_codec7Brokerage company code
code_vcbc25Base contract code
limit_spot_selli4Not used
used_limit_spot_selli4Not used


Table client_params: Clients parameters

Table 87. Fields of table client_params

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
client_codec7Client code
code_vcbc25Base contract code
coeff_god16.5Collateral coefficient
limit_spot_selli4Not used
used_limit_spot_selli4Not used


Table sys_events: table of events

Table 88. Fields of table sys_events

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
event_idi8Unique ID of the event
sess_idi4Session number
event_typei4Type of the event
messagec64Description of the event


Notes:

  • Possible types of events

    event_type = 1

    message = "session_data_ready"

    All data from the clearing system have been loaded into the trading system

    event_type = 2

    message = "intraday_clearing_finished"

    All clearing procedures have been finished in the intraday clearing session

    event_type = 4

    message = "intraday_clearing_started"

    Intraday clearing session has started

    event_type = 5

    message = "clearing_started"

    Main clearing session has started

    event_type = 6

    message = "extension_of_limits_finished"

    Limits have been extended

    event_type = 8

    message = "broker_recalc_finished"

    Funds have been recalculated after intraday clearing session

Stream FORTS_TNPENALTY_REPL - information about Transaction fees

Data scheme

Tables:

  • fee_all - Information on the number of points accrued
  • fee_tn - Detailed information on the number of incorrect transaction

Table fee_all: Information on the number of points accrued

Table 89. Fields of table fee_all

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
timei8Time
p2loginc64Login
sess_idi4Session number
pointsi4Number of points assessed for a second time from
feed16.2Incorrect transaction fee at the time of time


Table fee_tn: Detailed information on the number of incorrect transaction

Table 90. Fields of table fee_tn

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
timei8Time
p2loginc64Login
sess_idi4Session number
tn_typei4Transaction type
err_codei4Error code
counti4Number of invalid transactions


Stream MOEX_RATES_REPL - online currency rates

Data scheme

Tables:

Table curr_online: Currency values

Table 91. Fields of table curr_online

FieldTypeDescription
replIDi8Service field of the replication subsystem
replRevi8Service field of the replication subsystem
replActi8Service field of the replication subsystem
rate_idi4Payment currency identifier
valued16.5Current rate of payment
momenttTime calculation currency rate payment


Commands description

Method FutAddOrder - Add order

Message type: 64

Reply message type: 101

Table 92. Input parameters

NameTypeDefault valueDescription
isinc25 Instrument ID
client_codec3 Client code
typei4 Order type
diri4 Order direction
amounti4 Amount
pricec17 Price
commentc20""Order comment
broker_toc20""RTS code of the company to whom the direct order is addressed
ext_idi40External ID
dui40Sign of asset management order
date_expc8""Order's expiration date
hedgei40Sign of hedging order
dont_check_moneyi40Whether to calculate client risks for given order
match_refc10""Identical text values entered by both trade parties to match negotiated orders


Table 93. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
order_idi8 Order's ID


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'type' field may contain the following values:

    1

    quotation order (remains in queue after being partly matched)

    2

    counter-order (removed after auction end)

    3

    Fill-or-Kill order

  • The 'dir' field may contain the following values:

    1

    buy order

    2

    sell order

  • The 'price' field contains the order price as string: 'nnnnnnnnnn.mmmmm'.

  • The 'date_exp' field contains order expiration date as 'YYYYMMDD'. Empty string indicates a common order. If there is certain date set in the string, the order are automatically relisted in the next session with a new number and a new time, untill the date expires (multiday order). Orders with the expired date are removed automatically after the end of the evening session (if there is any on this day). When relisted, the orders are verified for instrument availability, client details and funds availability. Date may vary in the range from >= today to <= 1 year ahead.

  • The 'dont_check_money' order parameter may contain the following values:

    • 0 – verify collaterals for client section

    • 1 – do not verify collaterals for client section

    The parameter is eligible for using by a login with the sufficient rights. All other logins using this parameter will have their orders rejected.

Method FutAddMultiLegOrder - Add multileg order

Message type: 65

Reply message type: 129

Adds order on multileg instrument - calendar spread on futures

Table 94. Input parameters

NameTypeDefault valueDescription
sess_idi40Trading session ID
isin_idi4 Multileg instrument ID
client_codec3 Client code
typei4 Order type
diri4 Order direction
amounti4 Amount
pricec17 Price
rate_pricec17 Swap price
commentc20""Order comment
hedgei40Sign of hedging order
broker_toc20""RTS code of the company to whom the direct order is addressed
ext_idi40External ID
trusti40Sign of asset management order
date_expc8""Order's expiration date
trade_modei4 Order type
dont_check_moneyi40Whether to calculate client risks for given order
match_refc10""Identical text values entered by both trade parties to match negotiated orders


Table 95. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
order_idi8 Order's ID


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'type' field may contain the following values:

    1

    quotation order (remains in queue after being partly matched)

    2

    counter-order (removed after auction end)

    3

    Fill-or-Kill order

  • The 'dir' field may contain the following values:

    1

    buy order

    2

    sell order

  • The 'price' ield contains the order price as string: 'nnnnnnnnnn.mmmmm'.

  • The 'date_exp' field contains order expiration date as 'YYYYMMDD'.

  • The 'trade_mode' field may contain the following values:

    1

    Repo

    2

    Regular multileg order

  • The 'sess_id' field must contain the session number. If the field contains 0, then the order will be placed at the current session.

  • The'dont_check_money'parameter may contain the following values:

    • 0 – verify collaterals for client section

    • 1 – do not verify collaterals for client section

    The parameter is eligible for using by a login with the sufficient rights. All other logins using this parameter will have their orders rejected.

Method FutDelOrder - Cancel order

Message type: 37

Reply message type: 102

Table 96. Input parameters

NameTypeDefault valueDescription
order_idi8 Order ID to remove


Table 97. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
amounti4 Order's amount on deletion moment


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The return code = 14 (order is not found for removing) indicates that there is no such order in queue. Possible reasons: wrong order number, or the order has not been placed today. It does not make sence to continue sending removal requests for the same order number (may be useful for automatic systems).

Method FutDelUserOrders - Mass cancel order

Message type: 38

Reply message type: 103

Table 98. Input parameters

NameTypeDefault valueDescription
buy_selli4 Whether to cancel orders on their directions
non_systemi4 Whether to cancel orders on their non-system sign
codec3 Client code
code_vcbc25 Contract code
ext_idi40External ID
isinc25""Instrument ID


Table 99. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
num_ordersi4 Number of cancelled orders


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'buy_sell' parameter may contain the following values:

    1

    Buy orders

    2

    Sell orders

    3

    All orders

    4

    all orders out of limits (may be useful after intermrdiate clearing session)

  • The 'non_system' parameter may contain the following values:

    0

    Common orders

    1

    Non-system orders

    2

    All orders

  • If the 'code' parameter is not set or is ‘%%%’, then all orders for all clients' accounts are removed.

  • If the 'code_vcb' parameter is not set or is ‘%’, then all orders for all contracts are removed.

  • If the 'ext_id' parameter value is not 0, then all orders with the corresponding 'ext_id'are removed. All other parameters values are ignored (the values must fit the appropriate range).

  • This command cannot be used to remove orders for multi-leg instruments.

Method FutMoveOrder - Modify order

Message type: 39

Reply message type: 105

Table 100. Input parameters

NameTypeDefault valueDescription
regimei4 Mode
order_id1i8 ID of the 1st order to remove
amount1i40New amount for the 1st order
price1c17"0"New price for the 1st order
ext_id1i40New external ID for the 1st order
order_id2i80ID of the 2nd order to remove
amount2i40New amount for the 2nd order
price2c17"0"New price for the 2nd order
ext_id2i40New external ID for the 2nd order


Table 101. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
order_id1i8 New ID of the 1st modified order
order_id2i8 New ID of the 2nd modified order


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'regime' parameter defines the command work mode. It may contain the following values:

    0

    Do not change volumes of orders. The current volume of orders remains unchanged, the newly sent volumes are ignored.

    1

    Change volumes of orders. If there is any order found, it will be replaced with the new order with new price and volume.

    2

    Remove old orders. If any order volume does not coincide with the newly sent one, both orders are removed. Otherwise, the orders will be shifted.

    3

    Set orders volumes to that of received, excluding the matched part (not less than 0). If the volume received is less than the volume of the matched part, both orders will be removed.

  • All new orders will be auctioned.

  • Orders can be shifted only within the same trading instrument and only within the same client register.

  • Orders are not shifted by multy-legs.

  • Private orders are not shifted.

  • When shifting, the direction of order is not changed.

  • Once an order has been removed (or shifted, or fully matched), it is not relisted, and the error message appears.

  • If one order of a pair cannot be shifted, then another order is not shifted, too, and the error message appears.

  • If two orders with opposite directions are shifted in the way their prices coincide, then the parameters are considered as incorrect, shifting is not performed, and the error message appears.

  • If, when shifting a pair of orders, one order meets a cross-trade (matching an order sent from either the same VATIN or the same clien register), than it is rejected, and another order of the pair is shifted.

  • Upon moving orders, the 'date_exp' parameters are transferred into new orders.

  • After the command has been processed, the 'order_id1' field and 'order_id2' field are filled with new orders numbers. If no order has been placed, the corresponding field is set to 0.

Method OptAddOrder - Add order

Message type: 66

Reply message type: 109

Table 102. Input parameters

NameTypeDefault valueDescription
isinc25 Instrument ID
client_codec3 Client code
typei4 Order type
diri4 Order direction
amounti4 Amount
pricec17 Price
commentc20""Order comment
broker_toc20""RTS code of the company to whom the direct order is addressed
ext_idi40External ID
dui40Sign of asset management order
check_limiti40Flag of checking limits
date_expc8""Order's expiration date
hedgei40Sign of hedging order
dont_check_moneyi40Whether to calculate client risks for given order
match_refc10""Identical text values entered by both trade parties to match negotiated orders


Table 103. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
order_idi8 Order's ID


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'type' field may contain the following values:

    1

    Quotation order (remains in queue after being partly matched)

    2

    Counter-order (removed after auction end)

    3

    Fill-or-Kill order

  • The 'dir' field may contain the following values:

    1

    buy order

    2

    sell order

  • The 'price' field contains the order price as string: 'nnnnnnnnnn.mmmmm'.

  • The 'check_limit' field may contain the following values:

    0

    Do not verify limits

    1

    Verify limits

  • The 'date_exp' ield contains order expiration date as 'YYYYMMDD'. Empty string indicates a common order. If there is certain date set in the string, the order are automatically relisted in the next session with a new number and a new time, untill the date expires (multiday order). Orders with the expired date are removed automatically after the end of the evening session (if there is any on this day). When relisted, the orders are verified for instrument availability, client details and funds availability. Date may vary in the range from >= today to <= 1 year ahead.

  • The 'dont_check_money'order parameter may contain the following values:

    • 0 – verify collaterals for client section

    • 1 – do not verify collaterals for client section

    The parameter is eligible for using by a login with the sufficient rights. All other logins using this parameter will have their orders rejected.

Method OptDelOrder - Cancel order

Message type: 42

Reply message type: 110

Table 104. Input parameters

NameTypeDefault valueDescription
order_idi8 Order ID to remove


Table 105. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
amounti4 Order's amount on deletion moment


Return codes:

0

operation completed successfully

Any other value

error

Method OptDelUserOrders - Mass cancel order

Message type: 43

Reply message type: 111

Table 106. Input parameters

NameTypeDefault valueDescription
buy_selli4 Whether to cancel orders on their directions
non_systemi4 Whether to cancel orders on their non-system sign
codec3 Client code
code_vcbc25 Contract code
ext_idi40External ID
isinc25""Instrument ID


Table 107. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
num_ordersi4 Number of cancelled orders


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'buy_sell' parameter may contain the following values:

    1

    Buy orders

    2

    Sell orders

    3

    All orders

  • The 'non_system' parameter may contain the following values:

    0
    Common orders

    1

    Non-system orders

    2

    All orders

  • If the 'code' parameter is not set or is ‘%%%’, then all orders for all clients' accounts are removed.

  • If the 'code_vcb' parameter is not set or is ‘%’, then all orders for all contracts are removed.

  • If the 'ext_id' parameter value is not 0, then all orders with the corresponding 'ext_id'are removed. All other parameters values are ignored (the values must fit the appropriate range).

Method OptMoveOrder - Modify order

Message type: 44

Reply message type: 113

Table 108. Input parameters

NameTypeDefault valueDescription
regimei4 Mode
order_id1i8 ID of the 1st order to remove
amount1i40New amount for the 1st order
price1c17"0"New price for the 1st order
ext_id1i40New external ID for the 1st order
check_limiti40Flag of checking limits
order_id2i80ID of the 2nd order to remove
amount2i40New amount for the 2nd order
price2c17"0"New price for the 2nd order
ext_id2i40New external ID for the 2nd order


Table 109. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
order_id1i8 New ID of the 1st modified order
order_id2i8 New ID of the 2nd modified order


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'regime' parameter defines the command work mode. It may contain the following values:

    0

    Do not change volumes of orders. The current volume of orders remains unchanged, the newly sent volumes are ignored.

    1

    Change volumes of orders. If there is any order found, it will be replaced with the new order with new price and volume.

    2

    Remove old orders. If any order volume does not coincide with the newly sent one, both orders are removed. Otherwise, the orders will be shifted.

    3

    Set orders volumes to that of received, excluding the matched part (not less than 0). If the volume received is less than the volume of the matched part, both orders will be removed.

  • The 'check_limit' may contain the following values:

    0

    Do not verify limits

    1

    Verify limits

  • All new orders will be auctioned.

  • Orders can be shifted only within the same trading instrument and only within the same client register.

  • Orders are not shifted by multy-legs.

  • Private orders are not shifted.

  • When shifting, the direction of order is not changed.

  • Once an order has been removed (or shifted, or fully matched), it is not relisted, and the error message appears.

  • If one order of a pair cannot be shifted, then another order is not shifted, too, and the error message appears.

  • If two orders with opposite directions are shifted in the way their prices coincide, then the parameters are considered as incorrect, shifting is not performed, and the error message appears.

  • If, when shifting a pair of orders, one order meets a cross-trade (matching an order sent from either the same VATIN or the same clien register), than it is rejected, and another order of the pair is shifted.

  • Upon moving orders, the 'date_exp' parameters are transferred into new orders.

  • After the command has been processed, the 'order_id1' and 'order_id2' field are filled with new orders numbers. If no order has been placed, the corresponding field is set to 0.

Method FutChangeClientMoney - Modify client limits and risk parameters

Message type: 63

Reply message type: 104

The command allows to change funds limits for a client's account.

Table 110. Input parameters

NameTypeDefault valueDescription
modei4 Mode
codec3 Client code
limit_moneyc17"0"Funds limit
limit_pledgec17"0"Collateral limit
coeff_liquidityc17"0"Liquidity ratio for futures
coeff_goc17"1"Client’s collateral ratio
is_auto_update_limiti4-1Flag of automatic adjustment of the limit by the amount of income after clearing
is_auto_update_spot_limiti4-1Flag of automatic adjustment of limits for RTS standard instruments (buy and sell) when downloading after clearing
limit_spot_buyc17"-1"Limit for buying RTS standard instruments
no_fut_discounti40Flag of prohibition to provide discounts for futures
check_limiti40Flag for allowing or prohibition of limit checks
num_clr_2deliveryi40Number of clearing sessions (including intraday clearing sessions) to turn on automatic exercise scenario of risk calculation for the non-quarterly series of options with the closest expiration date for this account


Table 111. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • Command work mode (the 'mode' field):

    9

    Remove limit for roubles

    10

    Remove limit for collaterals

    11

    Remove limits for roubles, collaterals and spots

    12

    Set limits for roubles, collaterals and spots

    13

    Change limits for funds and collaterals

  • coeff_go – an additional coefficient the total client collaterals are multiplied by upon placing an order. Upon verification for funds sufficiency, this coefficient is also included in calculation.

  • The is_auto_update_limit flag, being set to '1', allows to automatize the limit changing process in accordance with the previous day results. Also, '-1' value must be set for operations in the '12' and '13' modes. If there have been any change made to other parameters, the 'is_auto_update_limit' parameter must remain unchanged.

  • For changing only the coeff_liquidity and/or coeff_go and/or is_auto_update_limit and/or is_auto_update_spot_limit the mode '13' must be used. The 'limit_money' parameter must be set to '0'.

  • The is_auto_update_spot_limit flag, being set to '1', allows to automatize the limit changing process for buy or sell spots trades in accordance with the previous day results. Therefore, the calculated limit will be applied for all the period of the instrument lifetime. The '-1 value' should be set for operations in the '12' and '13' modes. If there have been any change made to other parameters, the 'is_auto_update_spot_limit' parameter must remain unchanged.

  • The limit_spot_buy parameter format is '16.2', set in roubles.

  • In the no_fut_discount parameter the following values can be set:

    0

    Use collaterals discount for futures

    1

    Do not use collaterals discount for futures

  • The following values are set in the check_limit parameter:

    0

    Do not verify. Change limit unconditionally.

    1

    After changing limit, verify whether debts have been increased or not

  • The num_clr_2delivery parameter allows to specify a number of clearing sessions before option expiration to activate additional risk calculation. The additional risk calculation will be applied only for option positions and option orders belonging to particular series of options. Such options have '1' in the field 'allow_use_extra_exp_risk' of the table 'virt_futures_params' table of the stream 'INFO'.

  • For the field type 'c17', it is possible to specify empty string in order to prevent changing the parameter (limits, collaterals, etc.) value, which had been sent into the trading system before.

  • For the field type 'i4', it is possible to specify '-1' in order to prevent changing the parameter value, which had been sent into the trading system before.

Method FutChangeClientVcb - Modify client's parameters for an underlying asset

Message type: 33

Reply message type: 106

The command allows to change client parameters for underlying assets.

Table 112. Input parameters

NameTypeDefault valueDescription
modei4 Mode
codec3 Client code
code_vcbc25 Code of the underlying asset
coeff_goc17"1"Ratio of the client’s collateral on the underlying asset
limit_spotc10"-1"Client’s limit for short positions in RTS standard instruments on the underlying asset


Table 113. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • Themode field specifies the command work mode:

    11

    remove limit

    12

    set limit

  • coeff_go – an additional coefficient the total client collaterals are multiplied by upon placing an order. Upon verification for funds sufficiency, this coefficient is also included in calculation.

  • limit_spot if no client limit is necessary and'mode'cannot be set as '=11' as the string is reserved, then the parameter should be set as '-1'. The variable internal type is 'int'.

Method FutChangeBrokerVcb - Modify brokerage company’s parameters for an underlying asset

Message type: 14

Reply message type: 114

The command allows to change underlying assets parameters for brokerage firm.

Table 114. Input parameters

NameTypeDefault valueDescription
modei4 Mode
code_vcbc25 Code of the underlying asset
limit_spotc10"-1"Brokerage company’s limit for short positions in RTS standard instruments on the underlying asset


Table 115. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • 'mode'field specifies the command work mode

    11

    remove limit

    12

    set limit

  • limit_spot if no client limit is necessary and'mode'cannot be set as '=11' as the string is reserved, then the parameter should be set as '-1'. The variable internal type is 'int'.

Method FutChangeBFMoney - Change brokerage firm limits

Message type: 7

Reply message type: 107

The command allows to change amounts of money in your brokerage firms' accounts. Once the account size increases, the required amount of money is transferred from the clearing firm's account. When you decrease the account size, the required amount of money is deposited back to the clearing firm's account.

Table 116. Input parameters

NameTypeDefault valueDescription
modei4 Mode
codec2 Brokerage firm code
limit_moneyc17"0"Funds limit
limit_pledgec17"0"Collateral limit


Table 117. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • Comand work mode (the 'mode'field):

    12

    Set limits equal tolimit_money andlimit_pledge

    13

    Change limitslimit_money andlimit_pledge

  • To get access to the procedure, a clearing firm's login must obtain the sufficient rights from the Trade administrator.

Method FutChangeMoney - Modify limits for buying RTS standard instruments on underlying assets

Message type: 16

Reply message type: 116

The command allows to change the funds parameters for a BF.

Table 118. Input parameters

NameTypeDefault valueDescription
modei4 Mode
limit_spot_buyc17"-1"Funds limit
is_auto_update_spot_limiti4-1Flag of automatic adjustment of limits for RTS standard instruments (buy and sell) when downloading after clearing
statei4-1Not used


Table 119. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • Command work mode (the 'mode' field):

    11

    Remove

    12

    Set

  • To get access to the procedure, a clearing firm's login must obtain the sufficient rights from the Trade administrator.

  • Funds limit (the 'limit_spot_buy' field). If set to '-1', then no verification will be made for the specified limit. If set to '-2', then the limit is not a subject to change. If not set, then the default value is '-1'.

  • The 'is_auto_update_spot_limit' field, being set to '1', allows to automatize the limit changing process in accordance with the previous day results. Also, '-1' value must be set for operations in the '12' mode. If there have been any change made to other parameters, the parameter must remain unchanged.

  • To change only the 'is_auto_update_spot_limit' parameter you can set the parameter value in the '12' mode. The 'limit_spot_buy' parameter value must be =''.

Method OptChangeExpiration - Add order for expiration of options

Message type: 12

Reply message type: 112

Table 120. Input parameters

NameTypeDefault valueDescription
modei4 Mode
order_idi4 ID of the order for expiration
codec3 Client code
isinc25 Instrument ID
amounti40Volume of expiration


Table 121. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text
order_idi4 Unique order ID


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • Command work mode (the 'mode' field):

    11

    Remove

    12

    Paste/Refresh

  • The key fields for expiration orders are:'isin' and'code'.

  • When executing 'Delete' or 'Update', it is allowed to set:

    • rather 'order_id' (in this case, code and isin are not used for searching)
    • or code and isin (only iforder_id is not set or equal to 0)

  • Upon placing a new order, setorder_id=0. This will show the necessity for placing a new order instead of editing the previously placed one.

Method FutChangeClientProhibit - Modify client's restrictions for futures

Message type: 15

Reply message type: 115

Table 122. Input parameters

NameTypeDefault valueDescription
modei4 Mode
codec3 Code of the client’s account or '%%%' – for all
code_vcbc25 Code of the underlying asset or '%' - for all
isinc25 Futures or '%' - for all
statei40Restriction
state_maski43Mask for parameter 'state'


Table 123. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • The 'mode'field specifies the command work mode:

    11

    remove

    12

    set

  • The 'state' field may contain the following values:

    1

    prohibited to open positions

    2

    prohibited to place any order

    3

    prohibited to open sell positions

  • The 'state_mask' parameter values are defined by the bit mask. At the moment, the parameter value must be '3'.

  • When setting a certain instrument in the 'isin' field, the code of the corresponding underlying asset must be set in the 'code_vcb' field.

Method OptChangeClientProhibit - Modify client's restrictions for options

Message type: 17

Reply message type: 117

Table 124. Input parameters

NameTypeDefault valueDescription
modei4 Mode
codec3 Code of the client’s account or '%%%' – for all
code_vcbc25 Code of the underlying asset or '%' - for all
isinc25 Futures or '%' - for all
statei40Restriction
state_maski48Mask for parameter 'state'


Table 125. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • Command work mode (the 'mode'field):

    11

    remove

    12

    set

  • The 'state' field is a bit mask

    • The first two bits define the numerical value:

      1

      prohibited to open positions

      2

      prohibited to place any order

      3

      prohibited to open sell positions

    • 4 – reserved

    • 8 – broker's prohibition for placing expiration orders

  • Status bit mask. Defines the bits of the 'state' field which values are to be changed upon the command execution. At the moment, the parameter value must be '0x0F'.

  • Limits for futures and options are applied independently.

Method FutExchangeBFMoney - Tranfer funds within brokerage firm

Message type: 35

Reply message type: 130

The command allows to transfer funds between two BF belonging to the same CF.

Table 126. Input parameters

NameTypeDefault valueDescription
modei4 Mode
code_fromc2 Source account code
code_toc2 Destination account code
amount_moneyc17 Amount of collateral to transfer in roubles
amount_pledgec17 Amount of collateral to transfer in securities/currency


Table 127. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

  • Command work mode (the'mode' field):

    1

    Transfer only at trading

    3

    Transfer at trading and clearing

  • At the moment, the system supports only funds transfer. Collaterals transfer is not yet supported, therefore, the 'amount_pledge' field must contain 0.

Method OptRecalcCS - Recalculate central strike request

Message type: 45

Reply message type: 132

The command allows to recalculate the central strike in accordance with the market-maker's obligations (for which the "Offset by demand" recalculation option is selected). Developed for market-makers.

Table 128. Input parameters

NameTypeDefault valueDescription
isin_idi4 Base instrument ID


Table 129. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Method FutTransferClientPosition - Transfer futures client position

Message type: 61

Reply message type: 137

The command allows to transfer futures positions between your brokerage firms' accounts.

Table 130. Input parameters

NameTypeDefault valueDescription
code_fromc7 Donor code
code_toc7 Recipient code
isinc25 Instrument ID
amounti4 Amount of position to transfer


Table 131. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

To get access to the procedure, a clearing firm's login must obtain the sufficient rights from the Trading administrator.

Method OptTransferClientPosition - Transfer options client position

Message type: 62

Reply message type: 138

The command allows to transfer options positions between your brokerage firms' accounts.

Table 132. Input parameters

NameTypeDefault valueDescription
code_fromc7 Donor code
code_toc7 Recipient code
isinc25 Instrument ID
amounti4 Amount of position to transfer


Table 133. Execution result

NameTypeDefault valueDescription
codei4 Return code
messagec255 Message text


Return codes:

0

operation completed successfully

Any other value

error

Notes:

To get access to the procedure, a clearing firm's login must obtain the sufficient rights from the Trade administrator.

Method CODHeartbeat - Heartbeat message for Cancel on Disconnect Service

Message type: 10000

The heartbeat message informs the client connection monitoring service that this client login is active.

Table 134. Input parameters

NameTypeDefault valueDescription
seq_numberi40Sequence number of heartbeat (currently not used)


A client of COD (Cancel on Disconnect) service is should send heartbeat messages to the trading system not less than once per 10 second. If the user stays inactive (sends no messages to the trading system) within 20 seconds, all their orders will be automatically cancelled.

Note:

Only the COD service clients are obliged to send heartbeat messages.

The monitoring service does not send any replies on heartbeat messages. Please set flag value to '0' (no reply expected) when calling the heartbeat message sending function (cg_pub_post(pub, msgptr, 0).

Calling function 'cg_pub_post' with flag 'CG_PUB_NEEDREPLY' for sending heartbeat messages will cause a notification error 'СG_MSG_P2MQ_TIMEOUT'.

A. Plaza-2 data types

Plaza-2C++ODBCDetails
u1UINT8SMALLINTInteger, size: 1 byte
u2UINT16INTEGERInteger, size: 2 bytes
u4UINT32NUMERIC,10Integer, size: 4 bytes
u8UINT64NUMERIC,20Integer, size: 8 bytes
i1INT8SMALLINTInteger with sign, size: 1 byte
i2INT16SMALLINTInteger with sign, size: 2 bytes
i4INT32INTEGERInteger with sign, size: 4 bytes
i8INT64BIGINTInteger, size: 8 bytes
aCHARVARCHARSymbol string, size: 1 byte.
cNCHAR[N+1]VARCHAR,NSymbol string, ended with zero.
dN,M sN,MP2BCDIINUMERIC,N,MFixed-point decimal number coded in bynary system, where:
  • N is the whole quantity of digits

  • M is quantity of digits in the fractional part

tP2TIMETIMESTAMPDate and time.
fDOUBLEREALDouble-precision number with flowing point, size: 8 bytes.
bN VARBINARY,NData unit.
zN VARBINARY,NData unit., where the buffer lenght is set by the first 4 bytes.

B. List of return codes

Return codeDescription
-1Error performing operation.
0Operation successful.
1User not found.
2Brokerage Firm code not found.
3Session inactive.
4Session halted.
5Error performing operation.
6Insufficient rights to perform operation.
7Wrong account. Cannot perform operation.
8Insufficient rights to perform order deletion.
9Operations with orders are blocked for the firm by the Clearing Centre.
10Insufficient funds to reserve.
12Options premium exceeds the limit allowed.
13Total amount of positions exceeds the market limit.
14Order not found.
25Unable to add order: prohibited by the Trading Administrator.
26Unable to open position: prohibited by Trading Administrator.
27Unable to open short position: prohibited by Trading Administrator.
28Unable to perform operation: insufficient rights.
31Matching order for the same account/ITN is not allowed.
32Trade price exceeds the limit allowed.
33Operations with orders are blocked for this firm by the Clearing Administrator.
34Cannot perform operation: wrong client code.
35Invalid input parameters.
36Cannot perform operation: wrong underlying.
37Multi-leg orders cannot be moved.
38Negotiated orders cannot be moved.
39Price is not a multiple of the tick size.
40Unable to add Negotiated order: counterparty not found.
41User's trading rights have expired or are not valid yet.
42Operations are prohibited by Chief Trader of Clearing Firm.
44Clearing Firm's Chief Trader flag not found for this firm.
45Unable to add Negotiated orders: no RTS code found for this firm.
46Only Negotiated orders are allowed for this security.
47There was no trading in this security during the session specified.
48This security is being delivered. Only Negotiated orders from all Brokerage Firms within the same Clearing Firm are allowed.
49Unable to add Negotiated order: a firm code must be specified.
50Order not found.
53Error setting input parameter: amount too large.
54Unable to perform operation: exceeded operations quota for this client.
56Unable to perform operations using this login/code pair: insufficient rights. Please contact the Trading Administrator.
57Unable to connect to the Exchange server: insufficient rights. Please contact the Trading Administrator.
58Unable to add orders without verifying client funds sufficiency: insufficient rights.
60Auction halted for all risk-netting instruments.
61Trading halted in all risk-netting instruments.
62Trading halted on the MOEX Derivatives Market.
63Auction halted in all risk-netting instruments with this underlying.
64Trading halted in all risk-netting instruments with this underlying.
65Trading halted on all boards in all securities with this underlying.
66Trading halted in this risk-netting instrument.
67Unable to open positions in this risk-netting instrument: prohibited by the Trading Administrator.
68Unable to add orders for all risk-netting instruments: prohibited by the Brokerage Firm.
69Unable to add orders for all risk-netting instruments: prohibited by the Chief Trader.
70Trading operation is not supported.
71Position size exceeds the allowable limit.
72Order is being moved.
73Aggregated buy order quantity exceeds the allowable limit.
74Aggregated sell order quantity exceeds the allowable limit.
200Collateral calculation parameters are being changed by the Trading Administrator.
201Collateral calculation parameters are being changed by the Trading Administrator.
202Collateral calculation parameters are being changed by the Trading Administrator.
203Collateral calculation parameters are being changed by the Trading Administrator.
204Collateral calculation parameters are being changed by the Trading Administrator.
205Collateral calculation parameters are being changed by the Trading Administrator.
206Collateral calculation parameters are being changed by the Trading Administrator.
207Collateral calculation parameters are being changed by the Trading Administrator.
208Collateral calculation parameters are being changed by the Trading Administrator.
310Unable to add order: prohibited by Clearing Administrator.
311Unable to open position: prohibited by Clearing Administrator.
312Unable to open short position: prohibited by Clearing Administrator.
314Unable to add orders in the client account: prohibited by the Trader.
315Unable to open position in the client account: prohibited by the Trader.
316Unable to open short position in the client account: prohibited by the Trader.
317Amount of buy/sell orders exceeds the limit allowed.
318Unable to add order for the client account: client does not have a deposit account for settlement of Money Market securities. Prohibited by Clearing Administrator.
320Amount of active orders exceeds the limit allowed for the client account for this security.
332Insufficient client funds.
333Insufficient Brokerage Firm funds.
334Insufficient Clearing Firm funds.
335Unable to buy: amount of securities exceeds the limit set for the client.
336Unable to buy: amount of securities exceeds the limit set for the Brokerage Firm.
337Unable to sell: amount of securities exceeds the limit set for the client.
338Unable to sell: amount of securities exceeds the limit set for the Brokerage Firm.
380Trading restricted while intraday clearing is in progress.
381Trading restricted while intraday clearing is in progress: cannot delete orders.
382Trading restricted while intraday clearing is in progress: cannot move orders.
680Insufficient client funds.
681Insufficient Clearing Firm funds.
4000Invalid input parameters.
4001Unable to perform operation: insufficient rights.
4002Unable to change trading limit for the client: no active trading sessions.
4004Unable to change trading limit for the client: client code not found.
4005Unable to change the trading limit for the client: insufficient funds.
4006Unable to set trading limit for the client: error performing operation.
4007Unable to set trading limit for the client: error performing operation.
4008Unable to set trading limit for the client: error performing operation.
4009Unable to set trading limit for the client: error performing operation.
4010Unable to set trading limit for the client: error performing operation.
4011Unable to set trading limit for the client: error performing operation.
4012Unable to set trading limit for the client: error performing operation.
4013Unable to set trading limit for the client: error performing operation.
4014Unable to change parameters: no active trading sessions.
4015Unable to change parameters: client code not found.
4016Unable to change parameters: underlying's code not found.
4017Unable to set trading limit for the client: amount too large.
4018Collateral calculation parameters are being changed by the Trading Administrator.
4021Unable to set requested amount of pledged funds for Clearing Firm: insufficient amount of free funds.
4022Unable to set requested amount of funds for Clearing Firm: insufficient amount of free funds.
4023Unable to change trading limit for the Brokerage Firm: no active trading sessions.
4024Unable to change trading limit for the Brokerage Firm: the Brokerage Firm is not registered for trading.
4025Unable to set requested amount of pledged funds for the Brokerage Firm: insufficient amount of free funds in the Clearing Firm.
4026Unable to set requested amount of funds for the Brokerage Firm: insufficient amount of free funds in the balance of the Separate Account.
4027Unable to set requested amount of pledged funds for the Clearing Firm: insufficient amount of pledged funds in the balance of the Separate Account.
4028Unable to set requested amount of funds for the Brokerage Firm: insufficient amount of free funds in the Clearing Firm.
4030Unable to change parameters for the Brokerage Firm: no active sessions.
4031Unable to change parameters for the Brokerage Firm: Brokerage Firm code not found.
4032Unable to change parameters for the Brokerage Firm: underlying's code not found.
4033Unable to change parameters for the Brokerage Firm: insufficient rights to trade this underlying.
4034Transfer of pledged funds from the Separate account is prohibited.
4035Transfer of collateral is prohibited.
4040Unable to change Brokerage Firm limit on risk-netting: no active sessions.
4041Unable to change Brokerage Firm limit on risk-netting: Brokerage Firm is not registered for trading.
4042Unable to change Brokerage Firm limit on risk-netting: Brokerage Firm code not found.
4043Unable to change Brokerage Firm limit on risk-netting: error performing operation.
4044Unable to change Brokerage Firm limit on risk-netting: error performing operation.
4045Unable to delete Brokerage Firm limit on risk-netting: error performing operation.
4046Unable to remove Chief Trader's restriction on trading in risk-netting instruments: insufficient rights.
4050Unable to process the exercise request: restricted by the Chief Trader.
4051Unable to process the exercise request: restricted by the Brokerage Firm.
4052Unable to process the exercise request: wrong client code and/or security.
4053Unable to process the exercise request: cannot delete orders during the intraday clearing session.
4054Unable to process the exercise request: cannot change orders during the intraday clearing session.
4055Unable to process the exercise request: order number not found.
4060Unable to process the exercise request: insufficient rights.
4061Unable to process the exercise request: deadline for submitting requests has passed.
4062Unable to process the exercise request: client code not found.
4063Unable to process the exercise request: request not found.
4064Unable to process the exercise request: insufficient rights.
4065Unable to process the exercise request: option contract not found.
4066Unable to process the exercise request: request to disable automatic exercise may only be submitted on the option's expiration date.
4067Unable to process the exercise request: error performing operation.
4068Unable to process the exercise request: error performing operation.
4069Unable to process the exercise request: error performing operation.
4070Unable to process the exercise request: insufficient amount of positions in the client account.
4090No active sessions.
4091Client code not found.
4092Underlying's code not found.
4093Futures contract not found.
4094Futures contract does not match the selected underlying.
4095Partial selection of futures contracts not accepted: underlying flag set 'For all'.
4096Unable to remove limit: no limit set.
4097Unable to remove: the Chief Trader's restriction cannot be removed by Brokerage Firm trader.
4098Security not found in the current trading session.
4099Both securities must have the same underlying.
4100Exercise date of the near leg of a multi-leg order must not be later than that of the far leg.
4101Unable to make a multi-leg order: lots are different.
4102No position to move.
4103The FOK order has not been fully matched.
4104Anonymous repo order must contain a repo type.
4105Order containing a repo type is restricted in this multi-leg order.
4106Multi-leg orders can be added only on the Money Market.
4107This procedure is not eligible for adding orders for multi-leg securities.
4108Unable to trade risk-netting instruments in T0: insufficient rights.
4109Rate/swap price is not a multiple of the tick size.
4110The near leg price differs from the settlement price.
4111The rate/swap price exceeds the limit allowed.
4112Unable to set restrictions for multi-leg futures.
4115Unable to transfer funds between Brokerage Firm accounts: no active sessions.
4116Unable to transfer funds between Brokerage Firm accounts: the donor Brokerage Firm is not registered for trading.
4117Unable to transfer funds between Brokerage Firms: the receiving Brokerage Firm is not registered for trading.
4118Broker Firm does not have sufficient amount of free funds.
4119Brokerage Firm does not have sufficient amount of collateral.
4120Insufficient amount of free funds in the balance of the Separate account.
4121Insufficient amount of collateral in the balance of the Separate Account.
4122Clearing Firm does not have sufficient amount of free funds.
4123Brokerage Firm does not have sufficient amount of collateral.
4124Brokerage Firm code not found.
4125Unable to transfer funds between accounts of different Clearing Firms.
4126Unable to transfer: error while transferring.
4128Brokerage firm does not have sufficient amount of free funds.
4129Insufficient amount of free funds in the balance of the Separate Account.
4130Clearing Firm does not have sufficient amount of free funds.
4131Brokerage Firm code not found.
4132Unable to withdraw: error in withdrawal logic.
4133No requests to cancel.
4134Brokerage Firm does not have sufficient amount of funds.
4135Clearing firm does not have sufficient amount of funds.
4136Prohibited to transfer pledged funds.
4137Brokerage Firm does not have sufficient amount of pledged funds.
4140Unable to transfer: position not found.
4141Unable to transfer: insufficient number of open positions.
4142Cannot transfer positions from the client account to an account with a different ITN.
4143Unable to transfer position: the Brokerage Firms specified belong to different Clearing Firms.
4144Cannot transfer positions to 'XXYY000' Brokerage Firm account.
4145Unable to transfer positions for the selected Brokerage Firm: restricted by the Trading Administrator.
4146Transferring positions in the selected securities is prohibited.
4147Option contract not found.
10579Price of the selected financial instrument is below acceptable value.
10580Price of the selected financial instrument is above acceptable value.