Advanced economies tend to have large financial sectors which can be vulnerable to crises. We employ a DSGE model with banks featuring limited liability to investigate how risk shocks in the financial sector affect long-run macroeconomic outcomes. With full deposit insurance, banks expand balance sheets when risk increases, leading to higher investment and output. With no deposit insurance, we observe substantial drops in long-run credit provision, investment, and output. Reducing moral hazard by lowering the fraction of reimbursed deposits in case of bank default increases the probability of bank default in equilibrium. The long-run probability of bank default under a regime with no deposit insurance is more than 50% higher than under a regime with full deposit insurance for high levels of risk. These differences provide a novel argument in favor of deposit insurance. Our welfare analysis finds that increased risk always reduces welfare, except when there is full deposit insurance and deadweight costs from default are small.