The program is the biggest effort yet to deal with a tidal wave of mortgage defaults , which have piled up billions of dollars in losses for big banks , hedge funds and other investors as well as roiling financial markets around the globe .