Under the settlement with the Federal Housing Finance Agency, the conservator for the two government-controlled mortgage finance companies, Goldman Sachs said it agreed to pay $3.15 billion to repurchase mortgage-backed securities from Fannie and Freddie. The FHFA, which valued the settlement at $1.2 billion, said the accord “effectively makes Fannie Mae and Freddie Mac whole on their investments in the securities at issue.”