# Market Value of a CDS

I need to model the market value of CDS in a portfolio. My current approach is to calculate the present value of the future spread payments - does anybody have a better idea to solve the problem?

Edit: I calculated the spread in the following way (as in Hull-White):

$PV_{surv} = \sum_{i=1}^T {(1−p_d )^i \cdot e^{-y\cdot i }};$

$PV_{def}=\sum_{i=1}^{t}{p_d \cdot (1-p_d)^{i-1} \cdot (1-R)}$

$s=PV_{def}/PV_{surv}$

2nd edit: I found the following statement: http://www.yieldcurve.com/Mktresearch/files/Abukar_Dissertation_Sep05.pdf "the market value of a cds is the difference between the two legs", leading to:

$MV_{CDS} = s\cdot PV_{surv} - PV_{def}$

-

$MV_{CDS}=T \cdot (s_0 - s_t )\cdot \sum_{i=1}^{T}{e^{-r\cdot i }}$