# cdsprice

Determine price for credit default swap

## Syntax

## Description

`[`

computes the price, or the mark-to-market value for CDS instruments.`Price`

,`AccPrem`

,`PaymentDates`

,`PaymentTimes`

,`PaymentCF`

]
= cdsprice(`ZeroData`

,`ProbData`

,`Settle`

,`Maturity`

,`ContractSpread`

)

**Note**

Alternatively, you can use the Financial Instruments Toolbox™
`CDS`

(Financial Instruments Toolbox) object to
price credit default swaps. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments (Financial Instruments Toolbox).

`[`

adds
optional name-value pair arguments.`Price`

,`AccPrem`

,`PaymentDates`

,`PaymentTimes`

,`PaymentCF`

]
= cdsprice(___,`Name,Value`

)

## Examples

## Input Arguments

## Output Arguments

## More About

## Algorithms

The premium leg is computed as the product of a spread *S* and
the risky present value of a basis point (`RPV01`

).
The `RPV01`

is given by:

$$RPV01={\displaystyle \sum _{j=1}^{N}Z(tj})\Delta (tj-1,tj,B)Q(tj)$$

when no accrued premiums are paid upon default, and it can be approximated by

$$RPV01\approx \frac{1}{2}{\displaystyle \sum _{j=1}^{N}Z(tj})\Delta (tj-1,tj,B)(Q(tj-1)+Q(tj))$$

when accrued premiums are paid upon default. Here, *t _{0}* =

`0`

is
the valuation date, and *t*=

_{1},...,t_{n}*T*are the premium payment dates over the life of the contract,

*T*is the maturity of the contract,

*Z(t)*is the discount factor for a payment received at time

*t*, and

*Δ(t*is a day count between dates

_{j-1}, t_{j}, B)*t*and

_{j-1}*t*corresponding to a basis

_{j}*B*.

The protection leg of a CDS contract is given by the following formula:

$$ProtectionLeg={\displaystyle {\int}_{0}^{T}Z(\tau )(1-R)dPD(}\tau )$$

$$\approx (1-R){\displaystyle \sum _{i=1}^{M}Z(\tau i)(PD}(\tau i)-PD(\tau i-1))$$

$$=(1-R){\displaystyle \sum _{i=1}^{M}Z(\tau i)(Q}(\tau i-1)-Q(\tau i))$$

where the integral is approximated with a finite sum over the
discretization *τ _{0}* =

`0`

,*τ*=

_{1},...,τ_{M}*T*.

If the spread of an existing CDS contract is *S _{C}*,
and the current breakeven spread for a comparable contract is

*S*, the current price, or mark-to-market value of the contract is given by:

_{0}`MtM`

= `Notional`

(*S _{0}* –

*S*)

_{C}`RPV01`

This assumes a long position from the protection standpoint (protection was bought). For short positions, the sign is reversed.

## References

[1] Beumee, J., D. Brigo, D. Schiemert, and G. Stoyle. *“Charting
a Course Through the CDS Big Bang.” * Fitch Solutions,
Quantitative Research, Global Special Report. April 7, 2009.

[2] Hull, J., and A. White. “Valuing Credit Default Swaps
I: No Counterparty Default Risk.” *Journal of Derivatives.* Vol.
8, pp. 29–40.

[3] O'Kane, D. and S. Turnbull. *“Valuation of
Credit Default Swaps.” * Lehman Brothers, Fixed
Income Quantitative Credit Research, April 2003.

## Version History

**Introduced in R2010b**

## See Also

`cdsbootstrap`

| `cdsspread`

| `cdsoptprice`

(Financial Instruments Toolbox) | `IRDataCurve`

(Financial Instruments Toolbox)