Investors have piled a record amount into U.S. money market funds in the first three months of the year as wild market swings rocked stocks and bonds, data from EPFR Global showed.

U.S. money market funds were on track for a record quarter of inflows, with $676.87 billion in the year to March 30, EPFR Global said. Stock funds saw net outflows of $28.47 billion, while bond funds lost $33.89 billion in that period.

The massive shift into cash came as worries over the economic fallout from the coronavirus pandemic mounted, pushing some investors to liquidate their stocks and eventually even some haven assets like Treasuries.

The benchmark U.S. S&P 500 stock index finished the quarter with a 20% loss, though it rebounded 15.5% from March 23 to March 31. Yields on U.S. 10-year Treasury notes last stood at 0.6019%, from 1.91% on Dec. 31.

Investors “increasingly moved toward the sidelines,” said Todd Rosenbluth, director of ETF and mutual fund research at CFRA. “It’s natural for investors to want to pause and to make sure they’ve got cash available to deal with not only their investments but their living expenses.”

U.S. equity funds are on track to notch net outflows for the sixth straight quarter, though this quarter’s outflows are shaping up to be smaller than they were in the fourth quarter of 2019. U.S. bond funds, however, are on track to show their biggest quarterly outflow since the end of 2018, another period when Wall Street endured heavy losses.

Yet certain U.S. fixed-income funds — both investment-grade corporate bond funds with long durations and government bond funds with short durations — have garnered new inflows, according to EPFR Global.

Among exchange-traded funds, those focused on short-term government bonds took in $18 billion from March 1 to March 30, a record inflow over a 30-day period, said Matthew Bartolini, head of SPDR Americas Research at State Street Global Advisors.

“Given the uncertainty of this environment, where yields are extremely low, duration can be a risk in the portfolio,” Bartolini said. “It’s not surprising that investors are gravitating toward ultra-short bonds. They’re similar to cash.”

© Copyright Thomson Reuters 2020.