Mortgage real estate investment trusts and sector-related exchange traded funds surged Wednesday as markets stabilize on rising optimism that the coronavirus outbreak may be peaking.

Among the best performing non-leveraged ETFs of Wednesday, the iShares Mortgage Real Estate ETF (NYSEArca: REM) surged 18.5% and the rival VanEck Vectors Mortgage REIT Income ETF (NYSEArca: MORT) jumped 16.9%.

Matthew Frankel for The Motley Fool argued that mortgage REITs do best during stable environments when both short-term interest rates and mortgage rates stay relatively constant, and we are finally starting to get the first signs of stability since the pandemic began.

Specifically, interest rates are stabilizing after a precipitous falloff, and we are seeing signs that the number of new coronavirus or COVID-19 cases and deaths may be reaching their peak, so the overall economic outlook could return to normal than originally feared.

The uncertainty has weighed on mortgage-backed securities owned by these companies. In a prolonged recession, more homeowners would have a tough time paying bills, so the higher credit risk has translated to lower prices.

Short-term borrowing costs also increased liquidity concerns in the mortgage market. Mortgage REITs would typically borrow at short-term interest rates and buy mortgages with higher long-term rates, profiting from the spread or difference between the two rates. As the short-term costs jumped, profits declined.

Furthermore, mortgages REITs hedge against rising interest rates, and these hedges weighed on these companies as benchmark rates dipped to record lows. The lower mortgage rates even added to higher prepayment risk.

However, it appears that many mortgage REITs are engaging in prudent steps to address their near-term financial issues, such as dividend cut after liquidating some of the assets to satisfy margin calls.

The sector’s robust gains may also be attributed to value or bargain bin hunting after a steep falloff of over 50% since the peak a few weeks back.

For more information on real estate investment trusts, visit our REITs category.