Abstract: A computation system for computing instantaneous summation values to indicate a balance statement for a plurality of users owning a plurality of items having price attributes changing at discrete time intervals, said computation system comprising: - first calculation means adapted to calculate profit values in relation to said price attributes of said items for each user; second calculation means adapted to calculate net positions per item for each user; third calculation means adapted to calculate net transaction values for said plurality of items for each user; database bank means adapted to store items and their corresponding instantaneous attributes in a user-wise row arrangement of items and price attributes in an array according to pre-defined rules, said database bank means comprising: first database means adapted to store first calculated values for each of said users; second database means adapted to store second calculated values for each of said users; third database values adapted to store third calculated values for each of said users; transposition means adapted to transpose stored storage arrangement from user-wise row arrangement to item-wise row arrangement and its corresponding price attributes; and processing means adapted to compute profit values of said items from said transposed items and item attributes.
FORM - 2
THE PATENTS ACT, 1970
(39 of 1970)
&
THE PATENTS RULES, 2003
PROVISIONAL SPECIFICATION
(See section 10 and rule 13)
SYSTEM FOR OPTIMIZING PROFIT AND LOSS COMPUTATIONS FOR RISK MANAGEMENT IN STOCK EXCHANGES
TATA CONSULTANCY SERVICES LIMITED,
an Indian Company of
Nirmal Building, 9th Floor,
Nariman Point, Mumbai - 21,
Maharashtra, India.
The following specification particularly describes the nature of the invention.
Field of the Invention:
This invention relates to computation systems for risk management.
Particularly, this invention relates to a system for Optimizing Profit and Loss Computations for Risk Management in Stock Exchanges.
Background of the Invention:
Most stock exchanges are in the process of defining their next generation architectures. Due to the advent of algorithmic trading it has become imperative for exchanges to support tens of thousands of orders or quotes per second with latencies of just a few milliseconds.
Exchanges need to perform risk computations to ensure that trading members and clearing members have sufficient collateral for clearing and settlement of trades. A number of risk computations are done to assess Value at Risk (VaR). One of the simplest computations is that of profit and loss (P&L).
However, even for a simple computation like P&L the number of computations per second can get in to millions and billions per second leading to large number of CPUs for computation. It is quite common to see investment banks and exchanges have computer farms of many servers for the purpose of risk management.
Generally, the equation used by the computational processes for calculating P&L is:
2
where,
the transaction value is the buy (quantity times price) or sell value at the
time of a trade, with buy being negative and sell being positive,
Netposition(A,s,t) is the net number of stocks of stock s that party A is holding at time t (this can be negative in some markets), and
LTP(s,t) is the last traded price of stock s at time t in the market
For a given sequence of trades, it is relatively easy to compute P&L for each party using the above formula. There is not provided a system for keeping the P&L updated with every price change, for example, in a situation where an actively traded stock has holdings across 1 million clients, then for ever}' trade, the P&L values of the clients has to be updated. If the stock trades hundred times per second, we need to update the P&L 100 million times a second.
Objects of the Invention:
An object of the invention is to maintain changes in stock prices and compute calculations which are updated with every price change of said stock prices.
Another object of the invention is to provide an optimized utilization of system resources for stock value computations.
3
Yet another object of this invention is to provide an efficient, quick, and responsive system for real-time stock value computations.
Brief Description of the Accompanying Drawings:
The invention will now be described in relation to the accompanying drawings, in which:
Figure 1 illustrates a schematic of the system for Optimizing Profit and Loss Computations for Risk Management in Stock Exchanges.
Detailed Description of the Invention:
Figure 1 illustrates a schematic of the system for Optimizing Profit and Loss Computations for Risk Management in Stock Exchanges, in accordance with this invention.
According to this invention, there is provided a system (100) for aiding computations in the stock market, said system adapted to provide an enhanced computation rate.
In accordance with an embodiment of this invention, there is provided a stock order arrangement and database means (10) adapted to arrange the list of stocks with respect to a client in a pre-defined manner and store it in appropriate databases.
Typically, a first database means (12) is adapted to store data relating to profit and loss values per client.
4
Typically, a second database means (14) is adapted to store data relating to net positions per stock.
Typically, a third database means (16) is adapted to store data relating to net transaction values.
A database (18) with the format of a two dimensional array is used to stored the data in row order. Thus, all the data e.g. for a first client for all stocks, followed by all the data for a second client for all stocks, and so on, is stored. However, updating of P&L for all clients for a given stock, rather than all stocks for a given client, is carried out. It would therefore help to transpose the order of storage.
This change boosts the processing speed from 320 to 4800 trades/sec.
In accordance with yet another embodiment of this invention, there is provided a computation means (20) adapted to compute differences in old traded price of a stock and the current traded price of a stock and further adapted to multiply said computed difference with last traded price of stock.
This change boosts the throughput from 4800 to 5300 trades/sec.
In accordance with still another embodiment of this invention, there is provided an identifier means (22) adapted to identify stocks which are 'cold' such that their positions are zero i.e. unaffected. So, computations are only done on stocks which are not 'cold' i.e. those not having their positions as zero.
5
The optimization results in throughput increase from 5300 to 8000 trades/sec.
In accordance with an additional embodiment of this invention, there is
provided a sparse matrix representation means (24) adapted to collate,
store, and thus represent the list of clients per stock in space matrix
representation format. Typically, when an update relating to profit or loss of
a stock occurs, updation relating to the same occurs only in this represented
means. Typically, all cold stocks are assigned a value zero in this matrix
representation, and the stocks where changes occur are assigned a value in a
pre-defined manner. ' .
Performing this optimization, the throughput jumps from 8000 to 25000 trades/sec.
In accordance with still an additional embodiment of this invention, there is provided an array clustering means (26) adapted to assimilate a plurality of arrays for storing various components relating to stock value calculations, and provide them in a clustered format/structure instead of different arrays. This optimizes memory access through caching.
This optimization boosts the throughput from 25,000 to 60,000 traded/sec.
In accordance with yet an additional embodiment of this invention, there is provided a batch driven computation means (28) for maintaining a balance of the throughput as well as the time lag that occurs between
6
updation of stock value and conveying the updated stock value to users/customers for trading. It is common to have trading alerts sent to control users who may act upon them a few seconds after the alert is generated. If this lag is trimmed down to milliseconds, then it is possible to use batches of 100 to 1000 trades for computation by the batch driven computation means. Specifically, computations for netposition and netvalue may be done trade by trade, but the computation for the impact of change in Itp may be done only for the last ltp of a stock in any given batch.
For a batch size of 100 trades, the throughput is 100,000 trades/sec and for a batch size of 1000 trades, the throughput is 350,000 trades/sec.
In accordance with still an embodiment of this invention, there is provided a parallel processing flagging means (30) adapted to provide appropriate flags which allow the compiler to automatically fork and join loops in the computation systems.
Typically, using openmp with Intel C compiler on an 8 core server, the throughput of 1 million trades/sec using 32 threads may be achieved.
The optimizations mentioned as a part of this specification are explained in relation to risk management in stocks and stock exchange computations, but can be extended to any sphere of activity which involve risk management computations.
The technical advancement of the system of this invention lies in the art of providing:
7
compiling means with optimization flagging means;
transposing array means for transposing array declarations to have
stock dimensions declared first followed by client dimensions;
use of partial summation means and delta computation means for
differential values from previous loop iteration means;
means for skipping records with zero values that would lead to
redundant computations;
storing means for storing sparse matrix data in to lists indexed by
stock;
clustering means for clustering related arrays in to a single array of
structures;
batch and timer driven computation means; and
means for parallel processing directives in compilers.
While considerable emphasis has been placed herein on the particular features of this invention, it will be appreciated that various modifications can be made, and that many changes can be made in the preferred embodiments without departing from the principles of the invention. These and other modifications in the nature of the invention or the preferred embodiments will be apparent to those skilled in the art from the disclosure herein, whereby it is to be distinctly understood that the foregoing descriptive matter is to be interpreted merely as illustrative of the invention and not as a limitation.
Dated this 01st day of July 2009
MOHAN DEW AN
Of R. K. DEW AN & CO.
APPLICANT'S PATENT ATTORNEY
9
| # | Name | Date |
|---|---|---|
| 1 | 1567-MUM-2009-FORM 1(11-11-2009).pdf | 2009-11-11 |
| 1 | 1567-MUM-2009-Response to office action (Mandatory) [21-01-2020(online)].pdf | 2020-01-21 |
| 2 | 1567-MUM-2009-ORIGINAL UR 6(1A) FORM 26-210519.pdf | 2020-01-10 |
| 2 | 1567-MUM-2009-CORRESPONDENCE(11-11-2009).pdf | 2009-11-11 |
| 3 | 1567-MUM-2009-Written submissions and relevant documents (MANDATORY) [10-06-2019(online)].pdf | 2019-06-10 |
| 3 | 1567-MUM-2009-FORM 18(30-11-2010).pdf | 2010-11-30 |
| 4 | 1567-MUM-2009-FORM-26 [20-05-2019(online)].pdf | 2019-05-20 |
| 4 | 1567-MUM-2009-CORRESPONDENCE(30-11-2010).pdf | 2010-11-30 |
| 5 | Examination Report Reply Recieved [12-07-2016(online)].pdf | 2016-07-12 |
| 5 | 1567-MUM-2009-HearingNoticeLetter.pdf | 2019-05-06 |
| 6 | Description(Complete) [12-07-2016(online)].pdf | 2016-07-12 |
| 6 | 1567-MUM-2009-ABSTRACT(1-7-2010).pdf | 2018-08-10 |
| 7 | Claims [12-07-2016(online)].pdf | 2016-07-12 |
| 7 | 1567-MUM-2009-CLAIMS(1-7-2010).pdf | 2018-08-10 |
| 8 | Abstract [12-07-2016(online)].pdf | 2016-07-12 |
| 8 | 1567-MUM-2009-CORRESPONDENCE(1-7-2010).pdf | 2018-08-10 |
| 9 | 1567-mum-2009-correspondence.pdf | 2018-08-10 |
| 9 | RTOA 1567_MUM_2009.pdf | 2018-08-10 |
| 10 | 1567-MUM-2009-DESCRIPTION(COMPLETE)-(1-7-2010).pdf | 2018-08-10 |
| 10 | CS-Mark+Clean.pdf | 2018-08-10 |
| 11 | CLAIMS-Mark+Clean.pdf | 2018-08-10 |
| 12 | 1567-mum-2009-description(provisional).pdf | 2018-08-10 |
| 12 | abstract1.jpg | 2018-08-10 |
| 13 | 1567-MUM-2009-DRAWING(1-7-2010).pdf | 2018-08-10 |
| 13 | ABS-Mark+Clean.pdf | 2018-08-10 |
| 14 | 1567-mum-2009-drawing.pdf | 2018-08-10 |
| 14 | 1567-MUM-2009_EXAMREPORT.pdf | 2018-08-10 |
| 15 | 1567-mum-2009-form 1.pdf | 2018-08-10 |
| 15 | 1567-MUM-2009-FORM 5(1-7-2010).pdf | 2018-08-10 |
| 16 | 1567-mum-2009-form 3.pdf | 2018-08-10 |
| 17 | 1567-mum-2009-form 26.pdf | 2018-08-10 |
| 18 | 1567-mum-2009-form 2.pdf | 2018-08-10 |
| 20 | 1567-mum-2009-form 2(title page).pdf | 2018-08-10 |
| 21 | 1567-MUM-2009-FORM 2(TITLE PAGE)-(1-7-2010).pdf | 2018-08-10 |
| 22 | 1567-mum-2009-form 2(1-7-2010).pdf | 2018-08-10 |
| 23 | 1567-mum-2009-form 1.pdf | 2018-08-10 |
| 24 | 1567-mum-2009-drawing.pdf | 2018-08-10 |
| 25 | 1567-MUM-2009-DRAWING(1-7-2010).pdf | 2018-08-10 |
| 26 | 1567-mum-2009-description(provisional).pdf | 2018-08-10 |
| 28 | 1567-MUM-2009-DESCRIPTION(COMPLETE)-(1-7-2010).pdf | 2018-08-10 |
| 29 | 1567-mum-2009-correspondence.pdf | 2018-08-10 |
| 30 | 1567-MUM-2009-CORRESPONDENCE(1-7-2010).pdf | 2018-08-10 |
| 31 | 1567-MUM-2009-CLAIMS(1-7-2010).pdf | 2018-08-10 |
| 32 | 1567-MUM-2009-ABSTRACT(1-7-2010).pdf | 2018-08-10 |
| 33 | 1567-MUM-2009-HearingNoticeLetter.pdf | 2019-05-06 |
| 34 | 1567-MUM-2009-FORM-26 [20-05-2019(online)].pdf | 2019-05-20 |
| 35 | 1567-MUM-2009-Written submissions and relevant documents (MANDATORY) [10-06-2019(online)].pdf | 2019-06-10 |
| 36 | 1567-MUM-2009-ORIGINAL UR 6(1A) FORM 26-210519.pdf | 2020-01-10 |
| 37 | 1567-MUM-2009-Response to office action (Mandatory) [21-01-2020(online)].pdf | 2020-01-21 |