The move constitutes a massive government intervention to contain the damage from the worst housing slump in decades , which has rippled through the banking system and led to multibillion-dollar losses for Fannie and Freddie .