Cover Page

For other titles in the Wiley Finance Series
please see

The xVA Challenge

Counterparty Credit Risk, Funding, Collateral and Capital

Third Edition

Jon Gregory

Wiley Logo

To Sylvia, Mimsie, Stella, Cara, Eliza-Joy, Stevie, Peach, Jim, Ginnie, George and Christy

Lists of Spreadsheets

One of the key features of the first and second editions of this book was the accompanying spreadsheets that were prepared to allow the reader to gain some simple insight into some of the quantitative aspects discussed. Many of these examples have been used for training courses and have therefore evolved to be quite intuitive and user-friendly.

The spreadsheets can be downloaded freely from Jon Gregory's website,, under the counterparty risk section. New examples may be added over time.

Spreadsheet 4.1Counterparty risk for a forward contract-type exposure
Spreadsheet 6.1Collateral calculation including thresholds and initial margins
Spreadsheet 7.1EE and PFE for a normal distribution
Spreadsheet 7.2EPE and EEPE example
Spreadsheet 7.3Simple example of a cross-currency swap profile
Spreadsheet 7.4Simple calculation of the exposure of a CDS
Spreadsheet 7.5Simple two-transaction example of netting effects
Spreadsheet 8.1Joint default probability calculation
Spreadsheet 8.2Calculation of “alpha” factor
Spreadsheet 10.1Semi-analytical calculation of the exposure for a swap
Spreadsheet 10.2 Simple simulation of an interest rate swap exposure
Spreadsheet 10.3 Illustration of the impact of netting
Spreadsheet 10.4 Example marginal exposure calculation
Spreadsheet 10.5 Incremental exposure calculations
Spreadsheet 10.6 Marginal exposure calculation
Spreadsheet 11.1 Quantifying the impact of collateral on exposure
Spreadsheet 12.1 Calculating risk-neutral default probabilities
Spreadsheet 12.2 Impact of credit curve shape on risk-neutral default probabilities
Spreadsheet 14.1 Simple CVA calculation
Spreadsheet 14.2 Simple BCVA calculation
Spreadsheet 15.1 Example FVA calculation
Spreadsheet 17.1 Simple wrong-way risk example
Spreadsheet 19.1 Simple xVA calculator

Lists of Appendices

The following is a list of Appendices that contain additional mathematical detail. These Appendices can be downloaded freely from

Appendix 7A Simple formula for the EE, PFE and EPE of a normal distribution
Appendix 7B Simple representation of exposures profiles
Appendix 7C Exposure profile of a cross-currency swap
Appendix 7D Simple netting formula
Appendix 8A LHP approximation and IRB formula
Appendix 8B Double default formula
Appendix 8C Standardised method
Appendix 8D Treatment of EAD for repo transactions
Appendix 10A Exposure and swaption analogy
Appendix 10B Comments on exposure models by asset class
Appendix 10C Computation of incremental and marginal exposure
Appendix 11A Simple formula for the impact of collateral on exposure
Appendix 11B Approximate ratio for uncollateralised and collateralised EPE
Appendix 11C Impact of initial margin on exposure
Appendix 12A Additional details on risk-neutral default probability calculations
Appendix 14A Derivation of standard CVA formula
Appendix 14B CVA computation details
Appendix 14C Approximate CVA formula
Appendix 14D CVA for a long option position
Appendix 14E Incremental CVA formula
Appendix 14F Bilateral CVA formula
Appendix 17A Simple wrong-way risk formula
Appendix 17B Devaluation approach for wrong-way risk
Appendix 17C Credit default swap with counterparty risk


The first edition of this book focused on counterparty credit risk and was written in 2009, during the aftermath of the global financial crisis. Since then, the subject matter has necessarily broadened to give more attention to aspects such as funding, collateral and capital. It has been less than three years since the second edition was finished and again, the subject has changed dramatically. Indeed, as before, this is much more than a new edition because most of the content has been rewritten and expanded with several new chapters. I hope this will be a comprehensive reference for the subject we now generally refer to as xVA.

As with the last edition, I have saved space by putting mathematical appendices together with the accompanying spreadsheets on my personal website at www.cvacentral. com. Since many do not study this material in depth, this has proved to be a reasonable compromise for most readers.

I have also made use of a number of survey results and I am grateful to Solum Financial and Deloitte for allowing me to reproduce these results. I am also grateful to IBM and Markit who have provided calculation examples. These will all be mentioned in the text.

Finally, I would like to thank the following people for feedback on this and earlier editions of the book: Manuel Ballester, Ronnie Barnes, Raymond Cheng, Vladimir Cheremisin, Michael Clayton, Daniel Dickler, Wei-Ming Feng, Julia Fernald, Piero Foscari, Teddy Fredaigues, Dimitrios Giannoulis, Arthur Guerin, Kale Kakhiani, Henry Kwon, David Mengle, Ivan Pomarico, Hans-Werner Pfaff, Erik van Raaij, Guilherme Sanches, Neil Schofield, Florent Serre, Masum Shaikh, Ana Sousa, Richard Stratford, Carlos Sterling, Hidetoshi Tanimura, Todd Tauzer, Nick Vause, Frederic Vrins and Valter Yoshida.

Jon Gregory
May 2015

About the Author

Jon Gregory is an independent expert specialising in counterparty risk and related aspects. He has worked on many aspects of credit risk in his career, being previously with Barclays Capital, BNP Paribas and Citigroup. He is a senior advisor for Solum Financial Derivatives Advisory and is a faculty member for the Certificate of Quantitative Finance (CQR).

Jon has a PhD from Cambridge University.