Endogenous trading in credit default swaps