We study an environment where the capital structure of banks and firms are jointly determined in equilibrium, so as to balance the benefits of the provision of liquidity services by bank deposits with the costs of bankruptcy. The risk in the assets held by firms and banks is determined by the technology choices by firms and the portfolio diversification choices by banks. We show competitive equilibria are efficient and the equilibrium level of leverage in banks and firms depend on the nature of the shocks affecting firm productivities. When these shocks are co-monotonic, banks optimally choose a zero level of equity. Thus all equity should be in firms, where it does “double duty”.protecting both firms and banks from default. On the other hand, if productivity shocks have an idiosyncratic component, portfolio diversification by banks may be a more effective buffer against these shocks and, in these cases, it may be optimal for banks, as well as firms, to issue equity.