Table of Contents
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.
Trading participants are:
Clearing firms
Brokerage firms
Clearing firms and brokerage firms' clients
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.
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.
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.
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.
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.
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.
The SPECTRA instruments are structured hierarchically. Below you will find descriptions of the SPECTRA instruments starting from the root level.
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 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.
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:
'FORTS_OPTINFO_REPL' stream, 'opt_sess_contents' table. This is the main table, which contains a list of contracts available on the current trade session.
'FORTS_INFO_REPL' stream, 'options_params' table. This table contains data about option contracts. According to the data format the table can be loaded by the ClientGo client application.
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.
The SPECTRA system has four fields to identify each instrument:
'isin_id' field, which contains the unique numeral code for each instrument.
'isin' field, which contains the instrument's symbol code.
'short_isin' field, which contains short symbol code for using in order books etc.
'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.
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.
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.
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.
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).
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.
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.
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.
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'.
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 type | Position closing trade | Position opening trade | Date and time of trades availability in reports and in the gateway |
---|---|---|---|
Classical execution of futures |
| No. | On the execution day, in the morning. |
Execution of non-deliverable futures |
| No. | On the execution day, in the evening. |
Exercising of option |
|
|
Depending on time of applying the option (the next clearing session after applyinh). |
Expiration of option |
| No. | On the futures execution day, in the evening. |
Trades are shown as following:
Operation type | Operations info |
---|---|
Stock futures trade based on a private order |
|
Stock futures trade based on a system order |
|
Stock futures option trade based on a private order |
|
Stock futures option trade based on a system order |
|
Position transfer trade |
|
Technical trade based on repo private order (1st part) |
|
Technical trade based on repo private order (2nd part) |
|
Technical trade based on repo system order (1st part) |
|
Technical trade based on repo system order (2nd part) |
|
Technical trade based on the private pseudo-repo (1st part) |
|
Technical trade based on the private pseudo-repo (2nd part) |
|
Technical trade based on the system pseudo-repo (1st part) |
|
Technical trade based on the system pseudo-repo (2nd part) |
|
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).
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.
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.
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.
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).
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.
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.
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:
'FORTS_FUTCOMMON_REPL' and 'FORTS_OPTCOMMON_REPL' — general market data.
'FORTS_VOLAT_REPL' — the current volatility values.
'FORTS_VM_REPL' — the current variating margin value
The following streams are not subjects to reopen:
'FORTS_FUTINFO_REPL' and 'FORTS_OPTINFO_REPL' — reference data
'FORTS_FUTTRADE_REPL' and 'FORTS_OPTTRADE_REPL' — trading data
'FORTS_FUTORDERBOOK_REPL' and 'FORTS_OPTORDERBOOK_REPL' — snapshots of order books
Streams with aggregated order books.
'RTS_INDEX_REPL' — exchange indices
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:
Field | Type | Description |
---|---|---|
replID | i8 | Replication subsystem service field |
replRev | i8 | Replication subsystem service field |
replAct | i8 | Replication subsystem service field |
event_id | i8 | Unique event ID |
sess_id | i4 | Trading session ID |
event_type | i4 | Event type |
message | c64 | Text 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.
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.
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 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 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).
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.
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.
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).
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.
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.
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.
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.
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:
Click the 'Next' button to continue with installation:
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:
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:
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:
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:
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.
Click 'Install' to begin installation.
Click 'Finish' to finish the installation.
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:
Execute the command:
chmod 755 ./install.sh
Execute the command:
./install.sh ./cgate-1.3.9.8.x86_64.tar.gz
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.
When you receive 'Please, enter cgate install path', specify the full path to the folder to decompress the cgate software.
When you receive 'Please, enter P2 login', specify the user's login.
When you receive 'Please, enter P2 password', specify the user's password.
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).
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:
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).
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.
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.
Example 'send'
'send' is used to add order into the SPECTRA and write incoming replies into the trading system log. No input parameters required.
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).
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.
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).
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!
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.
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.
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
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 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:
For futures and REPO instruments streams are 'FORTS_FUTAGGR5_REPL', 'FORTS_FUTAGGR20_REPL' and 'FORTS_FUTAGGR50_REPL'
For options streams are 'FORTS_OPTAGGR5_REPL', 'FORTS_OPTAGGR20_REPL' and 'FORTS_OPTAGGR50_REPL'
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.
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.
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, 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
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.
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.
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.
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.
Field | Type | Description |
---|---|---|
code | i4 | Return code |
message | c255 | Message body |
Please note that the 'system error' message can be received in reply to any business-logic command.
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:
Field | Type | Description |
---|---|---|
queue_size | i4 | Number of messages for a single user |
penalty_remain | i4 | Time in milliseconds after which the next message from this user will be successfully received. |
message | c128 | Error text message |
Please pay attention to the two details:
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.
A reject message with 99 type can be sent in a reply to any user's message.
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!
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:
Field | Type | Details |
---|---|---|
seq_number | i4 | Heartbeat-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'.
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)
In order to obtain stability, the trading system uses load balancing method to connect clients to the least loaded server at the moment.
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.
The way an application acts is depending on the application program interface it uses.
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.
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 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.
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) name | Information type | Recovery method |
---|---|---|
FORTS_FUTTRADE_REPL
FORTS_OPTTRADE_REPL
| Own orders activity log (futures and options) | List of active orders:
Orders activity log:
|
FORTS_FUTTRADE_REPL
| Own orders activity log (multileg orders) | Orders activity log:
|
FORTS_ORDLOG_REPL
| Complete anonymous orders activity log (futures and options) | List of active orders:
Orders activity log:
|
FORTS_ ORDLOG _REPL
| Complete anonymous orders activity log (multileg orders) | Orders activity log:
|
FORTS_DEALS_REPL
FORTS_FUTTRADE_REPL
FORTS_OPTTRADE_REPL
| 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 information | Quick method:
Allowable method:
|
FORTS_PART_REPL | Information on limits | Reopen the stream anew |
FORTS_POS_REPL | Information on positions | Reopen the stream anew |
FORTS_VM_REPL | Information on variation margin | Reopen the stream anew |
FORTS_VOLAT_REPL | Information on volatility and theoretical prices on options | Reopen the stream anew |
RTS_INDEX_REPL | Exchange indices values | Reopen the stream anew |
RTS_INDEXLOG_REPL | Exchange indices values history | Reopen the stream using the last received revision number or 'repl state' value received on closing the stream. |
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:
List of orders which are active during the recovery procedure period
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.
The recovering procedure described above can be also used for the late start connection.
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.
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.
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.
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.
This stream contains tables from the log of changes to your orders and trades.
Table user_deal contains only own deals. This table may be useful for late join.
Tables:
Table 1. Fields of table orders_log
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
id_deal | i8 | Deal ID for this operation |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
price | d16.5 | Price |
moment | t | Order update time |
dir | i1 | Direction |
action | i1 | Operation with the order |
deal_price | d16.5 | Price of the deal |
client_code | c7 | Client code |
login_from | c20 | Login of the user who has entered the order |
comment | c20 | Trader's comment |
hedge | i1 | Attribute of a hedging order |
trust | i1 | Attribute of an order from an asset management company |
ext_id | i4 | External ID number. It is added to orders, trades |
broker_to | c7 | FORTS code of the company to whom the direct order is addressed |
broker_to_rts | c7 | RTS code of the company to whom the direct order is addressed |
broker_from_rts | c7 | RTS code of the company who has entered the order |
date_exp | t | Order's expiration date |
id_ord1 | i8 | ID number of the first order |
local_stamp | t | User's local time |
Notes:
Field status is a bit mask
Quote
Couter
Non-system
Client’s collateral was not checked while adding order
End-of-transaction bit
Fill-or-kill
The record is a result of moving the order
The record is a result of cancelling the order
The record is a result of cancelling the group of orders
Sign of cancelling the left balance of the order because of the cross-trade
Field action describes an action with the order
Order cancelled
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Table 2. Fields of table multileg_orders_log
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
isin_id | i4 | Multileg instrument ID |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
id_deal | i8 | Deal ID for this operation |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
price | d16.5 | Price |
moment | t | Order update time |
dir | i1 | Direction |
action | i1 | Operation with the order |
deal_price | d16.5 | Price of the deal |
rate_price | d16.5 | Rate price |
swap_price | d16.5 | Swap price |
client_code | c7 | Client code |
login_from | c20 | Login of the user who has entered the order |
comment | c20 | Trader's comment |
hedge | i1 | Attribute of a hedging order |
trust | i1 | Attribute of an order from an asset management company |
ext_id | i4 | External ID number. It is added to orders, trades |
broker_to | c7 | FORTS code of the company to whom the direct order is addressed |
broker_to_rts | c7 | RTS code of the company to whom the direct order is addressed |
broker_from_rts | c7 | RTS code of the company who has entered the order |
date_exp | t | Order's expiration date |
id_ord1 | i8 | ID number of the first order |
local_stamp | t | User's local time |
Notes:
Field status is a bit mask
Quote
Couter
Non-system
End-of-transaction bit
REPO Order with Clearing Center
REPO Order
Regular multileg order
Field action describes action with order
Order cancelled
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Table 3. Fields of table deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
id_deal | i8 | Deal ID number |
id_deal_multileg | i8 | Deal ID number for multileg deals |
id_repo | i8 | ID number of the other leg of a repo trade |
pos | i4 | Number of positions in the instrument in the market after the trade |
amount | i4 | Volume, number of units of the instrument |
id_ord_buy | i8 | ID number of the buyer's order |
id_ord_sell | i8 | ID number of the seller's order |
price | d16.5 | Price |
moment | t | Time when the deal was made |
nosystem | i1 | Sign of non-system deal |
xstatus_buy | i8 | Extended status of the trade from the buyer's side |
xstatus_sell | i8 | Extended status of the trade from the seller's side |
status_buy | i4 | Status of the trade from the buyer's side |
status_sell | i4 | Status of the trade from the seller's side |
ext_id_buy | i4 | External ID number from the buyer's order |
ext_id_sell | i4 | External ID number from the seller's order |
code_buy | c7 | Buyer's code |
code_sell | c7 | Seller's code |
comment_buy | c20 | Comment from the buyer's order |
comment_sell | c20 | Comment from the seller's order |
trust_buy | i1 | Sign of an asset management company's order from the buyer's order |
trust_sell | i1 | Sign of an asset management company's order from the seller's order |
hedge_buy | i1 | Sign of a hedging deal from the buyers's side |
hedge_sell | i1 | Sign of a hedging deal from the seller's side |
fee_buy | d26.2 | Fee of the buyer's deal |
fee_sell | d26.2 | Fee of the seller's deal |
login_buy | c20 | Login of the buyer user |
login_sell | c20 | Login of the seller user |
code_rts_buy | c7 | RTS code of the buyer company |
code_rts_sell | c7 | RTS 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 4. Fields of table multileg_deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Multileg instrument ID |
isin_id_rd | i4 | Repo direct instrument ID |
isin_id_rb | i4 | Repo back instrument ID |
isin_id_repo | i4 | Repo instrument ID |
duration | i4 | Repo duration |
id_deal | i8 | Deal ID number |
id_deal_rd | i8 | ID of the first part of repo in deals table |
id_deal_rb | i8 | ID of the second part of repo in deals table |
id_ord_buy | i8 | ID number of the buyer's order |
id_ord_sell | i8 | ID number of the seller's order |
amount | i4 | Volume, number of units of the instrument |
price | d16.5 | Price of the first part of multileg trade |
rate_price | d16.5 | Rate price |
swap_price | d16.5 | Swap price |
buyback_amount | d16.2 | Price of the second part of multileg trade |
moment | t | Time when the deal was made |
nosystem | i1 | Sign of non-system deal |
xstatus_buy | i8 | Extended status of the trade from the buyer's side |
xstatus_sell | i8 | Extended status of the trade from the seller's side |
status_buy | i4 | Status of the trade from the buyer's side |
status_sell | i4 | Status of the trade from the seller's side |
ext_id_buy | i4 | External ID number from the buyer's order |
ext_id_sell | i4 | External ID number from the seller's order |
code_buy | c7 | Buyer's code |
code_sell | c7 | Seller's code |
comment_buy | c20 | Comment from the buyer's order |
comment_sell | c20 | Comment from the seller's order |
trust_buy | i1 | Sign of an asset management company's order from the buyer's order |
trust_sell | i1 | Sign of an asset management company's order from the seller's order |
hedge_buy | i1 | Sign of a hedging deal from the buyers's side |
hedge_sell | i1 | Sign of a hedging deal from the seller's side |
login_buy | c20 | Login of the buyer user |
login_sell | c20 | Login of the seller user |
code_rts_buy | c7 | RTS code of the buyer company |
code_rts_sell | c7 | RTS 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.
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.
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 7. Fields of table user_deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
id_deal | i8 | Deal ID number |
id_deal_multileg | i8 | Deal ID number for multileg deals |
id_repo | i8 | ID number of the other leg of a repo trade |
pos | i4 | Number of positions in the instrument in the market after the trade |
amount | i4 | Volume, number of units of the instrument |
id_ord_buy | i8 | ID number of the buyer's order |
id_ord_sell | i8 | ID number of the seller's order |
price | d16.5 | Price |
moment | t | Time when the deal was made |
nosystem | i1 | Sign of non-system deal |
xstatus_buy | i8 | Status of the trade from the buyer's side |
xstatus_sell | i8 | Status of the trade from the seller's side |
status_buy | i4 | Status of the trade from the buyer's side |
status_sell | i4 | Status of the trade from the seller's side |
ext_id_buy | i4 | External ID number from the buyer's order |
ext_id_sell | i4 | External ID number from the seller's order |
code_buy | c7 | Buyer's code |
code_sell | c7 | Seller's code |
comment_buy | c20 | Comment from the buyer's order |
comment_sell | c20 | Comment from the seller's order |
trust_buy | i1 | Sign of an asset management company's order from the buyer's order |
trust_sell | i1 | Sign of an asset management company's order from the seller's order |
hedge_buy | i1 | Sign of a hedging deal from the buyers's side |
hedge_sell | i1 | Sign of a hedging deal from the seller's side |
fee_buy | d26.2 | Fee of the buyer's deal |
fee_sell | d26.2 | Fee of the seller's deal |
login_buy | c20 | Login of the buyer user |
login_sell | c20 | Login of the seller user |
code_rts_buy | c7 | RTS code of the buyer company |
code_rts_sell | c7 | RTS 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 8. Fields of table user_multileg_deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Multileg instrument ID |
id_deal | i8 | Deal ID number |
isin_id_rd | i4 | Repo direct instrument ID |
isin_id_rb | i4 | Repo back instrument ID |
isin_id_repo | i4 | Repo instrument ID |
duration | i4 | Repo duration |
id_deal_rd | i8 | ID of the first part of repo in deals table |
id_deal_rb | i8 | ID of the second part of repo in deals table |
id_ord_buy | i8 | ID number of the buyer's order |
id_ord_sell | i8 | ID number of the seller's order |
amount | i4 | Volume, number of units of the instrument |
price | d16.5 | Price of the first part of multileg trade |
rate_price | d16.5 | Rate price |
swap_price | d16.5 | Swap price |
buyback_amount | d16.2 | Price of the second part of multileg trade |
moment | t | Time when the deal was made |
nosystem | i1 | Sign of non-system deal |
xstatus_buy | i8 | Extended status of the trade from the buyer's side |
xstatus_sell | i8 | Extended status of the trade from the seller's side |
status_buy | i4 | Status of the trade from the buyer's side |
status_sell | i4 | Status of the trade from the seller's side |
ext_id_buy | i4 | External ID number from the buyer's order |
ext_id_sell | i4 | External ID number from the seller's order |
code_buy | c7 | Buyer's code |
code_sell | c7 | Seller's code |
comment_buy | c20 | Comment from the buyer's order |
comment_sell | c20 | Comment from the seller's order |
trust_buy | i1 | Sign of an asset management company's order from the buyer's order |
trust_sell | i1 | Sign of an asset management company's order from the seller's order |
hedge_buy | i1 | Sign of a hedging deal from the buyers's side |
hedge_sell | i1 | Sign of a hedging deal from the seller's side |
login_buy | c20 | Login of the buyer user |
login_sell | c20 | Login of the seller user |
code_rts_buy | c7 | RTS code of the buyer company |
code_rts_sell | c7 | RTS 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.
This stream contains tables from the log of changes to your orders and trades.
Table user_deal contains only own deals. This table may be useful for late join.
Tables:
Table 9. Fields of table orders_log
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
id_deal | i8 | Deal ID number |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
price | d16.5 | Price |
moment | t | Order update time |
dir | i1 | Direction |
action | i1 | Operation with the order |
deal_price | d16.5 | Price of the deal |
client_code | c7 | Client code |
login_from | c20 | Login of the user who has entered the order |
comment | c20 | Trader's comment |
hedge | i1 | Attribute of a hedging order |
trust | i1 | Attribute of an order from an asset management company |
ext_id | i4 | External ID number. It is added to orders, trades |
broker_to | c7 | FORTS code of the company to whom the direct order is addressed |
broker_to_rts | c7 | RTS code of the company to whom the direct order is addressed |
broker_from_rts | c7 | RTS code of the company who has entered the order |
date_exp | t | Order's expiration date |
id_ord1 | i8 | ID number of the first order |
local_stamp | t | User's local time |
Notes:
Field status is a bit mask
Quote
Couter
Non-system
Client’s collateral was not checked while adding order
End-of-transaction bit
Fill-or-kill
The record is a result of moving the order
The record is a result of cancelling the order
The record is a result of cancelling the group of orders
Sign of cancelling the left balance of the order because of the cross-trade
Field action describes an action with the order
Order cancelled
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Table 10. Fields of table deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
id_deal | i8 | Deal ID number |
id_deal_multileg | i8 | Deal ID number for multileg deals |
pos | i4 | Number of positions in the instrument in the market after the trade |
amount | i4 | Volume, number of units of the instrument |
id_ord_buy | i8 | ID number of the buyer's order |
id_ord_sell | i8 | ID number of the seller's order |
price | d16.5 | Price |
moment | t | Time when the deal was made |
nosystem | i1 | Sign of non-system deal |
xstatus_buy | i8 | Extended status of the trade from the buyer's side |
xstatus_sell | i8 | Extended status of the trade from the seller's side |
status_buy | i4 | Status of the trade from the buyer's side |
status_sell | i4 | Status of the trade from the seller's side |
ext_id_buy | i4 | External ID number from the buyer's order |
ext_id_sell | i4 | External ID number from the seller's order |
code_buy | c7 | Buyer's code |
code_sell | c7 | Seller's code |
comment_buy | c20 | Comment from the buyer's order |
comment_sell | c20 | Comment from the seller's order |
trust_buy | i1 | Sign of an asset management company's order from the buyer's order |
trust_sell | i1 | Sign of an asset management company's order from the seller's order |
hedge_buy | i1 | Sign of a hedging deal from the buyers's side |
hedge_sell | i1 | Sign of a hedging deal from the seller's side |
fee_buy | d26.2 | Fee of the buyer's deal |
fee_sell | d26.2 | Fee of the seller's deal |
login_buy | c20 | Login of the buyer user |
login_sell | c20 | Login of the seller user |
code_rts_buy | c7 | RTS code of the buyer company |
code_rts_sell | c7 | RTS 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:
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
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.
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 13. Fields of table user_deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
id_deal | i8 | Deal ID number |
id_deal_multileg | i8 | Deal ID number for multileg deals |
pos | i4 | Number of positions in the instrument in the market after the trade |
amount | i4 | Volume, number of units of the instrument |
id_ord_buy | i8 | ID number of the buyer's order |
id_ord_sell | i8 | ID number of the seller's order |
price | d16.5 | Price |
moment | t | Time when the deal was made |
nosystem | i1 | Sign of non-system deal |
xstatus_buy | i8 | Status of the trade from the buyer's side |
xstatus_sell | i8 | Status of the trade from the seller's side |
status_buy | i4 | Status of the trade from the buyer's side |
status_sell | i4 | Status of the trade from the seller's side |
ext_id_buy | i4 | External ID number from the buyer's order |
ext_id_sell | i4 | External ID number from the seller's order |
code_buy | c7 | Buyer's code |
code_sell | c7 | Seller's code |
comment_buy | c20 | Comment from the buyer's order |
comment_sell | c20 | Comment from the seller's order |
trust_buy | i1 | Sign of an asset management company's order from the buyer's order |
trust_sell | i1 | Sign of an asset management company's order from the seller's order |
hedge_buy | i1 | Sign of a hedging deal from the buyers's side |
hedge_sell | i1 | Sign of a hedging deal from the seller's side |
fee_buy | d26.2 | Fee of the buyer's deal |
fee_sell | d26.2 | Fee of the seller's deal |
login_buy | c20 | Login of the buyer user |
login_sell | c20 | Login of the seller user |
code_rts_buy | c7 | RTS code of the buyer company |
code_rts_sell | c7 | RTS 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:
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Tables:
Table 14. Fields of table orders_log
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
id_deal | i8 | Deal ID for this operation |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
price | d16.5 | Price |
moment | t | Order update time |
dir | i1 | Direction |
action | i1 | Operation with the order |
deal_price | d16.5 | Price of the deal |
Notes:
Field status is a bit mask
Quote
Couter
Non-system
Client’s collateral was not checked while adding order
End-of-transaction bit
Fill-or-kill
The record is a result of moving the order
The record is a result of cancelling the order
The record is a result of cancelling the group of orders
Sign of cancelling the left balance of the order because of the cross-trade
Field action describes an action with the order
Order cancelled
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Table 15. Fields of table multileg_orders_log
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
id_deal | i8 | Deal ID for this operation |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
price | d16.5 | Price |
moment | t | Order update time |
dir | i1 | Direction |
action | i1 | Operation with the order |
deal_price | d16.5 | Price of the deal |
rate_price | d16.5 | Rate price |
swap_price | d16.5 | Swap price |
Notes:
Field status is a bit mask
Quote
Couter
Non-system
End-of-transaction bit
REPO Order with Clearing Center
REPO Order
Regular multileg order
Field action describes action with order
Order cancelled
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
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.
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
Tables:
Table 18. Fields of table deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_deal | i8 | Deal ID number |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
pos | i4 | Number of positions in the instrument in the market after the trade |
amount | i4 | Volume, number of units of the instrument |
id_ord_sell | i8 | ID number of the seller's order |
id_ord_buy | i8 | ID number of the buyer's order |
price | d16.5 | Price |
moment | t | Time when the deal was made |
nosystem | i1 | Sign 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 19. Fields of table multileg_deal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_deal | i8 | Deal ID number |
sess_id | i4 | Trading session ID |
isin_id | i4 | Multileg instrument ID |
id_ord_buy | i8 | ID number of the buyer's order |
id_ord_sell | i8 | ID number of the seller's order |
amount | i4 | Volume, number of units of the instrument |
price | d16.5 | Price of the first part of multileg trade |
rate_price | d16.5 | Rate price |
swap_price | d16.5 | Swap price |
buyback_amount | d16.2 | Price of the second part of multileg trade |
moment | t | Time when the deal was made |
nosystem | i1 | Sign of non-system deal |
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
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.
Tables:
Table 22. Fields of table adjusted_fee
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_deal | i8 | Deal ID number |
moment | t | Time when the deal was made |
code_buy | c7 | Buyer's code |
code_sell | c7 | Seller's code |
initial_fee_buy | d26.2 | Initial fee of the buyer's deal |
initial_fee_sell | d26.2 | Initial fee of the seller's deal |
adjusted_fee_buy | d26.2 | Adjusted fee of the buyer's deal |
adjusted_fee_sell | d26.2 | Adjusted fee of the seller's deal |
id_repo | i8 | ID number of the other leg of a repo trade |
id_deal_multileg | i8 | Deal ID number for multileg deals |
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
Tables:
Table 24. Fields of table orders
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
client_code | c7 | Client code |
moment | t | Order update time |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
action | i1 | Operation with the order |
isin_id | i4 | Instrument unique ID |
dir | i1 | Direction |
price | d16.5 | Price |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
comment | c20 | Trader's comment |
hedge | i1 | Attribute of a hedging order |
trust | i1 | Attribute of an order from an asset management company |
ext_id | i4 | External ID number. It is added to orders, trades |
login_from | c20 | Login of the user who has entered the order |
broker_to | c7 | FORTS code of the company to whom the direct order is addressed |
broker_to_rts | c7 | RTS code of the company to whom the direct order is addressed |
date_exp | t | Order's expiration date |
id_ord1 | i8 | ID number of the first order |
broker_from_rts | c7 | RTS code of the company who has entered the order |
init_moment | t | Time of the order placement |
init_amount | i4 | Initial amount in the order |
Notes:
Field status is a bit mask and defines the following values:
Quote
Couter
Non-system
The record is a result of moving the order
The record is a result of cancelling the order
The record is a result of cancelling the group of orders
Sign of cancelling the left balance of the order because of the cross-trade
Field action describes an action with the order
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Tables:
Table 26. Fields of table orders
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
client_code | c7 | Client code |
moment | t | Order update time |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
action | i1 | Operation with the order |
isin_id | i4 | Instrument unique ID |
dir | i1 | Direction |
price | d16.5 | Price |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
comment | c20 | Trader's comment |
hedge | i1 | Attribute of a hedging order |
trust | i1 | Attribute of an order from an asset management company |
ext_id | i4 | External ID number. It is added to orders, trades |
login_from | c20 | Login of the user who has entered the order |
broker_to | c7 | FORTS code of the company to whom the direct order is addressed |
broker_to_rts | c7 | RTS code of the company to whom the direct order is addressed |
date_exp | t | Order's expiration date |
id_ord1 | i8 | ID number of the first order |
broker_from_rts | c7 | RTS code of the company who has entered the order |
init_moment | t | Time of the order placement |
init_amount | i4 | Initial amount in the order |
Notes:
Field status is a bit mask and defines the following values:
Quote
Couter
Non-system
The record is a result of moving the order
The record is a result of cancelling the order
The record is a result of cancelling the group of orders
Sign of cancelling the left balance of the order because of the cross-trade
Field action describes an action with the order
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Tables:
Table 28. Fields of table orders
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
id_ord | i8 | Order ID number |
sess_id | i4 | Trading session ID |
moment | t | Order update time |
xstatus | i8 | Extended order's status |
status | i4 | Order's status |
action | i1 | Operation with the order |
isin_id | i4 | Instrument unique ID |
dir | i1 | Direction |
price | d16.5 | Price |
amount | i4 | Number of lots in the operation |
amount_rest | i4 | Remaining number in the order |
init_moment | t | Time of the order placement |
init_amount | i4 | Initial amount in the order |
Notes:
Field status is a bit mask and defines the following values:
Quote
Couter
Non-system
The record is a result of moving the order
The record is a result of cancelling the order
The record is a result of cancelling the group of orders
Sign of cancelling the left balance of the order because of the cross-trade
Field action describes an action with the order
Order added
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.
The record is a result of order deletion via 'Cancel On Disconnect' service.
Tables:
The table contains
Table 30. Fields of table common
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
best_sell | d16.5 | Best bid |
amount_sell | i4 | Size of the best bid |
best_buy | d16.5 | Best offer |
amount_buy | i4 | Size of the best offer |
price | d16.5 | Price of the last trade |
trend | d16.5 | Price trend (difference between the prices of the last two trades) |
amount | i4 | Size of the last trade |
deal_time | t | Date and time of the last trade |
min_price | d16.5 | The low |
max_price | d16.5 | The high |
avr_price | d16.5 | Average weighted price |
old_kotir | d16.5 | Settlement price of the previous session |
deal_count | i4 | Number of trades |
contr_count | i4 | Total number of contracts in the trades |
capital | d26.2 | Total volume of trades in Russian rubles |
pos | i4 | Current open interest |
mod_time | t | Date and time of changing the entry in the table |
cur_kotir | d16.5 | Current quote |
cur_kotir_real | d16.5 | Market quote |
orders_sell_qty | i4 | Number of offer orders |
orders_sell_amount | i4 | Total number of contracts in offer |
orders_buy_qty | i4 | Number of bid orders |
orders_buy_amount | i4 | Total number of contracts in bid |
open_price | d16.5 | Opening price |
close_price | d16.5 | Closing price |
local_time | t | Time 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
Tables:
The table contains
Table 31. Fields of table common
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
best_sell | d16.5 | Best bid |
amount_sell | i4 | Size of the best bid |
best_buy | d16.5 | Best offer |
amount_buy | i4 | Size of the best offer |
price | d16.5 | Price of the last trade |
trend | d16.5 | Price trend (difference between the prices of the last two trades) |
amount | i4 | Size of the last trade |
deal_time | t | Date and time of the last trade |
min_price | d16.5 | The low |
max_price | d16.5 | The high |
avr_price | d16.5 | Average weighted price |
old_kotir | d16.5 | Settlement price of the previous session |
deal_count | i4 | Number of trades |
contr_count | i4 | Total number of contracts in the trades |
capital | d26.2 | Total volume of trades in Russian rubles |
pos | i4 | Current open interest |
mod_time | t | Date and time of changing the entry in the table |
isin_is_spec | i1 | Currently you may submit a request for quote for this instrument |
orders_sell_qty | i4 | Number of offer orders |
orders_sell_amount | i4 | Total number of contracts in offer |
orders_buy_qty | i4 | Number of bid orders |
orders_buy_amount | i4 | Total number of contracts in bid |
open_price | d16.5 | Opening price |
close_price | d16.5 | Closing price |
local_time | t | Time 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
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
Tables:
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.
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.
Tables:
The table contains information on clients positions.
Table 33. Fields of table position
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
client_code | c7 | Client code |
open_qty | i4 | Number of positions at the start of the session |
buys_qty | i4 | Number of contracts bought during the session |
sells_qty | i4 | Number of contracts sold during the session |
pos | i4 | Current position |
net_volume_rur | d26.2 | Net value of trades in Russian rubles. Positive number – cash is credited, negative number – cash is debited |
last_deal_id | i8 | ID of the last deal |
waprice | d16.5 | Average weighted price |
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
Tables:
The table contains information on clients limits.
Table 35. Fields of table part
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
client_code | c7 | Client code |
coeff_go | d16.5 | Client’s collateral ratio |
coeff_liquidity | d16.5 | Liquidity ratio |
money_old | d26.2 | Total amount of funds at the end of the previous session |
money_amount | d26.2 | Total cash amount |
money_free | d26.2 | Available cash amount |
money_blocked | d26.2 | Blocked cash amount |
pledge_old | d26.2 | Collateral in form of securities at the start of the session |
pledge_amount | d26.2 | Total collateral in form of securities |
pledge_free | d26.2 | Available collateral in form of securities |
pledge_blocked | d26.2 | Blocked collateral in form of securities |
vm_reserve | d26.2 | Amount reserved for negative variation margin on closed positions |
vm_intercl | d26.2 | Variation margin debited or credited during the intraday clearing |
fee | d26.2 | Debited fee |
fee_reserve | d26.2 | Blocked amount reserved for fees under the orders |
limit_spot_buy | d26.2 | Limit for buying RTS standard instruments |
limit_spot_buy_used | d26.2 | Limit used for buying RTS standard instruments |
is_auto_update_limit | i1 | Flag of automatic adjustment of the limit by the amount of income during downloading after clearing: 0-no, 1-adjust. |
is_auto_update_spot_limit | i1 | Flag 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_discount | i1 | Flag of ban to provide discounts for futures: 1-ban, 0-no. |
limits_set | i1 | Flag of set limits. 0 for no limits |
premium | d26.2 | Premium |
premium_order_reserve | f | Premium reserve for orders |
balance_money | d26.2 | Money transfers balance for current trading session |
vm_order_reserve | f | Amount reserved for negative variation margin on orders |
money_pledge_amount | d26.2 | Sum of estimated value of collateral |
num_clr_2delivery | i4 | Number 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_risk | i1 | The sign that extra risk calculation for non-quarter options is on |
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
Tables:
Table 37. Fields of table delivery_report
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
date | t | Date of clearing |
client_code | c7 | Client code |
type | c2 | Flag of Clearing Member/Brokerage Company/client. Here it is always 'CL'. |
isin_id | i4 | Instrument ID number |
pos | i4 | Number 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_excl | i4 | For 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_unexec | i4 | Number of positions that were not settled during the current delivery stage |
unexec | i1 | Flag of settlement/failure to settle by the client whose positions are referred to in the field pos_unexec |
settl_pair | c12 | Settlement accounts pair code |
asset_code | c25 | Trading code of the asset being delivered |
issue_code | c25 | Depository code of the asset being delivered |
oblig_rur | d16.2 | Amount of obligations in Russian rubles |
oblig_qty | i8 | Amount of obligations in units of securities |
fulfil_rur | d16.2 | Amount of performed obligations in Russian rubles |
fulfil_qty | i8 | Amount of performed obligations in units of securities |
step | i4 | Number of delivery stage |
sess_id | i4 | Trading session ID |
id_gen | i4 | ID number of the stage of report generation |
Notes:
Field unexec can take the following values:
Settlement
Non-settlement
Field step always has a value of 1 when delivery of RTS Standard instrument
Table 38. Fields of table fut_rejected_orders
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
order_id | i8 | Order ID number |
sess_id | i4 | Trading session ID |
client_code | c7 | Client code |
moment | t | Order update time |
moment_reject | t | Time when the order was rejected |
isin_id | i4 | Instrument unique ID |
dir | i1 | Direction |
amount | i4 | Volume, in units of the instrument |
price | d16.5 | Price |
date_exp | t | Order's expiration date |
id_ord1 | i8 | ID number of the first order |
ret_code | i4 | Return code of the re-entering procedure |
ret_message | c255 | Text of the message containing the reason for rejection of the order when it is re-entered |
comment | c20 | Trader's comment |
login_from | c20 | Login of the user who has entered the order |
ext_id | i4 | External ID number. It is added to orders, trades |
Table 39. Fields of table fut_intercl_info
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
client_code | c7 | Client code |
vm_intercl | d16.2 | Variation margin debited or credited during the intraday clearing |
Table 40. Fields of table fut_bond_registry
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
bond_id | i4 | ID of the bond |
small_name | c25 | Trading code for corporate bonds trading on RTS |
short_isin | c25 | Bonds issue |
name | c75 | Bond’s name |
date_redempt | t | Bond’s maturity date |
nominal | d16.5 | Bond’s face value |
bond_type | i1 | Type: share/bond |
year_base | i2 | Day-count basis |
Notes:
Field bond_type is a bit mask and defines the following values:
not set
Share
Bond (not amortized, actual formula)
Amortized bond
Bond, virtual American formula
Bond, virtual European formula
Table 42. Fields of table fut_bond_nkd
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
bond_id | i4 | ID of the bond |
date | t | Coupon payment date |
nkd | d16.7 | Accrued interest as of the coupon payment date |
is_cupon | i1 | Flags: 0 - accrued interest as of the bond futures contract settlement date, 1 - coupon, 2 - accrued interest as of the bond settlement date |
Table 43. Fields of table fut_bond_nominal
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
bond_id | i4 | ID of the bond |
date | t | Coupon payment date |
nominal | d16.5 | payment of bonds’ face value |
face_value | d16.5 | Payment of bonds’ rest face value |
coupon_nominal | d8.5 | Coupon value in % of face value |
is_nominal | i1 | Type of record in the table |
Notes:
Field is_nominal may contain the following values:
Residual face value as of the bond futures contract settlement date
Residual face value as of the coupon payment date
Residual face value as of the bond settlement date
Notes:
At current moment filed id can take value = 1 (rub to usd)
The table contains directory of base contracts for instruments.
Table 45. Fields of table fut_vcb
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
code_vcb | c25 | Base contract code |
name | c75 | Name |
exec_type | c1 | Settlement type |
curr | c3 | Payment currency |
exch_pay | d16.2 | Exchange fee per 1 contract in Russian rubles |
exch_pay_scalped | i1 | Flag of scalping the exchange fee |
clear_pay | d16.2 | Clearing fee per 1 contract in Russian rubles |
clear_pay_scalped | i1 | Flag of scalping the clearing fee |
sell_fee | d7.3 | Commission payable by the seller. Not relevant |
buy_fee | d7.3 | Commission payable by the buyer. Not relevant |
trade_scheme | c1 | Trading mode |
section | c50 | Market section. 'Securities', 'Commodities', 'Money' |
exch_pay_spot | d16.5 | Exchange fee for RTS standard instrument per 1 lot in percentage of the price |
client_code | c7 | Client code |
exch_pay_spot_repo | d16.5 | Exchange fee on repo |
rate_id | i4 | Rate ID |
Notes:
Field exec_type can take the following values:
Alternative
Settlement
Index
Settlement via T+ mode, ASTS
Field trade_scheme can take the following values:
With 100% collateral
With pledge
The table contains trading sessions timetable.
Table 46. Fields of table session
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
begin | t | Opening time |
end | t | Closing time |
state | i4 | Session status |
opt_sess_id | i4 | ID number of the relevant session for options |
inter_cl_begin | t | Time when the intraday clearing begins |
inter_cl_end | t | Time when the intraday clearing is over |
inter_cl_state | i4 | Status of the intraday clearing |
eve_on | i1 | Flag of holding an additional evening session |
eve_begin | t | Time when the additional evening session starts |
eve_end | t | Time when the additional evening session is over |
mon_on | i1 | Flag of holding an additional morning session |
mon_begin | t | Time when the additional morning session starts |
mon_end | t | Time when the additional morning session is over |
pos_transfer_begin | t | Time when the special period for position transfer starts |
pos_transfer_end | t | Time 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:
Session is scheduled. Orders can't be placed but can be cancelled.
Session is running. Orders can be both placed and cancelled.
Trading with all instruments is suspended. Orders can't be placed but can be cancelled.
Session is closed compulsorily. Orders can be neither placed nor cancelled.
Session is completed because the time is up. Orders can be neither added nor cancelled.
Field inter_cl_state is a bit mask:
It is not defined. Orders can be both placed and cancelled.
It is scheduled today. Orders can be placed and cancelled.
It is cancelled. Orders can be placed and cancelled.
Current, i.e.it is running, nothing can be done. Orders can't be placed and cancelled.
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.
It is successfully over (due to time schedule as well). Orders can be placed and cancelled.
Table 47. Fields of table multileg_dict
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Multileg instrument ID |
isin_id_leg | i4 | ID of the instrument which is a component of specified multileg instrument |
qty_ratio | i4 | Quantity 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.
The table contains dictionary of instruments which are traded in specified trading session.
Table 48. Fields of table fut_sess_contents
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
short_isin | c25 | Description of the instrument |
isin | c25 | Symbol code of the instrument |
name | c75 | Instrument name |
inst_term | i4 | Shift from RTS standard instruments |
code_vcb | c25 | Base contract code |
is_limited | i1 | Flag of limits established for trading |
limit_up | d16.5 | Upper price limit |
limit_down | d16.5 | Lower price limit |
old_kotir | d16.5 | Adjusted settlement price of the previous session |
buy_deposit | d16.2 | Collateral of the buyer |
sell_deposit | d16.2 | Collateral of the seller |
roundto | i4 | Number of decimal places after the decimal point for the price |
min_step | d16.5 | Minimum price increment |
lot_volume | i4 | Lot, i.e. number of units of the underlying asset in the instrument |
step_price | d16.5 | Value of the minimum price incrememnt |
d_pg | t | Expiration date |
is_spread | i1 | Flag of the futures contract’s being part of an intermonth spread 1 – spread; 0 – no spread. |
coeff | d9.6 | Ratio of the intermonth spread |
d_exp | t | Instrument’s settlement date |
is_percent | i1 | Flag of futures contract. 1 – interest rate futures, 0 – common futures, 2 - weather and electricity futures, 3 - Eurobonds futures, 4 - futures on repo rate |
percent_rate | d6.2 | Variation margin rate for interest rate futures |
last_cl_quote | d16.5 | Quote after the last clearing session |
signs | i4 | Flags field |
is_trade_evening | i1 | Flag of being traded during the evening trading session |
ticker | i4 | Unique ID number of the primary RTS standard instruments |
state | i4 | State of trading in the instrument |
price_dir | i1 | Direction of price sorting for the instrument |
multileg_type | i4 | Type of multileg instrument |
legs_qty | i4 | Number of instruments for multileg instrument |
step_price_clr | d16.5 | Value of the minumum increment for the clearing session |
step_price_interclr | d16.5 | Value of the minumum increment for the intraday clearing session |
step_price_curr | d16.5 | Value of the minimum increment in USD |
d_start | t | Instrument's start trade date |
exch_pay | d16.5 | Exchange fee |
pctyield_coeff | d16.5 | Coef. for yield calculation on percent rates futures |
pctyield_total | d16.5 | Sum 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:
Session for this instrument is scheduled. One can cancel orders for this instrument
Session for this instrument is running. One can both add and cancel orders for this instrument
Session for this instrument has been closed compulsorily. Orders can be neither added nor cancelled
Session for this instrument has been completed because the time is up. Orders can't be neither added nor cancelled
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:
The instrument is traded in the evening session
Futures-style (1) or equity-style (0)
Sign of anonymous trading
Sign of non-anonymous trading
Sign of trading in the main session
Sign of multileg-instrument
Sign of primary price for multileg instruments:
0 for swap price
1 for rate price
Field price_dir can take the following values:
Standard order of price graduation
Reverse order of price graduation
Field multileg_type can take the following values:
Ordinary instrument, not the multileg one
The instrument that is traded in the REPO mode
The instrument is RTS Money swap
The instrument is calendar futures spread
Field is_trade_evening is bit mask:
Instrument is not traded
Instrument is traded in the evening trading session
Instrument is traded in the main trading session
Table 49. Fields of table fut_instruments
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
short_isin | c25 | Description of the instrument |
isin | c25 | Symbol code of the instrument |
name | c75 | Instrument name |
inst_term | i4 | Shift from RTS standard instruments |
code_vcb | c25 | Base contract code |
is_limited | i1 | Flag of limits established for trading |
old_kotir | d16.5 | Adjusted settlement price of the previous session |
roundto | i4 | Number of decimal places after the decimal point for the price |
min_step | d16.5 | Minimum price increment |
lot_volume | i4 | Lot, i.e. number of units of the underlying asset in the instrument |
step_price | d16.5 | Value of the minimum price incrememnt |
d_pg | t | Expiration date |
is_spread | i1 | Flag of the futures contract’s being part of an intermonth spread 1 – spread; 0 – no spread. |
coeff | d9.6 | Ratio of the intermonth spread |
d_exp | t | Instrument’s settlement date |
is_percent | i1 | Flag of futures contract. 1 – interest rate futures, 0 – common futures, 2 - weather and electricity futures, 3 - Eurobonds futures, 4 - futures on repo rate |
percent_rate | d6.2 | Variation margin rate for interest rate futures |
last_cl_quote | d16.5 | Quote after the last clearing session |
signs | i4 | Flags field |
volat_min | d20.15 | Volatility lower edge |
volat_max | d20.15 | Volatility upper edge |
price_dir | i1 | Direction of price sorting for the instrument |
multileg_type | i4 | Type of multileg instrument |
legs_qty | i4 | Number of instruments for multileg instrument |
step_price_clr | d16.5 | Value of the minumum increment for the clearing session |
step_price_interclr | d16.5 | Value of the minumum increment for the intraday clearing session |
step_price_curr | d16.5 | Value of the minimum increment in USD |
d_start | t | Instrument's start trade date |
is_limit_opt | i1 | Flag of calculation of the limits on options on this future |
limit_up_opt | d5.2 | For options in the money: the upper limit of deviation from the central strike volatility |
limit_down_opt | d5.2 | For options in the money: the lower limit of deviation from the central strike volatility |
adm_lim | d16.5 | For options in the money: limit of the theoretical price deviation set by the administrator |
adm_lim_offmoney | d16.5 | For options out of the money: limit of the theoretical price deviation |
apply_adm_limit | i1 | For options in the money: 1 - apply administrative limits, 0 - apply volatility deviation limits |
pctyield_coeff | d16.5 | Coef. for yield calculation on percent rates futures |
pctyield_total | d16.5 | Sum of rates for yield calculation on percent rates futures |
Table 50. Fields of table diler
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
client_code | c7 | Client code |
name | c200 | Company name |
rts_code | c50 | RTS code of the company |
transfer_code | c7 | Account code for position transfer |
status | i4 | Sign 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
Notes:
Status field is a bit mask:
0x01 - control section
0x02 - separate register
0x04 -BF is control
The table contains settlement instruments prices of the last clearing.
Table 52. Fields of table fut_sess_settl
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
date_clr | t | Clearing date |
isin | c25 | Symbol code of the instrument |
isin_id | i4 | Instrument unique ID |
settl_price | d16.5 | Settlement price |
Table 53. Fields of table sys_messages
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
msg_id | i4 | Unique message ID |
moment | t | Message date and time |
lang_code | c8 | Message language |
urgency | i1 | Urgency |
status | i1 | Message status |
text | c255 | Short text |
message_body | c4000 | Full text |
Table 54. Fields of table prohibition
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
prohib_id | i4 | Number of prohibition |
client_code | c7 | Client code |
initiator | i4 | Originator of prohibition |
section | c50 | Section |
code_vcb | c25 | Base contract code |
isin_id | i4 | Instrument unique ID |
priority | i4 | Priority of prohibition |
group_mask | i8 | Bitmask of groups for which there is a prohibition |
type | i4 | Type of prohibition |
is_legacy | i4 | Symptom adding bans through legacy-komandyBitovaya mask groups for which there is a prohibition |
Notes:
Field Initiator - Initiator of the prohibition:
BF;
CF Chief trader;
CC Administrator;
TS Administrator.
Field Type - Prohibition type
No prohibitions (when cancelling a previous prohibition with lower priority, otherwise simply delete the line);
prohibited to open positions;
prohibited to perform all trading operations;
prohibited to open sell positions;
BF prohibition to add orders for exercising.
Only Chief Trader is allowed to add orders for exercising.
Field ProhibitionGroupMask - Instrument type bitmask:
T+0
T+1
T+2
...
T+27
T-1
spots
futures
options
Field Priority - From high to low
9
8
7
6
5
4
3
2
1
Field SectionID - Name:
Securities
Commodities
FX
MOSENEX
SPBEX
SPBEX_OAO
NAMEX
Table 55. Fields of table rates
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
rate_id | i4 | Payment currency identifier |
curr_base | c15 | Base currency code |
curr_coupled | c15 | Linked currency code |
radius | d16.5 | Price indicator change radius (in percent) |
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
Tables:
Table 57. Fields of table opt_rejected_orders
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
order_id | i8 | Order ID number |
sess_id | i4 | Trading session ID |
client_code | c7 | Client code |
moment | t | Order update time |
moment_reject | t | Time when the order was rejected |
isin_id | i4 | Instrument unique ID |
dir | i1 | Direction |
amount | i4 | Volume, in units of the instrument |
price | d16.5 | Price |
date_exp | t | Order's expiration date |
id_ord1 | i8 | ID number of the first order |
ret_code | i4 | Return code of the re-entering procedure |
ret_message | c255 | Text of the message containing the reason for rejection of the order when it is re-entered |
comment | c20 | Trader's comment |
login_from | c20 | Login of the user who has entered the order |
ext_id | i4 | External ID number. It is added to orders, trades |
Table 58. Fields of table opt_intercl_info
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
client_code | c7 | Client code |
vm_intercl | d16.2 | Variation margin debited or credited during the intraday clearing |
Table 59. Fields of table opt_exp_orders
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
exporder_id | i8 | Unique ID number of the order for expiration |
client_code | c7 | Client code |
isin_id | i4 | Instrument unique ID |
amount | i4 | Number of expiring positions |
sess_id | i4 | Trading session ID |
date | t | Date and time |
amount_apply | i4 | Number of positions detailed in orders as of intraday clearing |
The table contains dictionary of base contracts for instruments.
Table 60. Fields of table opt_vcb
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
code_vcb | c25 | Base contract code |
name | c75 | Name |
exec_type | c1 | Settlement type |
curr | c3 | Payment currency |
exch_pay | d16.2 | Exchange fee per 1 contract in Russian rubles |
exch_pay_scalped | i1 | Flag of scalping the exchange fee |
clear_pay | d16.2 | Clearing fee per 1 contract in Russian rubles |
clear_pay_scalped | i1 | Flag of scalping the clearing fee |
sell_fee | d7.3 | Commission payable by the seller. Not relevant |
buy_fee | d7.3 | Commission payable by the buyer. Not relevant |
trade_scheme | c1 | Trading mode |
coeff_out | d7.3 | Approximation ratio for options priced beyond limits |
is_spec | i1 | Flag of an RFQ specialist for this contract |
spec_spread | d16.5 | Maximum width of the specialist’s spread |
min_vol | i4 | Minimum volume of quotes from the specialist |
client_code | c7 | Client code |
rate_id | i4 | Rate ID |
The table contains dictionary of instruments which are traded in specified trading session.
Table 61. Fields of table opt_sess_contents
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
isin_id | i4 | Instrument unique ID |
isin | c25 | Symbol code of the instrument |
short_isin | c25 | Description of the instrument |
name | c75 | Instrument name |
code_vcb | c25 | Base contract code |
fut_isin_id | i4 | ID of the futures instrument |
is_limited | i1 | Flag of limits established for trading |
limit_up | d16.5 | Upper limit on premium |
limit_down | d16.5 | Lower limit on premium |
old_kotir | d16.5 | Quote (theoretical price of the option) of the previous session |
bgo_c | d16.2 | Basic size of the collateral to be posted on one open position of the option writer (Russian rubles) |
bgo_nc | d16.2 | Basic size of collateral to be posted on one unsecured position of the option writer (Russian rubles) |
europe | i1 | Option’s kind. 0 – American option, 1 – European option |
put | i1 | Option’s type. 0 - Call option, 1 - Put option |
strike | d16.5 | Strike price |
roundto | i4 | Number of decimal places after the decimal point for the price |
min_step | d16.5 | Premium’s minimum increment |
lot_volume | i4 | Lot, i.e. number of units of the underlying asset in the instrument |
step_price | d16.5 | Value of the minimum premium's increment |
d_pg | t | Expiration date |
d_exec_beg | t | Day when the instrument’s expiration begins |
d_exec_end | t | Day when the instrument’s expiration is over |
signs | i4 | Flags field |
last_cl_quote | d16.5 | Settlement Price (theoretical price of the option) after the last clearing session |
bgo_buy | d16.2 | Basic size of Collateral requested in order to buy a futures-style option |
base_isin_id | i4 | ID of the base futures instrument |
d_start | t | Instrument's start trade date |
exch_pay | d16.2 | Exchange fee per 1 contract in Russian rubles |
Notes:
Field signs is a bit mask and defines the following values:
The instrument is traded in the evening session
Futures-style (1) or equity-style (0)
Sign of anonymous trading
Sign of non-anonymous trading
Sign of trading in the main session
The table contains volatility and theoretical prices of the last clearing.
Table 62. Fields of table opt_sess_settl
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
date_clr | t | Clearing date |
isin | c25 | Symbol code of the instrument |
isin_id | i4 | Instrument ID number |
volat | d16.5 | Option’s volatility |
theor_price | d16.5 | Option’s theoretical price |
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
Tables:
Table 64. Fields of table volat_coeff
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
a | d16.10 | Coefficient A of the parametric volatility curve |
b | d16.10 | Coefficient B of the parametric volatility curve |
c | d16.10 | Coefficient C of the parametric volatility curve |
d | d16.10 | Coefficient D of the parametric volatility curve |
e | d16.10 | Coefficient E of the parametric volatility curve |
s | d16.10 | Coefficient S of the parametric volatility curve |
Tables:
Table 65. Fields of table fut_MM_info
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
spread | d16.5 | Spread in points |
price_edge_sell | d16.5 | Price of the worst sell order included in the spread |
amount_sells | i4 | Number of contracts in the sell order included in the spread |
price_edge_buy | d16.5 | Price of the worst buy order included in the spread |
amount_buys | i4 | Number of contracts in the buy order included in the spread |
mm_spread | d16.5 | Agreed spread |
mm_amount | i4 | Number in accordance with the agreement |
spread_sign | i1 | Sign: 1-spread is not maintained, 0-spread is maintained |
amount_sign | i1 | Sign: 1- number is not maintained, 0- number is maintained |
percent_time | d6.2 | % of fulfilled obligations |
period_start | t | Start of the period of MM rules coming into force |
period_end | t | End of the period of MM rules coming into force |
client_code | c7 | Client code |
active_sign | i4 | Sign: 1-note is deleted (stopped being active), 0-is active |
agmt_id | i4 | Identifier of the MM agreement |
fulfil_min | d6.2 | Minimum percentage of the liabilities for the trading session |
fulfil_partial | d6.2 | Percentage of partial fulfillment of the obligations of the trading session |
fulfil_total | d6.2 | Percentage of fulfillment of obligations of the trading session |
is_fulfil_min | i1 | Minimum sign of the liabilities for the trading session |
is_fulfil_partial | i1 | Sign of partial fulfillment of the obligations of the trading |
is_fulfil_total | i1 | Sign of fulfillment of obligations of the trading session |
is_rf | i1 | Sign of clearing member market-maker requirement |
id_group | i4 | ID 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 66. Fields of table opt_MM_info
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
spread | d16.5 | Spread in points |
price_edge_sell | d16.5 | Price of the worst sell order included in the spread |
amount_sells | i4 | Number of contracts in the sell order included in the spread |
price_edge_buy | d16.5 | Price of the worst buy order included in the spread |
amount_buys | i4 | Number of contracts in the buy order included in the spread |
mm_spread | d16.5 | Agreed spread |
mm_amount | i4 | Number in accordance with the agreement |
spread_sign | i1 | Sign: 1-spread is not maintained, 0-spread is maintained |
amount_sign | i1 | Sign: 1- number is not maintained, 0- number is maintained |
percent_time | d6.2 | % of fulfilled obligations |
period_start | t | Start of the period of MM rules coming into force |
period_end | t | End of the period of MM rules coming into force |
client_code | c7 | Client code |
cstrike_offset | d16.5 | Central Strike offset |
active_sign | i4 | Sign: 1-note is deleted (stopped being active), 0-is active |
agmt_id | i4 | Identifier of the MM agreement |
fulfil_min | d6.2 | Minimum percentage of the liabilities for the trading session |
fulfil_partial | d6.2 | Percentage of partial fulfillment of the obligations of the trading session |
fulfil_total | d6.2 | Percentage of fulfillment of obligations of the trading session |
is_fulfil_min | i1 | Minimum sign of the liabilities for the trading session |
is_fulfil_partial | i1 | Sign of partial fulfillment of the obligations of the trading |
is_fulfil_total | i1 | Sign of fulfillment of obligations of the trading session |
is_rf | i1 | Sign of clearing member market-maker requirement |
id_group | i4 | ID 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.
Tables:
Table 69. Fields of table money_clearing
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
client_code | c7 | Client code |
share | i1 | Account type |
amount_beg | d16.2 | At the start of the day |
vm | d16.2 | Variation margin including variation margin on futures-style options |
premium | d16.2 | Premium on options |
pay | d16.2 | Account operations |
fee_fut | d16.2 | Exchange fee on futures |
fee_opt | d16.2 | Exchange fee on options |
go | d16.2 | Total collateral on futures and options |
amount_end | d21.2 | At the end of the day |
free | d22.2 | Available funds |
ext_reserve | d26.2 | Additional provision |
Notes:
Tool box RUONIA ext_reserve contains the sum funds set aside for possible rate change RUONIA
Table 70. Fields of table clr_rate
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
rate | d16.5 | Index value |
moment | t | Date and time value was fixed |
signs | i1 | Sign, that corresponds to the current value |
sess_id | i4 | Trading session ID |
rate_id | i4 | Rate ID |
Table 71. Fields of table fut_pos
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
isin | c25 | Symbol code of the instrument |
client_code | c7 | Client code |
account | i1 | Account type (0 - CF; 1 - BF; 2 - client) |
pos_beg | i4 | Position on trading session start |
pos_end | i4 | Position on trading session end |
vm | d16.2 | Total variation margin at clearing time |
fee | d16.2 | Total fee |
accum_go | d16.2 | Accumulated Collateral Deposit |
fee_ex | d16.2 | Exchange fee |
vat_ex | d16.2 | VAT included in exchange fee |
fee_cc | d16.2 | Clearing fee |
vat_cc | d16.2 | VAT included in clearing fee |
Table 72. Fields of table opt_pos
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
isin | c25 | Symbol code of the instrument |
client_code | c7 | Client code |
account | i1 | Account type (0 - CF; 1 - BF; 2 - client) |
pos_beg | i4 | Position on trading session start |
pos_end | i4 | Position on trading session end |
vm | d16.2 | Total VM after the main clearing session per client/firm and instrument. Equals to the sum of VAR_MARG_P and VAR_MARG_D fields. |
fee | d16.2 | Total fee of the client/firm and instrument. Coincide with the SBOR field of reports |
fee_ex | d16.2 | Exchange fee |
vat_ex | d16.2 | VAT included in exchange fee |
fee_cc | d16.2 | Clearing fee |
vat_cc | d16.2 | VAT included in clearing fee |
Table 73. Fields of table fut_sess_settl
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
date_clr | t | Clearing date |
isin | c25 | Symbol code of the instrument |
isin_id | i4 | Instrument unique ID |
settl_price | d16.5 | Settlement price |
Table 74. Fields of table opt_sess_settl
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
sess_id | i4 | Trading session ID |
date_clr | t | Clearing date |
isin | c25 | Symbol code of the instrument |
isin_id | i4 | Instrument ID number |
volat | d16.5 | Option’s volatility |
theor_price | d16.5 | Option’s theoretical price |
Table 75. Fields of table pledge_details
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
client_code | c7 | Client code |
pledge_name | c10 | Foreign currency/security code |
amount_beg | d10.0 | Foreign currencies/securities amount at session opening |
pay | d10.0 | Amount of foreign currencies/securities deposited or withdrawn, in units |
amount | d10.0 | Current amount of foreign currencies/securities |
rate | d16.5 | Assessed value of foreign currency/security unit (in Russian roubles) |
amount_beg_money | d16.2 | Foreign currency/securities amount at session opening (in Russian rubles) |
pay_money | d16.2 | Amount of foreign currencies/securities deposited or withdrawn, in units (in Russian roubles) |
amount_money | d16.2 | Current amount of foreign currencies/securities (in Russian rubles) |
com_ensure | i1 | Collateral 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:
partial collateral;
full collateral.
Tables:
The table contains data about Stock Exchange Indices values.
Table 77. Fields of table rts_index
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
name | c25 | Index ID |
moment | t | Time of the last update |
value | d18.4 | Index value |
prev_close_value | d18.4 | Close value |
open_value | d18.4 | Open value |
max_value | d18.4 | Max value |
min_value | d18.4 | Min value |
usd_rate | d10.4 | USD rate for indices which include both RUB and USD contract prices |
cap | d18.4 | Index capitalization |
volume | d18.4 | Volume of trades that compose index value |
Tables:
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
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
name | c25 | Index ID |
moment | t | Time of the last update |
value | d18.4 | Index value |
prev_close_value | d18.4 | Close value |
open_value | d18.4 | Open value |
max_value | d18.4 | Max value |
min_value | d18.4 | Min value |
usd_rate | d10.4 | USD rate for indices which include both RUB and USD contract prices |
cap | d18.4 | Index capitalization |
volume | d18.4 | Volume of trades that compose index value |
Tables:
Table 79. Fields of table fut_vm
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
client_code | c7 | Client code |
vm | d16.5 | The accumulated variation margin on futures trades calculated according to the current quote |
vm_real | d16.5 | The accumulated variation margin on futures trades calculated based on the current market quote |
Table 80. Fields of table opt_vm
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
client_code | c7 | Client code |
vm | d16.5 | The accumulated variation margin on futures-style options trades calculated based on the current option quote |
vm_real | d16.5 | The accumulated variation margin on futures-style options trades calculated based on the current option quote |
Tables:
Table 81. Fields of table volat
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin_id | i4 | Instrument unique ID |
sess_id | i4 | Trading session ID |
volat | d16.5 | Option’s volatility |
theor_price | d16.5 | Option’s theoretical price |
theor_price_limit | d16.5 | Theoretical option price with limits |
up_prem | d16.5 | Upper limit for option price |
down_prem | d16.5 | Lower limit for option price |
Tables:
Table 82. Fields of table base_contracts_params
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
code_vcb | c25 | Code of the underlying contract |
code_mcs | c25 | Intercontract spread ID |
volat_num | i1 | Number of volatility curves |
points_num | i1 | Number of risk points |
subrisk_step | f | Number of risk subpoints |
is_percent | i1 | Flag of futures contract |
percent_rate | d16.5 | Variation margin rate for interest rate futures |
currency_volat | d16.5 | Volatility of currency rate |
is_usd | i1 | Sign of USD contract |
usd_rate_curv_radius | f | USD rate curvature radius |
somc | f | Collateral rate for uncovered sells |
Notes:
Field is_percent may contain the following values:
common futures
interest rate futures
weather and electricity futures
eurobonds futures
futures on repo rate
Table 83. Fields of table futures_params
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin | c25 | Instrument ID |
isin_id | i4 | Instrument unique ID |
code_vcb | c25 | Code of the underlying contract |
limit | f | Limit of contract price variations |
settl_price | d16.5 | Settlement price |
spread_aspect | i1 | Flag of making up futures spread |
subrisk | i1 | Sign of accounting risks in risks subpoints |
step_price | f | Value of the minimum price incrememnt |
base_go | d26.2 | Basic collateral |
exp_date | t | Date of expiration |
spot_signs | i1 | Sing of RTS Standard instrument |
settl_price_real | d16.5 | Real settlement price |
min_step | f | Minimal price increment |
Notes:
Field spread_aspect can take the following values:
It is not included in spread
It is included into calendar spread
Fieldspot_signs can take the following values:
Ordinary futures
RTS Standard instrument
Primary RTS Standard instrument
Table 84. Fields of table virtual_futures_params
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin | c25 | Instrument ID |
isin_base | c25 | Real futures ID |
is_net_positive | i1 | Sign of accounting positive risk on this virtual futures |
volat_range | f | Volatility range |
t_squared | f | Value of the square root from time to date of expiration of options to this virtual futures |
max_addrisk | f | Upper limitation on additional risks |
a | f | Parameter a |
b | f | Parameter b |
c | f | Parameter c |
d | f | Parameter d |
e | f | Parameter e |
s | f | Parameter s |
exp_date | t | Date of expiration |
fut_type | i1 | Sign of marginal calculation system for the options to this virtual futures |
use_null_volat | i1 | Sign of zero volatility |
allow_use_extra_exp_risk | i1 | Allow broker to turn on calculation of extra expiration risks for this option series |
calc_extra_exp_risk | i1 | Force system to turn on calculation of extra expiration risks for this option series |
Table 85. Fields of table options_params
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
isin | c25 | Instrument ID |
isin_id | i4 | Instrument unique ID |
isin_base | c25 | Virtual futures ID |
strike | d16.5 | Option's strike |
opt_type | i1 | Option's type: 1 - PUT, 2 - CALL |
settl_price | d16.5 | Settlement price |
base_go_sell | d26.2 | Base collateral to sell |
synth_base_go | d26.2 | Base collateral of synthetic sell position |
base_go_buy | d26.2 | Base collateral to buy |
Table 87. Fields of table client_params
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
client_code | c7 | Client code |
code_vcb | c25 | Base contract code |
coeff_go | d16.5 | Collateral coefficient |
limit_spot_sell | i4 | Not used |
used_limit_spot_sell | i4 | Not used |
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
Tables:
Table 89. Fields of table fee_all
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
time | i8 | Time |
p2login | c64 | Login |
sess_id | i4 | Session number |
points | i4 | Number of points assessed for a second time from |
fee | d16.2 | Incorrect transaction fee at the time of time |
Table 90. Fields of table fee_tn
Field | Type | Description |
---|---|---|
replID | i8 | Service field of the replication subsystem |
replRev | i8 | Service field of the replication subsystem |
replAct | i8 | Service field of the replication subsystem |
time | i8 | Time |
p2login | c64 | Login |
sess_id | i4 | Session number |
tn_type | i4 | Transaction type |
err_code | i4 | Error code |
count | i4 | Number of invalid transactions |
Message type: 64
Reply message type: 101
Table 92. Input parameters
Name | Type | Default value | Description |
---|---|---|---|
isin | c25 | Instrument ID | |
client_code | c3 | Client code | |
type | i4 | Order type | |
dir | i4 | Order direction | |
amount | i4 | Amount | |
price | c17 | Price | |
comment | c20 | "" | Order comment |
broker_to | c20 | "" | RTS code of the company to whom the direct order is addressed |
ext_id | i4 | 0 | External ID |
du | i4 | 0 | Sign of asset management order |
date_exp | c8 | "" | Order's expiration date |
hedge | i4 | 0 | Sign of hedging order |
dont_check_money | i4 | 0 | Whether to calculate client risks for given order |
match_ref | c10 | "" | Identical text values entered by both trade parties to match negotiated orders |
Return codes:
operation completed successfully
error
Notes:
The 'type'
field may
contain the following values:
quotation order (remains in queue after being partly matched)
counter-order (removed after auction end)
Fill-or-Kill order
The 'dir'
field may
contain the following values:
buy order
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.
Message type: 65
Reply message type: 129
Adds order on multileg instrument - calendar spread on futures
Table 94. Input parameters
Name | Type | Default value | Description |
---|---|---|---|
sess_id | i4 | 0 | Trading session ID |
isin_id | i4 | Multileg instrument ID | |
client_code | c3 | Client code | |
type | i4 | Order type | |
dir | i4 | Order direction | |
amount | i4 | Amount | |
price | c17 | Price | |
rate_price | c17 | Swap price | |
comment | c20 | "" | Order comment |
hedge | i4 | 0 | Sign of hedging order |
broker_to | c20 | "" | RTS code of the company to whom the direct order is addressed |
ext_id | i4 | 0 | External ID |
trust | i4 | 0 | Sign of asset management order |
date_exp | c8 | "" | Order's expiration date |
trade_mode | i4 | Order type | |
dont_check_money | i4 | 0 | Whether to calculate client risks for given order |
match_ref | c10 | "" | Identical text values entered by both trade parties to match negotiated orders |
Return codes:
operation completed successfully
error
Notes:
The 'type'
field may
contain the following values:
quotation order (remains in queue after being partly matched)
counter-order (removed after auction end)
Fill-or-Kill order
The 'dir'
field may
contain the following values:
buy order
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:
Repo
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.
Message type: 37
Reply message type: 102
Return codes:
operation completed successfully
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).
Message type: 38
Reply message type: 103
Return codes:
operation completed successfully
error
Notes:
The 'buy_sell'
parameter may contain the following values:
Buy orders
Sell orders
All orders
all orders out of limits (may be useful after intermrdiate clearing session)
The 'non_system'
parameter may contain the following values:
Common orders
Non-system orders
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.
Message type: 39
Reply message type: 105
Table 100. Input parameters
Name | Type | Default value | Description |
---|---|---|---|
regime | i4 | Mode | |
order_id1 | i8 | ID of the 1st order to remove | |
amount1 | i4 | 0 | New amount for the 1st order |
price1 | c17 | "0" | New price for the 1st order |
ext_id1 | i4 | 0 | New external ID for the 1st order |
order_id2 | i8 | 0 | ID of the 2nd order to remove |
amount2 | i4 | 0 | New amount for the 2nd order |
price2 | c17 | "0" | New price for the 2nd order |
ext_id2 | i4 | 0 | New external ID for the 2nd order |
Return codes:
operation completed successfully
error
Notes:
The 'regime'
parameter defines the command work mode. It may contain the
following values:
Do not change volumes of orders. The current volume of orders remains unchanged, the newly sent volumes are ignored.
Change volumes of orders. If there is any order found, it will be replaced with the new order with new price and volume.
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.
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.
Message type: 66
Reply message type: 109
Table 102. Input parameters
Name | Type | Default value | Description |
---|---|---|---|
isin | c25 | Instrument ID | |
client_code | c3 | Client code | |
type | i4 | Order type | |
dir | i4 | Order direction | |
amount | i4 | Amount | |
price | c17 | Price | |
comment | c20 | "" | Order comment |
broker_to | c20 | "" | RTS code of the company to whom the direct order is addressed |
ext_id | i4 | 0 | External ID |
du | i4 | 0 | Sign of asset management order |
check_limit | i4 | 0 | Flag of checking limits |
date_exp | c8 | "" | Order's expiration date |
hedge | i4 | 0 | Sign of hedging order |
dont_check_money | i4 | 0 | Whether to calculate client risks for given order |
match_ref | c10 | "" | Identical text values entered by both trade parties to match negotiated orders |
Return codes:
operation completed successfully
error
Notes:
The 'type'
field may
contain the following values:
Quotation order (remains in queue after being partly matched)
Counter-order (removed after auction end)
Fill-or-Kill order
The 'dir'
field may
contain the following values:
buy order
sell order
The 'price'
field
contains the order price as string: 'nnnnnnnnnn.mmmmm'.
The 'check_limit'
field may contain the following values:
Do not verify limits
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.
Message type: 42
Reply message type: 110
Return codes:
operation completed successfully
error
Message type: 43
Reply message type: 111
Return codes:
operation completed successfully
error
Notes:
The 'buy_sell'
parameter may contain the
following values:
Buy orders
Sell orders
All orders
The 'non_system'
parameter may contain the following values:
Non-system orders
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).
Message type: 44
Reply message type: 113
Table 108. Input parameters
Name | Type | Default value | Description |
---|---|---|---|
regime | i4 | Mode | |
order_id1 | i8 | ID of the 1st order to remove | |
amount1 | i4 | 0 | New amount for the 1st order |
price1 | c17 | "0" | New price for the 1st order |
ext_id1 | i4 | 0 | New external ID for the 1st order |
check_limit | i4 | 0 | Flag of checking limits |
order_id2 | i8 | 0 | ID of the 2nd order to remove |
amount2 | i4 | 0 | New amount for the 2nd order |
price2 | c17 | "0" | New price for the 2nd order |
ext_id2 | i4 | 0 | New external ID for the 2nd order |
Return codes:
operation completed successfully
error
Notes:
The 'regime'
parameter defines the command work mode. It may contain the
following values:
Do not change volumes of orders. The current volume of orders remains unchanged, the newly sent volumes are ignored.
Change volumes of orders. If there is any order found, it will be replaced with the new order with new price and volume.
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.
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:
Do not verify limits
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.
Message type: 63
Reply message type: 104
The command allows to change funds limits for a client's account.
Table 110. Input parameters
Name | Type | Default value | Description |
---|---|---|---|
mode | i4 | Mode | |
code | c3 | Client code | |
limit_money | c17 | "0" | Funds limit |
limit_pledge | c17 | "0" | Collateral limit |
coeff_liquidity | c17 | "0" | Liquidity ratio for futures |
coeff_go | c17 | "1" | Client’s collateral ratio |
is_auto_update_limit | i4 | -1 | Flag of automatic adjustment of the limit by the amount of income after clearing |
is_auto_update_spot_limit | i4 | -1 | Flag of automatic adjustment of limits for RTS standard instruments (buy and sell) when downloading after clearing |
limit_spot_buy | c17 | "-1" | Limit for buying RTS standard instruments |
no_fut_discount | i4 | 0 | Flag of prohibition to provide discounts for futures |
check_limit | i4 | 0 | Flag for allowing or prohibition of limit checks |
num_clr_2delivery | i4 | 0 | Number 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 |
Return codes:
operation completed successfully
error
Notes:
Command work mode (the 'mode'
field):
Remove limit for roubles
Remove limit for collaterals
Remove limits for roubles, collaterals and spots
Set limits for roubles, collaterals and spots
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:
Use collaterals discount for futures
Do not use collaterals discount for futures
The following values are set in the check_limit
parameter:
Do not verify. Change limit unconditionally.
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.
Message type: 33
Reply message type: 106
The command allows to change client parameters for underlying assets.
Return codes:
operation completed successfully
error
Notes:
Themode
field
specifies the command work mode:
remove limit
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'.
Message type: 14
Reply message type: 114
The command allows to change underlying assets parameters for brokerage firm.
Return codes:
operation completed successfully
error
Notes:
'mode'
field specifies
the command work mode
remove limit
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'.
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.
Return codes:
operation completed successfully
error
Notes:
Comand work mode (the 'mode'
field):
Set limits equal tolimit_money
andlimit_pledge
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.
Message type: 16
Reply message type: 116
The command allows to change the funds parameters for a BF.
Return codes:
operation completed successfully
error
Notes:
Command work mode (the 'mode'
field):
Remove
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 =''.
Message type: 12
Reply message type: 112
Return codes:
operation completed successfully
error
Notes:
Command work mode (the 'mode'
field):
Remove
Paste/Refresh
The key fields for expiration orders are:'isin'
and'code'
.
When executing 'Delete' or 'Update', it is allowed to set:
code
and isin
are not used for searching)
order_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.
Message type: 15
Reply message type: 115
Return codes:
operation completed successfully
error
Notes:
The 'mode'
field
specifies the command work mode:
remove
set
The 'state'
field may contain the following values:
prohibited to open positions
prohibited to place any order
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.
Message type: 17
Reply message type: 117
Return codes:
operation completed successfully
error
Notes:
Command work mode (the 'mode'
field):
remove
set
The 'state'
field is
a bit mask
The first two bits define the numerical value:
prohibited to open positions
prohibited to place any order
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.
Message type: 35
Reply message type: 130
The command allows to transfer funds between two BF belonging to the same CF.
Return codes:
operation completed successfully
error
Notes:
Command work mode (the'mode'
field):
Transfer only at trading
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.
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.
Return codes:
operation completed successfully
error
Message type: 61
Reply message type: 137
The command allows to transfer futures positions between your brokerage firms' accounts.
Return codes:
operation completed successfully
error
Notes:
To get access to the procedure, a clearing firm's login must obtain the sufficient rights from the Trading administrator.
Message type: 62
Reply message type: 138
The command allows to transfer options positions between your brokerage firms' accounts.
Return codes:
operation completed successfully
error
Notes:
To get access to the procedure, a clearing firm's login must obtain the sufficient rights from the Trade administrator.
Message type: 10000
The heartbeat message informs the client connection monitoring service that this client login is active.
Table 134. Input parameters
Name | Type | Default value | Description |
---|---|---|---|
seq_number | i4 | 0 | Sequence 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'.
Return code | Description |
---|---|
-1 | Error performing operation. |
0 | Operation successful. |
1 | User not found. |
2 | Brokerage Firm code not found. |
3 | Session inactive. |
4 | Session halted. |
5 | Error performing operation. |
6 | Insufficient rights to perform operation. |
7 | Wrong account. Cannot perform operation. |
8 | Insufficient rights to perform order deletion. |
9 | Operations with orders are blocked for the firm by the Clearing Centre. |
10 | Insufficient funds to reserve. |
12 | Options premium exceeds the limit allowed. |
13 | Total amount of positions exceeds the market limit. |
14 | Order not found. |
25 | Unable to add order: prohibited by the Trading Administrator. |
26 | Unable to open position: prohibited by Trading Administrator. |
27 | Unable to open short position: prohibited by Trading Administrator. |
28 | Unable to perform operation: insufficient rights. |
31 | Matching order for the same account/ITN is not allowed. |
32 | Trade price exceeds the limit allowed. |
33 | Operations with orders are blocked for this firm by the Clearing Administrator. |
34 | Cannot perform operation: wrong client code. |
35 | Invalid input parameters. |
36 | Cannot perform operation: wrong underlying. |
37 | Multi-leg orders cannot be moved. |
38 | Negotiated orders cannot be moved. |
39 | Price is not a multiple of the tick size. |
40 | Unable to add Negotiated order: counterparty not found. |
41 | User's trading rights have expired or are not valid yet. |
42 | Operations are prohibited by Chief Trader of Clearing Firm. |
44 | Clearing Firm's Chief Trader flag not found for this firm. |
45 | Unable to add Negotiated orders: no RTS code found for this firm. |
46 | Only Negotiated orders are allowed for this security. |
47 | There was no trading in this security during the session specified. |
48 | This security is being delivered. Only Negotiated orders from all Brokerage Firms within the same Clearing Firm are allowed. |
49 | Unable to add Negotiated order: a firm code must be specified. |
50 | Order not found. |
53 | Error setting input parameter: amount too large. |
54 | Unable to perform operation: exceeded operations quota for this client. |
56 | Unable to perform operations using this login/code pair: insufficient rights. Please contact the Trading Administrator. |
57 | Unable to connect to the Exchange server: insufficient rights. Please contact the Trading Administrator. |
58 | Unable to add orders without verifying client funds sufficiency: insufficient rights. |
60 | Auction halted for all risk-netting instruments. |
61 | Trading halted in all risk-netting instruments. |
62 | Trading halted on the MOEX Derivatives Market. |
63 | Auction halted in all risk-netting instruments with this underlying. |
64 | Trading halted in all risk-netting instruments with this underlying. |
65 | Trading halted on all boards in all securities with this underlying. |
66 | Trading halted in this risk-netting instrument. |
67 | Unable to open positions in this risk-netting instrument: prohibited by the Trading Administrator. |
68 | Unable to add orders for all risk-netting instruments: prohibited by the Brokerage Firm. |
69 | Unable to add orders for all risk-netting instruments: prohibited by the Chief Trader. |
70 | Trading operation is not supported. |
71 | Position size exceeds the allowable limit. |
72 | Order is being moved. |
73 | Aggregated buy order quantity exceeds the allowable limit. |
74 | Aggregated sell order quantity exceeds the allowable limit. |
200 | Collateral calculation parameters are being changed by the Trading Administrator. |
201 | Collateral calculation parameters are being changed by the Trading Administrator. |
202 | Collateral calculation parameters are being changed by the Trading Administrator. |
203 | Collateral calculation parameters are being changed by the Trading Administrator. |
204 | Collateral calculation parameters are being changed by the Trading Administrator. |
205 | Collateral calculation parameters are being changed by the Trading Administrator. |
206 | Collateral calculation parameters are being changed by the Trading Administrator. |
207 | Collateral calculation parameters are being changed by the Trading Administrator. |
208 | Collateral calculation parameters are being changed by the Trading Administrator. |
310 | Unable to add order: prohibited by Clearing Administrator. |
311 | Unable to open position: prohibited by Clearing Administrator. |
312 | Unable to open short position: prohibited by Clearing Administrator. |
314 | Unable to add orders in the client account: prohibited by the Trader. |
315 | Unable to open position in the client account: prohibited by the Trader. |
316 | Unable to open short position in the client account: prohibited by the Trader. |
317 | Amount of buy/sell orders exceeds the limit allowed. |
318 | Unable to add order for the client account: client does not have a deposit account for settlement of Money Market securities. Prohibited by Clearing Administrator. |
320 | Amount of active orders exceeds the limit allowed for the client account for this security. |
332 | Insufficient client funds. |
333 | Insufficient Brokerage Firm funds. |
334 | Insufficient Clearing Firm funds. |
335 | Unable to buy: amount of securities exceeds the limit set for the client. |
336 | Unable to buy: amount of securities exceeds the limit set for the Brokerage Firm. |
337 | Unable to sell: amount of securities exceeds the limit set for the client. |
338 | Unable to sell: amount of securities exceeds the limit set for the Brokerage Firm. |
380 | Trading restricted while intraday clearing is in progress. |
381 | Trading restricted while intraday clearing is in progress: cannot delete orders. |
382 | Trading restricted while intraday clearing is in progress: cannot move orders. |
680 | Insufficient client funds. |
681 | Insufficient Clearing Firm funds. |
4000 | Invalid input parameters. |
4001 | Unable to perform operation: insufficient rights. |
4002 | Unable to change trading limit for the client: no active trading sessions. |
4004 | Unable to change trading limit for the client: client code not found. |
4005 | Unable to change the trading limit for the client: insufficient funds. |
4006 | Unable to set trading limit for the client: error performing operation. |
4007 | Unable to set trading limit for the client: error performing operation. |
4008 | Unable to set trading limit for the client: error performing operation. |
4009 | Unable to set trading limit for the client: error performing operation. |
4010 | Unable to set trading limit for the client: error performing operation. |
4011 | Unable to set trading limit for the client: error performing operation. |
4012 | Unable to set trading limit for the client: error performing operation. |
4013 | Unable to set trading limit for the client: error performing operation. |
4014 | Unable to change parameters: no active trading sessions. |
4015 | Unable to change parameters: client code not found. |
4016 | Unable to change parameters: underlying's code not found. |
4017 | Unable to set trading limit for the client: amount too large. |
4018 | Collateral calculation parameters are being changed by the Trading Administrator. |
4021 | Unable to set requested amount of pledged funds for Clearing Firm: insufficient amount of free funds. |
4022 | Unable to set requested amount of funds for Clearing Firm: insufficient amount of free funds. |
4023 | Unable to change trading limit for the Brokerage Firm: no active trading sessions. |
4024 | Unable to change trading limit for the Brokerage Firm: the Brokerage Firm is not registered for trading. |
4025 | Unable to set requested amount of pledged funds for the Brokerage Firm: insufficient amount of free funds in the Clearing Firm. |
4026 | Unable to set requested amount of funds for the Brokerage Firm: insufficient amount of free funds in the balance of the Separate Account. |
4027 | Unable to set requested amount of pledged funds for the Clearing Firm: insufficient amount of pledged funds in the balance of the Separate Account. |
4028 | Unable to set requested amount of funds for the Brokerage Firm: insufficient amount of free funds in the Clearing Firm. |
4030 | Unable to change parameters for the Brokerage Firm: no active sessions. |
4031 | Unable to change parameters for the Brokerage Firm: Brokerage Firm code not found. |
4032 | Unable to change parameters for the Brokerage Firm: underlying's code not found. |
4033 | Unable to change parameters for the Brokerage Firm: insufficient rights to trade this underlying. |
4034 | Transfer of pledged funds from the Separate account is prohibited. |
4035 | Transfer of collateral is prohibited. |
4040 | Unable to change Brokerage Firm limit on risk-netting: no active sessions. |
4041 | Unable to change Brokerage Firm limit on risk-netting: Brokerage Firm is not registered for trading. |
4042 | Unable to change Brokerage Firm limit on risk-netting: Brokerage Firm code not found. |
4043 | Unable to change Brokerage Firm limit on risk-netting: error performing operation. |
4044 | Unable to change Brokerage Firm limit on risk-netting: error performing operation. |
4045 | Unable to delete Brokerage Firm limit on risk-netting: error performing operation. |
4046 | Unable to remove Chief Trader's restriction on trading in risk-netting instruments: insufficient rights. |
4050 | Unable to process the exercise request: restricted by the Chief Trader. |
4051 | Unable to process the exercise request: restricted by the Brokerage Firm. |
4052 | Unable to process the exercise request: wrong client code and/or security. |
4053 | Unable to process the exercise request: cannot delete orders during the intraday clearing session. |
4054 | Unable to process the exercise request: cannot change orders during the intraday clearing session. |
4055 | Unable to process the exercise request: order number not found. |
4060 | Unable to process the exercise request: insufficient rights. |
4061 | Unable to process the exercise request: deadline for submitting requests has passed. |
4062 | Unable to process the exercise request: client code not found. |
4063 | Unable to process the exercise request: request not found. |
4064 | Unable to process the exercise request: insufficient rights. |
4065 | Unable to process the exercise request: option contract not found. |
4066 | Unable to process the exercise request: request to disable automatic exercise may only be submitted on the option's expiration date. |
4067 | Unable to process the exercise request: error performing operation. |
4068 | Unable to process the exercise request: error performing operation. |
4069 | Unable to process the exercise request: error performing operation. |
4070 | Unable to process the exercise request: insufficient amount of positions in the client account. |
4090 | No active sessions. |
4091 | Client code not found. |
4092 | Underlying's code not found. |
4093 | Futures contract not found. |
4094 | Futures contract does not match the selected underlying. |
4095 | Partial selection of futures contracts not accepted: underlying flag set 'For all'. |
4096 | Unable to remove limit: no limit set. |
4097 | Unable to remove: the Chief Trader's restriction cannot be removed by Brokerage Firm trader. |
4098 | Security not found in the current trading session. |
4099 | Both securities must have the same underlying. |
4100 | Exercise date of the near leg of a multi-leg order must not be later than that of the far leg. |
4101 | Unable to make a multi-leg order: lots are different. |
4102 | No position to move. |
4103 | The FOK order has not been fully matched. |
4104 | Anonymous repo order must contain a repo type. |
4105 | Order containing a repo type is restricted in this multi-leg order. |
4106 | Multi-leg orders can be added only on the Money Market. |
4107 | This procedure is not eligible for adding orders for multi-leg securities. |
4108 | Unable to trade risk-netting instruments in T0: insufficient rights. |
4109 | Rate/swap price is not a multiple of the tick size. |
4110 | The near leg price differs from the settlement price. |
4111 | The rate/swap price exceeds the limit allowed. |
4112 | Unable to set restrictions for multi-leg futures. |
4115 | Unable to transfer funds between Brokerage Firm accounts: no active sessions. |
4116 | Unable to transfer funds between Brokerage Firm accounts: the donor Brokerage Firm is not registered for trading. |
4117 | Unable to transfer funds between Brokerage Firms: the receiving Brokerage Firm is not registered for trading. |
4118 | Broker Firm does not have sufficient amount of free funds. |
4119 | Brokerage Firm does not have sufficient amount of collateral. |
4120 | Insufficient amount of free funds in the balance of the Separate account. |
4121 | Insufficient amount of collateral in the balance of the Separate Account. |
4122 | Clearing Firm does not have sufficient amount of free funds. |
4123 | Brokerage Firm does not have sufficient amount of collateral. |
4124 | Brokerage Firm code not found. |
4125 | Unable to transfer funds between accounts of different Clearing Firms. |
4126 | Unable to transfer: error while transferring. |
4128 | Brokerage firm does not have sufficient amount of free funds. |
4129 | Insufficient amount of free funds in the balance of the Separate Account. |
4130 | Clearing Firm does not have sufficient amount of free funds. |
4131 | Brokerage Firm code not found. |
4132 | Unable to withdraw: error in withdrawal logic. |
4133 | No requests to cancel. |
4134 | Brokerage Firm does not have sufficient amount of funds. |
4135 | Clearing firm does not have sufficient amount of funds. |
4136 | Prohibited to transfer pledged funds. |
4137 | Brokerage Firm does not have sufficient amount of pledged funds. |
4140 | Unable to transfer: position not found. |
4141 | Unable to transfer: insufficient number of open positions. |
4142 | Cannot transfer positions from the client account to an account with a different ITN. |
4143 | Unable to transfer position: the Brokerage Firms specified belong to different Clearing Firms. |
4144 | Cannot transfer positions to 'XXYY000' Brokerage Firm account. |
4145 | Unable to transfer positions for the selected Brokerage Firm: restricted by the Trading Administrator. |
4146 | Transferring positions in the selected securities is prohibited. |
4147 | Option contract not found. |
10579 | Price of the selected financial instrument is below acceptable value. |
10580 | Price of the selected financial instrument is above acceptable value. |