It pays to be a whistleblower in the biggest financial settlement in history.

Edward O'Donnell, a former executive at mortgage lender Countrywide Financial, is set to collect a cool $57.6 million from Bank of America (BAC), for his role in exposing fraudulent activity at the firm.

A federal jury ruled last year that Countrywide Financial, which is now owned by Bank of America, had defrauded government-backed firms Fannie Mae and Freddie Mac by selling them defective mortgages. That fraudulent activity contributed to the real estate bubble and mortgage crisis of 2008, which finally led to the widespread economic fallout known as the Great Recession.

O'Donnell is entitled to 16% of a $350 million payment from Bank of America, according to documents filed this week in the Southern District Court of New York. The payment is a portion of the $16.65 billion settlement that Bank of America has to pay. It's the biggest financial settlement in history.

Related: What Wall Street won in budget deal

O'Donnell's piece of the $350 million is equal to about $56 million. He's also entitled to an additional $1.6 million payment from Bank of America, to total about $57.6 million, which must be paid within a "reasonable time," according to the federal court document.

Bank of America acquired Countrywide in 2008.