Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and...

25
Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology Officer, Reech Capital PLC Tel: +44 20 7623 6333, Email: [email protected]

Transcript of Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and...

Page 1: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Moving Towards Real-TimeRisk Analysis for

Exotic Derivative Portfolios

ICBI Global Derivatives and Risk Management, May 2002:Stephen Taylor, Chief Technology Officer, Reech Capital PLCTel: +44 20 7623 6333, Email: [email protected]

Page 2: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

CONTENTS

• Why Real-Time Risk Management• Typical Risk Management for Equities,

FI, FX and Credit Portfolios• Limitations of the traditional approach• How do we do this Real-Time Risk

Management• Conclusion

Page 3: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Why Real Time Risk Analysis?

• Protect value of your portfolio in fast moving markets.

• Increasing complexity and non-linearity of products makes this more important.

• Quicker quoting of potential deals• Real time view of overall risk position when

new trades are added• If you have more power there, it is then

possible to do other analysis such as hedge simulations

• Reduce operational costs through more efficient use of resources

Page 4: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

• “Just because you’re trading exotics doesn’t mean the market moves any slower”

• “In fast moving markets you should be able to re-hedge as quickly as vanilla traders”

Real time risk analysis for exotics will drive on competition and increase volumes in the OTC market, a market that

is increasingly becoming electronically based.

Real time risk analysis for exotics will drive on competition and increase volumes in the OTC market, a market that

is increasingly becoming electronically based.

Page 5: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Typical Risk Analysis• Equity Derivatives

– 150 positions average term 3-5 years– Typically local vol or modified Black Scholes PDE and

MC– 10 minutes a single CPU to calculate Deltas,

Gammas, Parallel Rhos, and parallel Vegas.– In addition Rho strips, Vega buckets, perhaps cross

Gammas and DVega / DVol for several percentage spot moves can take about 10 hours on a single CPU. Even if split by book calculation time can still be in the order of hours.

Page 6: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Typical Risk Analysis • Exotic Interest Rate Portfolios

– usually 250 positions average term 15 years– HJM, Black Karazinski etc. 1-3 Factor lattice / tree and

MC.– Calibration and Pricing for delta and parallel vega

can take at least 25 minutes on a single CPU– More comprehensive risk with delta and gamma for

each yield curve instrument and different rate moves could take approximately 20 hours on a single CPU.

– Hedge calculation may use less complex model than pricing for performance reasons.

Page 7: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Typical Risk Analysis• FX Exotics Portfolio including Flow trades

– 10,000 positions average term 3 months– Modified Black Scholes or hybrid stochastic / local vol

models– Pricing using Black Scholes with basic risk can take 30 mins

on a single CPU– Hybrid stochastic vol models with basic risk can take 4 – 20

hours depending on the model.– Full risk with delta, gamma, vega buckets, dVega / dVol

buckets, and all cross gamma/vegas for each of 10 spots can take at least 20 hours on a single CPU.

– Full risk for more advanced models is very computationally expensive.

– Full risk is usually only calculated using Black Scholes and on several machines if provided intra-day.

Page 8: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Typical Risk Analysis

• Credit Derivative Portfolios– 1000 Vanilla credit default swaps, 500

callable asset swaps, 20 first-to-default baskets and 10 synthetic CDOs.

– Deterministic, Simple 1-factor tree and MC first-to-default.

– Pricing will take about 5 mins for a single CPU.

– Full risk can take up to 10 hours for a single CPU.

Page 9: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Limitations of Traditional Approach– Pseudo real time risk is very limited – just enough for an

initial delta hedge– More accurate risk takes hours. – Difficult to provide comprehensive risk using more

advanced models.– Difficult to provide comprehensive risk for more complex

hybrid products.– Spot ladders when used with equities are a good first

impression of risk e.g. for the desk head. Too crude to rely on for trading and can lead to missed opportunities.

– Holes in the payoff of highly non-linear products can be missed between spot buckets.

• no real time risk position• difficult to get a risk analysis of the whole book when new products are added to the portfolio• Without knowing the net exposure of the current portfolio it makes it difficult to price new business.

Page 10: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

What should be the characteristics of a real time risk management

system?• Be able to calculate the full

risk on a typical portfolio in about 10 minutes

• Staged delivery – the important risk first

• Full risk on complex hybrid product in the same time as a single PV.

• The ability to add new products and models quickly

• Cost effective – avoid using expensive multi-processor boxes

Architecture

Resilient

Scalable

Flexible Delivery

Cheap

Page 11: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

How do we do this?

• You will need all of the following:– Quick access to market data– Quick access to the booking and

reporting hierarchies. – Quick access to the deal information.– Massive calculation power– Efficient protocols– Thin front ends to bring all this

together

Page 12: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Quick Access to Market Data

• Consolidate feeds from all the various sources• Dynamically create derived data• These feeds must asynchronously update a

cache within the market data server so that consistent data is always immediately available.

• Extremely efficient protocol. Market Data for an entire portfolio can fit into 100-200 Kbytes using compressed binary formats.

• Fast transmission over the network.• One Server call should get the entire market

data for a portfolio.

Page 13: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Quick Access to the Booking and reporting hierarchies

• Booking hierarchy can simply be a relational database table scaled with replication.

• Better to abstract this behind a server architecture thus allowing data to be presented in different ways to different front ends / services.

Page 14: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Quick Access to the deal information

• For portfolio pricing the loading of the deals, especially for FX where there are large numbers, can be a significant proportion of the calculation time.

• For applications to have quick response times this must be written very efficiently.

• We need to be able to add new products and model types easily.

Page 15: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

What data format should be used for storing deals?

• One way – some generic script like ADEP where new products can be added without compilation.

• Object databases storing objects in native C++

• Binary serialisation to servers with compression.

• Mixtures of the above.• When loading a portfolio it’s

a good idea to load all the trades in a single call.

An Asian Equity Basket described using the ADEP structuring language shown above in FastVal, the on-line portfolio valuation service for exotic derivatives.

Page 16: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

What data format not to use?

• Relational database which stores all the complex and diverse derivatives info in many tables– Is difficult to understand– Is slow to save and load– There are usually nasty Stored Procedures /

Views with business logic that underpin the loading and saving. Stored Procedures need to be kept in synch with application code.

– Adding new products is difficult and if you get it wrong it can affect existing products.

Page 17: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Calculation Power• Traditional approaches:

– Each book calculated on a different client PC:• Limited power prevents use of more sophisticated models

– Multi processor boxes:• These machines are very expensive. • Very difficult to write and test complex multi-threaded

applications needed to take advantage of these machines.• Limited scalability of one machine without writing distributed

algorithms.• If you need to do this – why bother with multi-threading in the

first place?– Split Portfolio by book across many machines:

• It is a manual process to work out how long each sub portfolio will take to calculate.

• This won’t calculate risk on one very complex trade across many machines.

Page 18: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Calculation Power – a solution• Distributed processing with load balancing over many

machines in parallel. • Message Passing protocols• The risk software needs to be able to split down all the

risk calculations into individual PVs.• Very efficient protocols for copying market data and

deal information.• Run on cheap reliable hardware. • For example IBM x330 dual CPUs connected to a very

fast switch. One rack could contain 80 CPUs and the switch. Up to 256 machines per cluster (512 CPUS for x330s). This is the non-blocking performance of the switch.

Page 19: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Parallel Processing

Tasks are sent to the cluster’s master servers. Slave processors then get tasks from the master and compute. Results are returned to the master. Slaves process tasks in parallel.

1 to many IBM x330 dual processor machines in a Beowulf clustered configuration.

Mixed Exotic Derivatives Portfolio Each position in the portfolio is broken down into its constituent elements. All booking, deal information and market data is sent to a Negotiator.

The Negotiator compiles a list of tasks that need to be calculated

Slaves

Master

(x3 for resilience)

Market Data

Negotiator

The Parallel approach – a Calculation Cluster

Page 20: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Benefits of the Calculation Cluster Approach

• Very Cost effective. Price per CPU around $1500.• Very high scalability. Because software already

designed to be distributed it is easy to scale over many clusters if required.

• Naturally a resilient configuration. When a node of the cluster fails, calculations in progress will carry on unaffected.

• Makes efficient use of available hardware. • No difficult multi-threaded applications to write, debug

and test.• Easy to get full performance from a cluster in

comparison with SMP boxes with large numbers of processors, especially when memory is being shared aggressively.

• Cluster will run on heterogeneous hardware for example a cluster could comprise of several dual CPU PCs, a quad and a 16-way UNIX server all with different processor speeds.

The graph shows the difference in cost between an average industry standard SMP box with 64 processors (bar on left) and the cost of purchasing 32 IBM x330 dual processor boxes [>£1m versus £100k].

Page 21: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Disadvantages of cluster

• Many operating system installs– However this can be alleviated by setting up

the cluster to network boot and automatically install from an administration node.

– And operating system free if using LINUX.

• Need to write application to take of advantage of distributed processing– This needs to be done anyway to get true

scalability beyond a single large SMP box.

Page 22: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Calculation PerformanceThe graph below shows the results of performing a risk analysis on a mixed exotic derivatives

portfolio while gradually increasing the number of processors

Number of processors

Log (Time)

The blue line shows the computation time for an industry standard 16 CPU SMP box.

The red line shows the same computation time using a parallel cluster of 64 processors

Page 23: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Risk in 10 Minutes• Equity Derivative Portfolio

– 60 CPUs• Interest Rate Exotics Portfolio

– 120 CPUs• FX Exotic Portfolio

– 120 CPUs for full risk for Black Scholes– Several clusters for full risk on Hybrid

Stoch/Local Vol.• Credit Derivatives Portfolio

– 60 CPUs

Page 24: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Pricing and risk management front end

• Excel should be able to be used as a thin front end or to do the same calculations locally for tactical and development purposes. This implies that the protocols used within Excel should be identical to those used in other application layers.

• Web – this is just another thin front end but much easier to provide rich user interface and global access.

• As all the functionality of the system is available in both Excel and the other application layers, new products can be pushed ‘live’ in the risk management system quickly.

Page 25: Moving Towards Real-Time Risk Analysis for Exotic Derivative Portfolios ICBI Global Derivatives and Risk Management, May 2002: Stephen Taylor, Chief Technology.

Conclusion• Real time risk analysis has benefits in a fast

moving market and for greater understanding of exotic risk.

• With the following it’s possible to provide pseudo real time risk:– Efficient retrieval of deal and market information– Fast serialisation for the movement and copying of data– Risk analytics optimised for distributed computing– Cluster of vanilla hardware which scales linearly to large

numbers of CPUs