  We analyze the counterparty risk embedded in CDS contracts, in presence of a
bilateral margin agreement. First, we investigate the pricing of collateralized
counterparty risk and we derive the bilateral Credit Valuation Adjustment
(CVA), unilateral Credit Valuation Adjustment (UCVA) and Debt Valuation
Adjustment (DVA). We propose a model for the collateral by incorporating all
related factors such as the thresholds, haircuts and margin period of risk. We
derive the dynamics of the bilateral CVA in a general form with related jump
martingales. We also introduce the Spread Value Adjustment (SVA) indicating the
counterparty risk adjusted spread. Counterparty risky and the counterparty
risk-free spread dynamics are derived and the dynamics of the SVA is found as a
consequence. We finally employ a Markovian copula model for default intensities
and illustrate our findings with numerical results.
