We build a two-country model, in which currency values are endogenously determined. Risk plays a key role – including idiosyncratic risk that creates precautionary savings demand for money, and aggregate risk that creates a demand for foreign assets and affects the risk profile of the local currency. In equilibrium, different currencies can coexist, but the value of local currency is non-monotonic in the idiosyncratic risk level. With idiosyncratic risk frictions, the optimal policy can differ significantly from the competitive outcome in terms of both the net foreign asset position in dollars and the value of local currency. Dollar monetary policy can have significant spillovers on the small country both in the competitive equilibrium and under optimal policy.