Investors hunting for yield no longer have to look very far.

After a decade in which short-term cash and equivalents earned next to nothing, that part of the market has now begun to pick up and offer legitimate returns for those looking for safety in an uncertain environment.

In particular, the three-month Treasury bill's yield crossed 2 percent recently, the first time that has happened in more than a decade. The move has come as the Federal Reserve has continued to boost short-term rates and as the economy continues to show signs of picking up, inflation takes root and investors look for safety amid stock market volatility.

Short-term government debt has been one of the more popular trades for the past year, and looks to remain so at least over the medium term.

The trade "does have a bit of legs to it," said Kim Rupert, managing director of global fixed income analysis for Action Economics. "We're at areas now where yields are fairly attractive. We've been more accustomed to basically zero percent on bills for the longest time."

For much of the bull market run in stocks and the economic recovery after the financial crisis, investors had been pouring into high-yield bonds and other riskier instruments. But for the past year, that trade has reversed itself.

So-called ultra-short bond funds, which usually focus on fixed income with a year or less of duration, have seen $50.5 billion in new investor cash over the past 12 months through June, an increase of 38.2 percent, according to Morningstar. Since the Fed began raising short-term rates in December 2015, investors have poured in $85.3 billion to the group, compared to the $14 billion of inflows for the previous 2½-year period.

The iShares Short Treasury Bond fund, which tracks maturities of between one month and one year, has seen $7.1 billion of new money in 2018, most by far of any fixed income ETF, boosting its total assets to $15.1 billion, according to FactSet. By contrast, the iShares iBoxx $ High Yield fund has been one of the big losers, seeing an exodus of $2.2 billion as investors shorten their duration and reduce their risk profiles.

"It's a pretty uncertain environment. We came off a fantastic 2017 in terms of equities. It's a little bit trickier now," Rupert said. "Between the China situation and concerns over tariffs and what that might do to growth, a lot of people are looking to park some cash into the short end."