A recession could tank the value of the U.S. dollar, Goldman Sachs says

The U.S. dollar is dominant, but for how long?

The U.S. dollar index has gained 15% since last year, as the Federal Reserve’s hawkish stance on inflation has boosted its strength against other currencies. Since the Fed began hiking interest rates in March, returns in the U.S. have become increasingly attractive and global investors have turned to more dollar-denominated investments.

In addition to boosting investments in the U.S., a strong dollar relative to other currencies is good news for American consumers in that it makes foreign goods cheaper to import. 

Things could change very quickly if the U.S. economy slides into a recession.

The U.S. dollar is currently “highly overvalued,” analysts from Goldman Sachs recently wrote in a note, and they said it’s unclear if the currency’s strength will hold in case of a recession.

In April, Goldman put the odds of a recession coming to roost in the U.S. at 38%. More recently, the bank said the risk of a recession is “rising,” as inflation continues to sit at a four-decade high and the Fed attempts to engineer its way towards a “soft landing” for the economy—wherein inflation is reined in without causing a significant drop in economic activity or a jump in unemployment.

“The dollar’s performance in and around recessions is less clear-cut than for other assets,” Goldman analysts, led by economist Zach Pandl, wrote, adding that other currencies, such as the Japanese yen, could be poised to take advantage of a dollar slump should a recession strike.

In another note published last week, Goldman analysts wrote that the yen is undervalued against the dollar by as much as 25%. With it trading so cheaply compared to more traditional “safe haven currencies” such as the U.S. dollar, it said the yen could become a useful hedge against a U.S. recession.

“The yen is now trading at historically cheap levels and screens as the cheapest safe haven asset by far—at a time when global recession risk is on the rise,” Goldman economist Karen Reichgott Fishman wrote.

Inflation in Japan is running much lower than in the U.S.—only 1.2% compared to 8.3%—although higher inflation has been a monetary policy goal in Japan for years, after a prolonged period of deflationary pressures stymied economic growth in the country. Since the Japanese central bank wants to keep inflation at healthy levels for as long as possible, it has not implemented aggressive interest rate hikes as the U.S. Federal Reserve has done, which has led to the yen staying comparatively weak.

But it’s far from consensus opinion that the U.S. dollar will collapse in the near term. Most strategists believe that the dollar will stay strong as long as the Fed remains hawkish on monetary policy, according to a poll conducted by Reuters in April. Other investment banks have also expressed optimism about the dollar’s fortunes, including Swiss bank UBS, whose analysts said in April that the U.S. dollar would stay strong well into the second quarter of 2022 due to the Fed’s ongoing stance against inflation.

Sign up for the Fortune Features email list so you don’t miss our biggest features, exclusive interviews, and investigations.