Fannie Mae and Freddie Mac are taking on more interest-rate risk in their rapidly growing investment portfolios, driving a key gauge of their exposure to levels that rattled Wall Street two decades agoBloomberg Terminal.

Disclosures from the housing-finance giants show their duration gaps — a measure of how closely assets, liabilities and hedges offset one another — have widened sharply in recent months, leaving their holdings more exposed to rate swings. With the gaps now at roughly one year, a half-percentage point increase in rates would reduce the value of Fannie Mae’s portfolio by about $1.2 billion and Freddie Mac’s by more than $1.6 billion. Twelve months earlier, the estimated impact at both firms was minor.