We study the time-varying demand for safe dollar bonds in a New Keynesian model of the global economy with heterogeneity in risk-bearing capacity. A flight to safety generates a dollar appreciation and decline in global output. Dollar bonds thus command a negative risk premium and risk tolerant agents insure the risk averse against these shocks. Quantitatively, the model can rationalize properties of the dollar carry trade; the composition of international portfolios; the valuation channel in U.S. external adjustment; and asymmetric risk premium effects of monetary shocks in the U.S. versus abroad. We use the model to quantify the global stimulus from dollar swap lines in recent crises.