Banks in our model are financially constrained, and the liquidity premium on bank deposits affects the level of aggregate investment. We study the optimal design of a digital currency in this setting, including whether it should pay interest and how widely it should circulate. We highlight an important policy tradeoff: while a digital currency tends to promote efficiency in exchange, it can also crowd out bank deposits, raise banks' funding costs, and decrease investment. Despite these effects, introducing a central bank digital currency often raises welfare.