We develop a theory that links the U.S. dollar’s valuation in FX markets to foreign investors’ demand for U.S. safe assets. When the convenience yield that foreign investors derive from holding U.S. safe assets increases, the U.S. dollar immediately appreciates, thus lowering the foreign investors’ expected future return from owning U.S. safe assets. The foreign investors’ convenience yield can be inferred from the wedge between the yield on foreign government bonds and the currency-hedged yield on safe U.S. Treasury bonds, which we call the U.S. Treasury basis. Consistent with the theory, we find that a widening of the U.S. Treasury basis coincides with an immediate appreciation and a subsequent depreciation of the U.S. dollar. The Treasury basis accounts for up to 28% of the quarterly variation in the dollar. Our results lend empirical support to recent theories of exchange rate determination which ascribe a special role to the U.S. as a provider of world safe assets.