We develop a tractable approach to characterize the distributions of the endogenous variables in quantitative trade models under aggregate uncertainty and incomplete markets. We allow agents to make ex ante investments in import and export capacity that determine resilience in the face of this aggregate uncertainty. Equilibrium ex ante investments affect ex post bilateral trade shares, and these ex ante investments depend not only on the expected costs of sourcing goods, but also on the variance and covariance of these costs across countries. Therefore a country’s risk profile becomes a key determinant of its comparative advantage, terms of trade, and welfare. Trade liberalization affects welfare through both first moments (expected real income) and second moments (the variance of real income), with endogenous adjustments in ex ante investments playing a key role in mediating these effects. Changes in the covariance structure of global shocks have heterogeneous effects across countries, depending on the extent to which they raise or reduce countries’ abilities to hedge against aggregate uncertainty through their ex ante investments.