An epic unwinding of the yen-funded carry trade that has reverberated through global markets is only about 50% done, a UBS analyst estimated on Tuesday.

Days of havoc in global markets have analysts rushing to calculate the size of a global carry trade in which investors have borrowed money from economies with low interest rates, such as Japan or Switzerland, to fund investments in higher-yielding assets elsewhere.

The strategy, which kept money flowing into global risk assets for years, was shaken after the Bank of Japan raised interest rates last week, forcing some investors to abandon the trade as the yen surged higher. The resulting unwind sparked huge losses in global stock markets and saw Japan’s Nikkei notch its worst day since 1987.

James Malcolm, a UBS Japan macro strategist based in London, estimates that the dollar-yen carry trade grew to at least $500 billion at its peak and is not done unwinding.

"I’d guess the carry trade is only about 50% unwound,” he wrote in a Tuesday note to clients.

Malcolm calculates that about $200 billion of the carry trade has been unwound over the last two to three weeks.

“How much the carry trade could unwind depends not so much on the level of the interest rate differential but the change in the interest rate differential,” he said.

Malcolm estimates there is still some $300 billion of the trade left to unwind.

“Comparing this unwind with 1998 (dollar-yen) carry trade unwind suggest more unwinds to come.”

(Reporting by Summer Zhen and Vidya Ranganathan; Writing by Ira Iosebashvili; Editing by Sharon Singleton)