We develop a model in which financial intermediaries hold liquidity to protect themselves from shocks. Depending on parameter values, banks may choose to hold too much or too little liquidity on aggregate compared with the socially optimal amount. The model endogenously generates a situation of cash hoarding, leading to the associated market freezes or underinsurance against liquidity choice. The model therefore provides a unified framework for thinking, on the one hand, about policy measures that can reduce hoarding of cash by banks and, on the other hand, about liquidity requirements of the type imposed by the new Basel III regulation. In our model, banks hold tradable and nontradable assets. Nontradable assets are subject to a liquidity shock, and an injection of cash is required for the asset to mature if it is hit by the shock. Banks have access to an interbank market on which they obtain cash against their tradable securities. The quantity of cash obtained on this market is determined endogenously by the market value of the tradable assets and is subject to cash-in-the-market pricing. Banks holding an asset that turns out to be bad may be constrained on the interbank market and therefore may have to interrupt their nontradable project.