A major credit shock can induce large intraday variation margin payments between counterparties in derivatives markets, which may force some participants to default on their payments. These payment shortfalls become amplified as they cascade through the network of exposures. Using detailed Depository Trust & Clearing Corporation data, we model the full network of exposures, shock-induced payments, initial margin collected, and liquidity buffers for about 900 firms operating in the U.S. credit default swaps market. We estimate the total amount of contagion, the marginal contribution of each firm to contagion, and the number of defaulting firms for a systemic shock to credit spreads. A novel feature of the model is that it allows for a range of behavioral responses to balance sheet stress, including delayed or partial payments. The model provides a framework for analyzing the relative effectiveness of different policy options, such as increasing margin requirements or mandating greater liquidity reserves. This paper was accepted by Karl Diether, finance.