We study a static version of a Diamond-Dybvig economy, where ex-ante identical households face ex-post idiosyncratic and aggregate risk. We introduce minimum scale restrictions on the set of available technologies, creating a need for coordinating investment. We focus on the case where all feasible allocations have some measure of uninsurable systemic risk. We solve for the optimal mechanism design problem of providing idiosyncratic and aggregate insurance to households with private information. We find the unique efficient investment allocation that implements the optimal insurance contract, which consists of an unbalanced investment portfolio, to get a larger number of projects. We also provide a market based implementation of this allocation, where commercial banks (broker-dealers) sell insurance contracts to households, and finance firms’ investments. We allow free entry in both the commercial banks and firms sectors. This decentralized market arrangement implements the optimal allocation as its unique equilibrium, provided the following trading restrictions: (a) Households cannot engage in informal risk sharing (b) Firms get financing from at most one commercial bank and (c) Households cannot invest directly in firms, either by buying equity or bonds. However, regulation on commercial bank investments is not desirable, since it does not allow them to benefit from cross-subsidization strategies. This simple model gives some stark yet intuitive policy recommendations for regulation of financial markets.