We study the impact of shadow banking on optimal liquidity regulation in a Diamond-Dybvig maturity mismatch environment. A pecuniary externality arising out of the banks' access to private retrade renders competitive equilibrium ine cient. Shadow banking provides an outside option for banks, which adds a new constraint in the mechanism design problem that determines the optimal allocation. A tax on illiquid assets and a subsidy to the liquid asset similar to the payment of interest on reserves (IOR) constitute an optimal liquidity regulation policy in this economy. During expansions, when the return on illiquid assets is high, the threat of investors flocking out to shadow banking pins down optimal policy rates. These rates do not respond to business cycle fluctuations as long as the economy stays out of recession. In recessions, when the return on illiquid assets is low, optimal liquidity regulation policy becomes sensitive to the business cycle: both policy rates are reduced, with deeper discounts given in deeper recessions. In addition, when high aggregate demand for liquidity is anticipated, the IOR rate is reduced and, unless the shadow banking constraint binds, the tax rate on illiquid assets is increased.