Systemic financial crises involve debt (leverage). We provide a theory of the optimality of debt, which nevertheless can lead to a crisis. Trade is best implemented by debt because it provides the smallest incentive for private information production, which creates trade-reducing adverse selection. Debt preserves symmetric ignorance between counterparties. Debt is least information-sensitive: the value (in utility terms) to producing private information or learning public information about the payoff is lowest. Even if one party is privately informed, so there is adverse selection in the market, debt is still optimal because it maximizes the amount of trade. Moreover, when there can be no adverse selection, but public signals, debt maximizes the amount that can be traded. For the economy as a whole there is a systemic risk of using debt to provide liquidity: an aggregate shock, if bad enough, can be made worse because the amount traded is reduced further. A public signal can cause debt to become information-sensitive. Then agents try to prevent triggering private information production; they trade an amount below the expected value conditional on the shock. The shock is amplified, leading to a crisis.