Using the industrial economics approach to the microeconomics of banking we analyze a large bank under credit risk. Our aim is to study how a risky loan portfolio affects optimal bank behavior in the loan and deposit markets, when credit derivatives to hedge credit risk are available. We examine hedging without and with basis risk. In the absence of basis risk the usual separation result is confirmed. In case of basis risk, however, we find a weaker notion of separation.