What sows the seeds of financial crises, and what policies can help avoid them? I model the interaction between the ex-ante production of assets and ex-post adverse selection in financial markets. Positive shocks that increase market prices exacerbate the production of low quality assets and can increase the likelihood of a financial market collapse. The interest rate and the liquidity premium are endogenous and depend on the functioning of financial markets as well as the total supply of assets (private and public). Optimal policy balances the economy’s liquidity needs ex-post with the production incentives ex-ante, and it can be implemented with three instruments: government bonds, asset purchase programs, and transaction taxes. Public liquidity improves incentives but implies a higher deadweight loss than private market interventions. Optimal policy does not rule out private market collapses but mitigates the fluctuations in total liquidity.