Efficient Option Pricing Under Levy Processes, with CVA and FVA

We generalize the Piterbarg (2010) model to include 1) bilateral default risk as in Burgard and Kjaer (2012), and 2) jumps in the dynamics of the underlying asset using general classes of Lévy processes of exponential type. We develop an efficient explicit-implicit scheme for European options and barrier options taking CVA-FVA into account. We highlight the importance of this work in the context of trading, pricing and management a derivative portfolio given the trajectory of regulations.


Introduction
Counterparty credit risk and the cost of funding in the valuation of derivatives have become a paramount topic in the industry. Counterparty credit risk can be defined as the risk of a party to a financial contract defaulting prior to the contract's expiration and not fulfilling all of its obligations. Each party to a transaction runs the risk of a loss from the counterparty defaulting; there is also the possibility of a gain from an increase of the self-default risk which reduces the counterparty's expectation of the transaction value. The expected loss from the default of a counterparty is generally referred to as the credit valuation adjustment (CVA), whilst the expected benefit from self-default risk is referred to as debt valuation adjustment (DVA). The question of whether the gain from increasing self default risk can actually be monetised and therefore should be included in derivative valuation values remains debatable, and it is currently excluded from prudential capital calculations under CRD IV, but must be included under generally accepted accounting rule as specified under IFRS 13.
Counterparty credit risk can be mitigated by collateralization. Each party to a transaction agrees to post/receive collateral when the value of the transaction moves against / in favour of one of the party under a collateral agreement. Transactions are generally executed via central counterparties (CCP) under robust collateral agreements which require posting of both initial and variation margins, whilst regulations of over-the-counter (as proposed by the Basel Committee in September 2013) will soon also make it mandatory for both parties to post initial and variation margins. Collateral that are posted against derivative transactions generally receive risk-free returns but must be funded/borrowed at non-risk-free rates, therefore introduces an additional cost to each counterparty, and the expected value of this cost is generally referred to as funding valuation adjustment (FVA). Since collateral funding cost is a function of the collateral requirement, which in turn is a non-linear function of the value of the derivative, the pricing problem involving FVA is non-linear and hence non-trivial.
In numerous studies, these adjustments (CVA, DVA and FVA) have been analyzed separately. Pykhtin and Zhu [51] modelled the credit exposure and priced the counterparty credit risk. Bilateral counterparty risk is analyzed in Brigo et al. [12,14,16], Gregory [25,26]. In a series of papers, Alex Lipton with co-authors developed several efficient methods for pricing bilateral counterparty risk for CDS. In 2-3 factor structural models driven by the Brownian motion, quasi-analytical formulas are developed [39,40]; in jump-diffusion models [41], an efficient numerical algorithm is designed. For further details and references, see [41,42,38,39,40].
An initial analysis of collateralization and funding risk in is due to Piterbarg [50]. Debates for funding valuation adjustment continue in [27,24,20]. Further generalizations appear in [19,21,43,53] which resort to a PDE approach, while Brigo et al. in [15,13,48,17,49,18,11] use the no-arbitrage approach. The models in these papers are of the reduced type.
In the paper, we consider a generalization of Piterbarg's [50] pricing equation. The equation is non-linear due to the presence of the term that accounts for the funding risk; the necessity of taking into account the collateral requirement and counterparty risk leads to additional complications. A simple natural remark (already made in [15] and [29]) is that in a non-linear problem, it is impossible to separate effects of the funding value adjustment (FVA) and CVA; we produce an example which shows that the difference between the exact result in the non-linear problem, which takes both effects into account simultaneously, and the sum of two effects calculated separately can differ by a wide margin.
A rigorous study of such a complicated situation requires an explicit specification of objective functions of agents involved (the trader and the treasury/XVA desk), and the result of such a study will strongly depend on these objective functions and the bargaining power of the agents involved. We leave this study for the future. In the present paper, we make the following simplifying assumption which is close but not identical to the remark made by Piterbarg [50]. Namely, we assume that, outside the bank where FVA and CVA need to be taken into account, there exists a large, liquid, and, essentially, frictionless market for the underlying security so that, if one forgets about the tiny segment of the market related to the bank in question (or, at least, to the trader inside a large bank), one can assume that all streams of payoffs can be priced under some equivalent martingale measure. If the trader is not the London Whale, this assumption is relatively reasonable. An additional justification for this assumption is that, by the very nature of the conditions in this tiny segment (once again, we have to assume away the possibility that the trader turns out to be the next London Whale), the payoff streams involve sizable frictions, therefore, should some formal arbitrage opportunities arise, they cannot be realized due to the presence of additional costs such as different rates for opposite sides of transactions.
Under the above assumption, we therefore use an "exterior" equivalent martingale measure (EMM) to price all flows inside the tiny submarket that involves the trader and treasury/XVA desk. However, we explicitly take into account the rules of the asset pricing inside this tiny market that are specified by the regulatory requirements. We leave for the future an extremely important question whether these requirements are rational or not.
The paper organized as follows. The model is described in detail In Section 2, we formulate the model in detail, and formulate non-linear boundary problems for different types of options. Section 3 describes the Carr's randomization algorithm for the problem and its realization. The detailed numerical scheme are derived in Section 4, and explicit algorithms are formulated in Section 5. Numerical examples are given in Section 6, and Section 7 concludes. Technical details are relegated to Appendices.

The Model
2.1. A generalization of Piterbarg's pricing equation. Assume that, apart from the security that we model, the market is void of frictions and arbitrage free. Then, under additional technical regularity conditions, there exists an equivalent measure Q such that the price of any security traded in the market is the expected value of discounted instantaneous payoffs and payoff streams that the security gives the right to, under Q. Assume also that, under Q, the discounted prices of all securities are functions of a strong Markov processX with the infinitesimal generator L, and of time. Then, in the region of the time-state space where the security remains alive its price obeys the generalized Black-Scholes equation where g(t,X t ) is the stream of payoffs during the security's life-time, subject to appropriate terminal and boundary conditions, which specify V (t,X t ) at expiry.
In short rate models, it is natural to regard X as the process with killing, and explicitly write the infinitesimal generator in the form L = L − r, where L is the infinitesimal generator of the corresponding Markov process without killing, and r is the multiplication-by-r = r(t,x) operator; then (2.1) becomes The constructions below can be easily generalized to the case of the stochastic interest rate; the rate can be time-dependent. However, in the present paper, we assume that the riskless rate r is constant; moreover, the stochastic factor is assumed to be a Lévy process X on R, and, apart from the riskless bond, there is only one underlying stock or index modelled as S t = e Xt . Then (2.2) simplifies further: If the external market is the Black-Scholes market, then (2.3) is In the model, which takes into account all the payments related to required collateral posting and funding, the stream of the total payoffs during the life-time of the contingent claim becomes rather involved. What is very important, and what makes the whole idea of the no-arbitrage pricing in the presence of FVA incorrect, strictly speaking, is the non-linearity of the pricing equation. Indeed, as it is shown below, the payoff stream g(t, x) depends on the value function V itself, and in a non-linear manner. However, the no-arbitrage pricing is linear. Therefore, the equation (2.3) with g(V ; t, x) below makes sense only as an approximation, if we presume that the effect of the contingent claim under consideration on the whole market is vanishingly small and can be ignored.
Before we go into the description of the stream g(V ; t, x), we introduce the notation that we use throughout the paper. Let A be the bank and B be its counterparty. Assume A and B agree to the ISDA agreement to set out standard terms that apply to all deals between them.
The credit support annex (CSA) to the ISDA master agreement defines the rules under which the collateral is posted between A and B. The stream comes from several sources of cashflow: (1) The stream that accounts for the cost of collateral posting/receiving. The stream is (r − r C )C, where r C is the collateral rate (for example the US effective FED rate). (2) The stream that accounts for the cost of unsecured funding. The stream for unsecured funding is (r − r F )(V − C), where r F is the unsecured funding rate. (3) The on-default cashflow. The stream is where V + = max{V, 0}, V − = min{V, 0}, R i is the recovery rate respectively for i = A, B, and λ is the first-to-default intensity. The collateral depends on V , and it is given by where H A , H B are the collateral thresholds for A and B, respectively, and C is the collateral of A. C is taken to be positive if the counterparty (B) posts collateral to A, and is negative if the counterparty receives collateral from A. We assume that R i , λ, H i are constants, hence, the stream of payoffs can be considered as a function of one argument V ; naturally, the composite function g(V ) is a function of t, x.
Adding up these streams, we obtain the following equality The two extremes are uncollateralized and fully collateralized cases considered in [1,50]. In the former case, C = 0, hence the stream is In the latter case, C = V , hence the stream is g(V ) = (r − r C )C = (r − r C )V . See Appendix B for details.
Remark 2.1. In the paper, we consider option pricing, and V is either non-negative (the long side of the contract) or non-positive (short side). For general financial instruments, V can assume positive and negative value (e.g., swaps, forwards, CDSs).

Detalization of the model: processes.
The underlying stock or index is modelled as S t = e Xt , where X is a Lévy process on R, with the infinitesimal generator L and characteristic exponent ψ. Making the change of variables τ = T − t, we rewrite (2.3) as Recall that the characteristic exponent of a Lévy process X = {X t } t≥0 is a continuous function ψ : R −→ C satisfying ψ(0) = 0 and From now on we will assume that there exist λ − < −1 < 0 < λ + such that the underlying Lévy process X is of the exponential type (λ − , λ + ). Roughly speaking, this means that the characteristic exponent ψ(ξ) admits analytic continuation into the open strip Im ξ ∈ (λ − , λ + ).
Moreover, ψ(ξ) grows at most polynomially as Re ξ → ±∞ within every closed strip Im ξ ∈ [ω − , ω + ] ⊂ (λ − , λ + ). A precise formulation (in terms of the Lévy density of X) is given in [9,Definition 3.2]. The details are not important to us: for the applications we have in mind, it will suffice to know that the examples below satisfy the definition.
(1) A Brownian motion (used in the classical Black-Scholes model [4]) is a Lévy process of exponential type (−∞, ∞). Its characteristic exponent is given by σ 2 2 ξ 2 − iµξ, where σ > 0 is the volatility and µ ∈ R is the drift of the process.
(4) Lévy processes of the extended Koponen family (generalizing the class of processes introduced by Koponen [30]) were constructed by Boyarchenko and Levendorskiȋ in [7]. A somewhat narrower class of processes was labelled later KoBoL processes or KoBoL model [9]. A subclass of KoBoL has become popular under the name CGMY model [23]. The characteristic exponent of a KoBoL process of order ν ∈ (0, 2), ν ̸ = 1, has the form 1 where λ − < 0 < λ + are called the steepness parameters of the process, c > 0 is its intensity, and µ ∈ R. A KoBoL process with parameters as above has exponential type (λ − , λ + ), so there is no conflict of notation.
(5) Variance Gamma (V.G.) processes were first used in empirical studies of financial markets by Madan and collaborators [45,46,44]. The characteristic exponent of a V.G. process has the form 2 : 1 In the formulas below, and elsewhere in the text, we use the standard convention that z ν = e ν·ln z for any ν ∈ C and any z ∈ C such that z ̸ ∈ (−∞, 0]. In turn, ln z denotes the unique branch of the natural logarithm function defined on the complex plane with the negative real axis (−∞, 0] removed, determined by the requirement that ln(1) = 0.
2 What we present is not the most common way of writing the formula. Rather, we chose an expression that is equivalent to the standard one and makes the analogy with (2.10) transparent.
Other examples of Lévy processes of exponential type can be found in [ If G is unbounded, the call option being the main example, then an appropriate condition of the characteristic exponent must be imposed to ensure the finiteness of the option price, and the solution of the boundary problem (2.13) sought for in the class of functions subject to the corresponding restriction on the rate of growth at infinity. See [9] for details.

Down-and-out Barrier Put
Option with CVA and FVA. Let V d.o.put (t, X t ) be the price of the down-and-out put option with maturity T , strike K and barrier H < K. Let h = ln H.
In the next section, we will use the Carr's randomization and backward induction to solve the boundary problems for European options and barrier options, with CVA and FVA.

Wiener-Hopf factorization and Carr's randomization
3.1. Three Forms of WHF. Define the supremum process X and the infimum process X of X by Given any q > 0, we let T q ∼ Exp q denote an exponentially distributed random variable with mean q −1 . The form of the Wiener-Hopf factorization (WHF) formula that is commonly used in probability theory is as follows:

Introducing the Wiener-Hopf factors
, we can rewrite (3.2) as a special case of the analytical form of the Wiener-Hopf factorization formula: Since the trajectories of the supremum process X are nondecreasing, ϕ + q (ξ) admits analytic continuation into the upper half-plane. Similarly, ϕ − q (ξ) admits analytic continuation into the lower half-plane. Thus, equation (3.3) is a special case of the Wiener-Hopf factorization of a function defined on the real axis, which historically was the first form of the WHF formula.
Define operators E + q and E − q acting on nonnegative measurable (or an arbitrary bounded measurable) functions f on R as follows: We also define the EPV operator E q of the process X itself by The operator form of the WHF formula is [9,10,6]).

Carr's Randomization and Backward Induction with CVA and FVA.
Carr's randomization [22] is an approximation procedure that replaces the problem of pricing a finite-lived option with a sequence of option pricing problems for perpetual options. These problems can be solved in closed form that is amenable to very fast numerical calculations using the operator form of the Wiener-Hopf factorization method developed in a series of works by S. Boyarchenko and Levendorskiȋ [8,9] and M. Boyarchenko and Levendorskiȋ [6,5]. The maturity period of the claim is divided into N subintervals, using points 0 = t 0 < t 1 < · · · < t N = T , and each sub-period [t s , t s+1 ] is replaced with an exponentially distributed random maturity period with mean ∆ s = t s+1 − t s . Moreover, these N random maturity sub-periods are assumed to be independent of each other and of the process X. (In [22], it is assumed that ∆ s = T /N for all s, but, in principle, we do not have to impose this requirement.) Denote by V s (x) the Carr's randomization approximation to V (t N −s , x). Then, by definition, V 0 (x) = G(x), the terminal payoff function.

Carr's Randomization for down-and-out barrier options with CVA and FVA.
For all 0 ≤ s ≤ N − 1, the function V s+1 (x) is the value function of a down-and-out barrier contingent claim with barrier H = e h , terminal payoff function V s (x), and exponentially distributed maturity date with mean ∆ s and a nonlinear stream g(V s (x)). In particular, Then, we discretize the time derivative in equation (2.15) by a finite difference and rewrite (2.15) in the implicit-explicit form: for s = 0, 1, ..., N − 1, We define q s = r + ∆ −1 s , and rewrite (3.7) as obtained at the last step of this algorithm is the Carr's randomization approximation to (2.15). It is possible to prove that, as the mesh max s ∆ s of the partition of the maturity period of the claim approaches 0, V N (x) converges to V (x).

Numerical realization of the action of EPV operators
4.1. EPV Operators Via Convolution. The formulas are as follows: with the convolution kernels being given by where ψ(ξ) is the characteristic exponent of X (cf. Section 2.2) and ϕ ± q (ξ) are the Wiener-Hopf In Section 3.1 below, we explain how to calculate ϕ ± q in practice, and refer the reader to [5,52] for background on the Wiener-Hopf factorization. Note that if X is a process of finite variation with positive (resp., negative) drift, then the measure g + (y)dy has an atom at 0 (resp., the measure g − (y)dy has an atom at 0). In such cases, the corresponding equality in (4.2) is valid for y ̸ = 0 only. For the numerical calculations below this subtlety does not really matter because we will use (4.2) for calculations outside the origin only.

Enhanced Realization of Convolution Operators.
Let us consider one of the formulas (4.1), or the definition of the Fourier transform. With the standard approach to the numerical realization of these formulas, one truncates the improper integral on the right hand side replacing it with an integral over a bounded interval, and uses a suitable quadrature rule to approximate the latter integral with a finite sum. However, it is demonstrated in [5] that sometimes this approach leads to very large computational errors, and the following alternative has been suggested: instead of discretizing the integral on the right hand side of (4.1), one should first approximate the function f (x) with a piecewise linear function, and then evaluate the resulting integral involving this piecewise linear approximation explicitly (in a suitable sense).
Given functions f (x), g(x) defined on R, we would like to approximately calculate In order to discretize the problem, we assume given a uniformly spaced grid of points ⃗ Following the strategy we just described, we approximate f (x) with a linear function on each of the intervals [x j , x j+1 ]: Of course, (4.5) is an exact equality for x = x j and for x = x j+1 ; inside the interval (x j , x j+1 ), the error of this approximation is controlled by the size of the second derivative f ′′ (x) (assuming that the latter exists).
The next result is obtained by a straightforward computation.
The values of the sum on the right hand side of (4.6) can be computed efficiently for all 1 ≤ k ≤ M using the algorithm presented in Section A.3.

Enhanced Realization of the EPV Operators.
In this subsection we recall the formulas for the enhanced convolution realization of the operators E q and E ± q that were obtained in [5,Section 4]. We keep the notation and assumptions of Section 4.1.
In the situation of Proposition 4.1, let g(y) = g q (y) be given by (4.2). Then the coefficients c 0 ℓ , c 1 ℓ and c ∆ ℓ can be found from the following formulas: Remark 4.4. The apparent singularities of the functions c 0 (ξ), c 1 (ξ) and c ∆ (ξ) at ξ = 0 are, of course, removable, as one can easily verify using the power series expansion of the exponential function.
Hence this array can be calculated approximately using the inverse fast Fourier transform.

Numerical Realization of E +
q . The enhanced convolution realization of E + q is slightly easier because the kernel of E + q is supported on [0, +∞) (this is immediate from the interpretation of E + q as a normalized EPV operator for the supremum process of X). Thus, with the notation of Proposition 4.1, we have c 0 ℓ = 0 = c 1 ℓ for ℓ > 0, which leads to the following approximation: Remark 4.6. The obvious analogue of Remark 4.5 is valid here as well, the only difference being that in order to calculate the convolution coefficients c + ℓ and c 0 +,ℓ − c 1 +,ℓ , we must first calculate the array of values of ϕ + q (ξ) on a suitable grid in the ξ-space using the algorithm of Section A.1 (where "suitable" means "suitable for the application of the refined iFFT technique of [5]).

Numerical Realization of
The situation is similar to that of Section 4.4.2, except that if we view E − q as a convolution operator, then its kernel is supported on (−∞, 0]. Thus, with the notation of Proposition 4.1, we have c 0 ℓ = 0 = c 1 ℓ for ℓ ≤ 0, which leads to the following approximation: where f j = f (x j ) and

Correction for the approximation.
In previous section, we explain the backward induction scheme for CVA and FVA using the EPV operators and their realizations. As one may expect the non-linear stream would may lead to sizeable errors due to a large number of steps in the backward induction scheme. We introduce a correction term to overcome this problem. The suggested method is relatively straightforward.

Presence of Kinks.
We use piecewise linear function to approximate the function f s (x) = q s V s (x) − g(V s (x)) in the convolution realization. In general, the stream g has three kinks at V s = {−H A , 0, H B }. The piecewise linear approximation may give an inaccurate approximation to g at these points in the backward induction scheme. Hence a correction should be added in each step of the backward induction. Since we consider a long position on a European put option whose value function is positive, there is only a single kink at and if is not large, then we use the linear interpolation to locate the kink x ′ : Since the price of the European put decays fast as x → +∞, there is no significant gain in taking the kink into account if x ′ >> 1. Thus, we find the kink (approximately) only if V s,i+1 − V s,i is not negligibly small.

4.5.2.
Calculating the Correction. The correction can be calculated using the standard Fourier transform technique. In Fig.1, the solid line is the approximation given by piecewise linear function and the dashed line is the exact g. The correction term is the price of the European option with the payoff G(x) that is the difference between the dashed line payoff and solid line payoff. We represent G is the form where (4.8) Thus, the corrected g(V (x)) is where the correction Θ is given by ∫ Imξ=ω e ixξ−∆(r+ψ(ξ))Ĝ (ξ)dξ.
The Fourier transform ofĜ(ξ) is easy to calculate

Algorithms
In this section, we formulate explicit algorithms for calculation of prices of European options, down-and-out barrier put options and down-and-in first-touch digital options. The algorithms are similar to the ones in [6] with natural modifications to account for the nonlinearity of the stream g(V ) and kinks. The underlying is modelled as S t = e Xt , where X t is a Lévy process of exponential type (λ − , λ + ), with λ − < −1 < 0 < λ + . The detailed algorithms are as follows: (1) One must describe the market by giving the riskless rate r > 0 and a formula for the characteristic exponent, ψ(ξ), of the process X. The EMM condition, r + ψ(−i) = 0, must hold if the underlying does not pay dividends. If the dividends are paid at constant rate δ > 0, then the EMM condition becomes r + ψ(−i) = δ.
(2) One must specify the collateral rate, unsecured funding rate, default intensity, recovery rate and collateral thresholds.
(3) One must specify the maturity date, T , and the barrier, H, of the option. In the case of a barrier option, one must also specify its strike price, K > H.
(4) We will use Carr's randomization in the situation where the maturity period, [0, T ], of the option is divided into subintervals of equal lengths Thus we only need to specify the number, N , of time steps. Set ∆ t = T /N and q = r + ∆ −1 t .
These steps constitute the input of the initial data for the algorithms. From now on we will write V (x) = V N (x) for the Carr randomization approximation to the value function of the option, calculated using the procedure described in Section 3.2.2 (for an European option) or Section 3.2.1 (for a down-and-out barrier option) or Section 3.2.3 (for a first-touch digital option). The next steps of the algorithm deal are the choice of the parameters of the numerical scheme and auxiliary calculations.
where M 1 = M · M 2 · M 3 and ζ 1 = ζ/M 2 , is sufficiently long and sufficiently fine. Since one of the subsequent steps uses FFT for arrays of length 2M 1 , we recommend making the choices so that M , M 2 and M 3 are powers of 2.
(7) Calculate the values of ϕ + q (ξ) on the grid ⃗ ξ using the algorithm of Section A.1. Then find the values of ϕ − q (ξ) on ⃗ ξ using the identity ϕ + q (ξ)ϕ − q (ξ) = q(q + ψ(ξ)) −1 . To complete the calculation of prices using Carr's randomization procedure, we must now consider the three types of options separately. At each step below, the inputs are function values on the chosen grid, and the output are the values of another function at the same grid. For simplicity, we write x instead of a generic point x j on the grid.

Pricing European Options.
The remaining steps are as follows: where G is the payoff function such as European call/put or digitals.
(9) For s = 0, 1, ..., N − 1, calculate the nonlinear stream g(V s (x j )) and its correction using the procedures in 4.5 then The vector V N is the approximation to the value function of the European option, at points of the chosen grid.

Pricing Down-and-Out Barrier Put Options.
For a down-and-out barrier put options, the remaining steps are as follows: where h = ln H (and H is the barrier for the option). For s = 0, set Then calculate the Fourier transform of ). Then calculate the auxiliary function W 1 (x) on the x-grid: ) .
(9) In the cycle for s = 0, ..., N − 3, N − 2, calculate the values of W s (x) on the x-grid using the EPV operator E qs and the following formula: Calculate the correction for g and set The vector V N is the desired approximation to the value function of the down-and-out barrier put option.

Pricing Down-and-In First Touch Digitals.
For down-and-in first touch digital options, it is convenient to work with the auxiliary function U s (x) = 1 − V s (x), and the remaining steps are as follows: (9) In the cycle for s = 2, ..., N − 3, N − 1, calculate the values of W s (x) on the x-grid using the EPV operator E qs and the following formula: W s (x)). Calculate the correction for g and set ). (10) For s = N , compute the value of V (x) on the x-grid using the EPV operator E − q and the formula The vector V N is the desired approximation to the value function of the down-and-in first touch digital option.

Numerical Examples
All calculations and the results presented in this paper were performed in MATLAB R2014a, on a computer with processor Intel Core i5 (2.7 GHz), memory 8 GB 1600 MHz DDR3, under the Mac OS X 10.9.4 operating system. The tables are collected in Appendix C.
We calibrate some of the models to June 2015 put options on the Hang Seng index as of 9 January 2015. Namely, we calibrate the market data to the DEJD, KoBoL, VG and NIG models. We use the algorithms in Section 5 to calculate prices for European options, down-and-out barrier put options and down-and-in first touch digital options for these models.
Prices and adjustments for European options are presented in Table 1, the models are calibrated to give (approximately) the same at-the-money put option prices in order to compare the adjustments for each models. One can observe that the adjustments are quite close for BM, VG and NIG, while the total adjustments for DEJD and KoBoL are larger. We have mentioned at the beginning of the paper that it is impossible to separate effects of CVA and FVA due to nonlinearity of the pricing problem. We observe that the error of separating CVA and FVA is significant and up to 30% in the DEJD and KoBoL model. The prices and adjustments for European options for KoBoL are computed for different initial spot price ( Table 2).The plot of prices and adjustments against spot are in Figure 2 where prices with adjustments and without adjustments are plot on the same graph. Prices and adjustments for digital options are presented in Table 3. One can observe that the adjustments are similar for all of the models under consideration. In Table 4, we show the prices and adjustments for digital options under KoBoL computed for different initial spot prices and the plot of prices and adjustments against spot are in Figure 3.
Prices and adjustments for down-and-out put options are presented in Table 5. We observe that the error of separating CVA and FVA have little impact on down-and-out put options while the adjustments vary for different models.
The prices and adjustments for down-and-out put options and for first touch digital options under KoBoL are computed for different initial spot prices (see Tables 6 and 8). Prices and adjustments for first touch digital options are presented in Table 7. We observe that the error of separating CVA and FVA have significant impact for the models under consideration and up to 30% in the VG and NIG model.

Conclusion
In this paper, we generalized the model of Piterbarg (2010) to include 1) the bilateral default risk as in , and 2) jumps in the dynamics of the underlying asset. We use very general Lévy processes of exponential type. We calculate prices for European options, barrier options under general classes of Lévy processes taking CVA and FVA into account simultaneously. We develop an efficient algorithm using the Carr's randomization and Wiener-Hopf factorization to solve the arising non-linear problem. We produce numerical examples which show that the the independent calculation of effects of CVA and FVA can result in sizable errors in derivative valuation due to non-linearity of the pricing problem.
Since the financial crisis of 2008, there has been a regulatory drive towards better recognition and mitigation of derivative counterparty credit risk. Basel 3 (as implemented in law as CRD IV in Europe) introduced CVA and CVA risk capital which requires banks to include CVA in derivative valuation based on the market implied default probabilities (from CDS spreads) of the counterparty, and capitalise the additional volatility of derivative valuation due to fluctuation of CDS spreads. The Dodd-Frank Act and EMIR requires standardised derivative contracts to be traded with CCPs under robust collateral agreements. The Basel committee introduced mandatory exchange of initial and variation margins (making the collateral requirements similar to a CCP trade) for all OTC derivative transactions, whilst liquidity coverage ratios introduced in Basel 3 explicitly capture contingent liquidity requirements from derivative transactions. The combined effect of the above is that • some counterparty credit risk will be transformed into funding risk (the need to fund margin calls), and therefore derivative valuation must incorporate both CVA and FVA simultaneously; • the remaining counterparty credit risk will largely be driven by gap events, either through jumps in the underlying asset prices or the jump-to-default of a counterparty making it important to incorporate jumps in asset price dynamics in derivative valuation. The present work is therefore extremely relevant in the context of current industry development and we see potential application of our work in: • investigating the combined effects of counterparty credit risk and collateral funding costs, particularly in the context of a centralised CVA/FVA desk quantifying the impact of jumps in asset prices when evaluating CVA and/or FVA; • calculating the upper bound (as portfolio netting effects cannot be modelled using this single model) of the CVA/FVA adjustment for intra-day trading or for valuing particularly large transactions where portfolio netting may be reasonably ignored.

A.1. Calculation of the Wiener-Hopf factors.
In order to be able to implement the enhanced realization of the operators E ± q , we must first know how to calculate the values of the functions ϕ ± q (ξ) that appear in (4.2). Unfortunately, apart from a few special cases (such as the hyper-exponential Lévy processes [35,2,28]), no explicit formulas for ϕ ± q (ξ) are known. Instead, one must use the integral formulas recalled in Section 4.2. We will not repeat these formulas here, but will only give the discretized versions thereof, after introducing some auxiliary notation.
We obtain approximate formulas for ϕ ± q (ξ k ) using a simplified version of the trapezoidal rule to discretize (4.3). Due to the fact that the integrand in (4.3) decays somewhat slower than |η| −2 as Re η → ±∞, it is sometimes necessary to use an η-grid that is longer than the ξ-grid for this discretization, in order to guarantee the desired precision of the calculation of ϕ ± q (ξ k ). With these remarks in mind, and with the notation above, we present an algorithm for the approximate calculation of the values (ϕ ± q (ξ k )) M k=1 . • Select a positive integer m that controls the length of the η-grid.
• Using the results of the previous step, calculate the right hand side of (A.1).
We present the algorithm for calculating c 0 l ; the other coefficients c 1 l , c ∆ l for E q , c 0 +,l − c 1 +,l , c + l for E + q and c 1 −,l , c − l for E − q can be calculated in the same way as in this section.
We have (1) We use the dual grid (ξ k ) M 1 k=1 constructed in Section 5 to continue the calculations. (2) Calculate the integrand by for points near ξ = 0 (ξ = 0 is a removable singularity), we use power series expansion to calculate the integrand.
A.3. Fast Convolution. Given array f j = f (x j ), we want to calculate the sums Thenf is a vector of length 2M .
(2) Letg be a vector of length 2M where the entries are The close-out amount at default is the costs or losses that the surviving party incurs when replacing the terminated deal with an economic equivalent. The size of these costs will depend on which party survives and we define the close-out amount as where V B,τ is the close-out amount on the counterparty's default priced at time τ by the bank and V A,τ is the close-out amount if the bank defaults. We adopt the approach of [14,15] listing and net the exposure against the pre-default value of the collateral. If we aggregate all these cashflows and the pre-default value of collateral account, we obtain the expression for the on-default cashflow If both parties agree on the exposure, that is V B,τ = V C,τ = V τ , when we take the risk-neutral expectation, we see that the price of the discounted on-default cashflow, is the present value of the close-out amount reduced by the positive collateralized CVA and DVA and B.2. Stream of Collateral. A margining procedure specifies the set of dates during the life of a deal when both parties post or withdraw collaterals, according to their current exposure, to or from an account held by the collateral taker. A realistic margining practice should allow for collateral posting only on a fixed time-grid {t 1 , ..., t n }. Without loss of generality, we assume that the collateral account C t is held by the bank if C t > 0, and by the counterparty if C t < 0.
The CSA agreement holding between the counterparties ensures that the collateral taker remunerates the account at a particular accrual rate. We denote the collateral rate r + c (t, T ) when the collateral are taken by the bank, and r + c (t, T ) if otherwise. The effective collateral rater c (t, T ) is defined asr (1) The bank opens the collateral account at the first margin date t 1 if C t 1 < 0 (the counterparty is the collateral taker); (2) The bank posts to or withdraws from the account at each t k , as long as C t k < 0, and the collateral account grow at the CSA rate r − c (t k , t k+1 ) between posting dates; (3) The bank closes the account at the last margining date t m if C tm < 0. On the other hand, the counterparty considers the same cashflows for opposite values of the collateral account at each margining date with the CSA rate r + c . We define the sum of discounted margining cashflows as given by Let τ be the time of the first default event. To introduce default event, we can stop collateral margining when they occur, so we have where γ is the sum of all (discounted) margining cashflows up to the first default event.
If we use a first order expansion (for smallr c and r), we can approximate By taking the time limit, we have the expression for the stream of the collateral: 3. Stream of Funding. Denote F t the funding account and without loss of generality, we assume that the the trading desk is borrowing from the treasury if F t > 0, and otherwise lending to treasury if F t < 0. Similar to the case in collateral, we assume the trading desk enters a funding position on a discrete time-grid {t 1 , ..., t m }.
Given two adjacent funding times t j and t j+1 , for 1 ≤ j ≤ m − 1, the desk enters a position in cash equal to F t j at time t j . At time t j+1 the desk redeems the position again and either returns the cash to the treasury if it was a borrowing position and pays the funding costs on the borrowed cash, or it gets the cash back if it was a lending position and receives funding benefits as interest on the invested cash. We assume that these funding costs and benefits are determined at the start date of each funding period and charged at the end of the period.
Let P r + f (t, T ) be the price of a borrowing contract at t where the desk pays one unit of cash at maturity T > t, and let P r − f (t, T ) be the price of a lending contract where the desk receives one unit of cash at maturity. The corresponding accrual rates are given by In other words, if the desk requires to borrow cash, this can be done at the funding/borrowing rate r + f , while surplus cash can be invested at the lending rate r − f . We define the effective funding rater f faced by the desk as Repeating the similar steps as in the part of collateral, the sum of discounted cashflows from funding is equal to If we use a first order expansion (for smallr f and r), we can approximate By taking the time limit, we have the expression for the stream of the collateral: . EPV of all streams. Denote G(t, T ) be the payoff of the derivative, under the chosen EMM with the consideration of collateral and funding. Using the approach as in [15], we obtain that the EPV of the payoff and the streams at time t is Tables  Table 1. Prices of at-the-money European put for different models, time to maturity T = 0.463, spot, strike S = K = 24000, risk-free rate r = 0.52%, collateral rate r C = 1%, funding rate r F = 1.7% default intensity λ = 0.05, recovery rate R B = 0.4, collateral threshold H B = 500.   Table 3. Prices of at-the-money digital put for different models, time to maturity T = 0.463, spot, strike S = K = 24000, risk-free rate r = 0.52%, collateral rate r C = 1%, funding rate r F = 1.7% default intensity λ = 0.05, recovery rate R B = 0.4, collateral threshold H B = 0.5.       Table 5. Prices of at-the-money down-and-out put for different models, time to maturity T = 0.463, spot, strike S = K = 24000, barrier H = 23500, risk-free rate r = 0.52%, collateral rate r C = 1%, funding rate r F = 1.7% default intensity λ = 0.05, recovery rate R B = 0.4, collateral threshold H B = 0.1.  Table 7. Prices of first-touch digitial for different models, time to maturity T = 0.463, spot S = 24000, barrier H = 23500, risk-free rate r = 0.52%, collateral rate r C = 1%, funding rate r F = 1.7% default intensity λ = 0.05, recovery rate R B = 0.4, collateral threshold H B = 0.5.