We develop a model in which financial intermediaries hold near-cash assets to protect themselves from shocks. Depending on parameter values, banks may choose to hold too much or too little cash on aggregate compared to the socially optimal amount. 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. Key to our results is a market in which banks can obtain cash by selling or repo-ing their marketable securities. The quantity of cash obtained on this market is determined endogenously by the market value of the marketable securities and is subject to cash-in-the-market pricing. When uncertainty about the value of marketable securities is low, banks hold too little cash and liquidity regulation can achieve a better allocation. When uncertainly about the value of marketable securities is sufficiently high, banks hoard cash leading to a market freeze.