The credit crisis that started in 2007, with the collapse of well-established financial institutions and the bankruptcy of many public corporations, has clearly shown the importance for any company entering the derivative business of modelling, pricing, and hedging its counterparty credit exposure. Building an accurate representation of firm-wide credit exposure, for both risk and trading activities, is a significant challenge from the technical as well as the practical point of view. This volume can be considered as a roadmap to finding practical solutions to the problem of computing counterparty credit exposure for large books of both vanilla and exotic derivatives usually traded by large Investment Banks. It is divided into four parts, (I) Methodology, (II) Architecture and Implementation, (III) Products, and (IV) Hedging and Managing Counterparty Risk. Starting from a generic modelling and simulation framework based on American Monte Carlo techniques, it presents a software architecture, which, with its modular design, allows the computation of credit exposure in a portfolio-aggregated and scenario-consistent way. An essential part of the design is the definition of a programming language, which allows trade representation based on dynamic modelling features. Several chapters are then devoted to the analysis of credit exposure of various products across all asset classes, namely foreign exchange, interest rate, credit derivatives, and equity. Finally it considers how to mitigate and hedge counterparty exposure. The crucial question of dynamic hedging is addressed by constructing a hybrid product, the Contingent-Credit Default Swap.This volume addresses these and other problems, as well as recent developments related to counterparty credit exposure, from a quantitative perspective. Its unique characteristic is the combination of a rigorous but simple mathematical approach with a practical view of the financial problem at hand.