We model the decision problem faced by a profit-maximizing clearinghouse, which sets fee and margin requirements for heterogeneous traders who may default. We capture the main tradeoffs underpinning the clearinghouse's choices: higher fee and better default protection come at the cost of...