Amongst the recent decline in stocks, one asset class has suffered as well despite some investors seeing it as a hedge to one of the greatest risks to stocks: senior loans.

Also known as floating-rate loans, this asset class is unique in that it rises in value as interest rates rise, unlike bonds and—so the thinking goes—dividend-yielding equities, which will decline in desirability as Treasury rates go up. Thus some investors have loaded up on senior loans in recent years to hedge against higher interest rates.

And as rates have risen, senior loan values have increased steadily—yet they have fallen steeply in recent weeks alongside the market panic. The reason for this is that another important factor also impacts the value of senior loans, and that factor has become significantly more important in recent months: economic growth.

Senior loans act as collateralized debts issued by companies; if the company goes bust, these loans will be made whole before almost anything else. However, that bankruptcy process is long, expensive, and risky, so bankruptcy risk will impact senior loan values. And the market has been pricing in higher default and bankruptcy risk recently, causing senior loan values to fall by nearly 10% in a matter of weeks (an unusual move, as these tend to be lower volatility than many forms of corporate debt).

The reason for the higher bankruptcy risks, according to the market, are diverse, but one reason is (you guessed it), higher interest rates.

As interest rates rise, the cost of borrowing increases and the risk of a company failing to pay its debts rises as well.

This doesn’t mean that senior loans are doomed or are a bad bet. Rather, it means betting on macroeconomic movements tends to be the wrong move. Investors who bought into senior loans because “interest rates are rising” or because “defaults are going down” made a bad decision. Sometimes that bad decision looked good; for instance, those who bought in mid-2016 did very well, but only because those loans had been heavily discounted in early 2016. The underlying thesis remained the same: rates were rising and defaults declining. But the bet in one period was better than another for just that reason: it was a bet, nothing else.

The market sometimes fixates on broad narratives that results in overbought or oversold conditions, which was the real source of the mid-2016 better’s outperformance. Although rates were starting to rise at the start of the year and defaults were going down, a panic that rates were going up too fast hit the market and caused a broad asset selloff, which was then a buying opportunity. By the time that panic ceased in mid-2016, floating-rate loans were tremendously oversold.

The astute investor will keep in mind these broad narratives and invest when the narrative has overtaken reality—when the market has convinced itself of a story that is partly true, but the market has overblown in terms of importance or duration. But the astute investor won’t stop there. At that point, all leveraged loans were discounted for sure, but some were rightly discounted and others wrongly so. It was the investor’s job to pick out the loans that were heavily discounted and ignore those that were rightly discounted.

How do you do that? The short answer is underwriting, but the long answer is that it is a very complex job for financial professionals that involves a tremendous amount of time, skill, and access to information. But for those with the skills to do so, they could make a contrarian investment at a time when a market panic oversold high quality assets, resulting in a strong long-term return that passive investors cannot beat.