Investors are flocking to the United States, a move that's causing real pain in some emerging markets.

Interest rates hit 40% in Argentina on Friday after a currency slide forced the country's central bank to execute its third rate hike in eight days. Turkey's lira has also fallen sharply in recent days as investors flee the currency.

Money flows into the United States have affected stock markets too. Swedish bank SEB said that its emerging market index has dropped by about 10% since January.

Investors have been attracted to the United States by rising bond yields and a stronger US dollar. The yield on 10-year Treasury bonds has spiked this year from 2.4% to 3%, and the dollar has surged 4% against other major currencies since mid-April.

Data from Morningstar show nearly $3 trillion is now invested in US fixed income funds and ETFs, the highest level in more than five years.

"The US dollar rally has triggered an emerging market sell off in all regions," said currency strategists at Bank of America Merrill Lynch. The bank said that hedge funds, asset managers and other investors have all piled into the US dollar over the past two weeks.

The moves are not as dramatic as the 2013 "taper tantrum," when nervous investors made a quick dash out of developing markets, said Athanasios Vamvakidis, a currency strategist at Bank of America Merrill Lynch.

"We don't see a disorderly adjustment," he said, noting that many global emerging markets are in a stronger position than they were five years ago.

Related: The wave of massive Chinese tech IPOs has begun

Argentina and Turkey are thought to be the most vulnerable.

Both economies have large current account deficits, meaning they spend more on imports than they make on exports. Investors worry about their ability to bring in money during tough times to pay off debts.

In Argentina, interest rates stood at 27.25% before the rapid fire rate hikes. The Argentine peso is down 15% against the US dollar in 2018, and the central bank is trying to stop it from sliding further.

"The real surprise is how quickly and suddenly things seem to be escalating," Edward Glossop, a Latin America economist at Capital Economics, wrote in a research note on Thursday.

In Turkey, the lira has fallen 11% against the US dollar in 2018, and the country's benchmark stock market index is down 11% over the same period.

Jameel Ahmad, head of currency strategy at FXTM, said that a widening account deficit, high inflation and political risk are likely to keep scaring investors away from the lira.