Even though the economy as a whole is stagnating, American banks are enjoying the best of times.

The primary reason is that interest rates on deposits are the lowest in generations. Interest rates on loans are also down, but not nearly as much.Commercial banks earned $7.9 billion in the April-June quarter, breaking the record of $7.6 billion set in the first quarter, the Federal Deposit Insurance Corp. said Wednesday.

That puts the industry on track to easily break the annual earnings record of $24.9 billion set in 1988, the agency said.

The FDIC attributed the improvement to a modest shrinkage of bad loans and to the fifth straight quarterly increase in the spread between deposit and loan rates.

"You've got to go back to the Great Depression to find deposit rates as low," said Robert K. Heady, publisher of Bank Rate Monitor in North Palm Beach, Fla. "Banks have widened the spread at consumers' expense."

Passbook savings accounts, now earning an average of 3 percent interest, are the lowest since 1936, he said. Rates on one-year certificates of deposit have declined by more than six percentage points since April 1989 while auto loans have fallen only three percentage points and unsecured personal loans by about three-quarters of a point, he said.

Meanwhile, the FDIC said, the condition of its insurance fund for bank deposits improved but remained in the red. At the end of June, it stood at a negative $5.5 billion, compared with a negative $7 billion six months earlier.

Most of the improvement came because lower interest rates increased the agency's estimate of what it was likely to gain from selling the assets of failed banks.

A raft of financial indicators for the nation's 11,685 banks improved in the second quarter.

The average return on assets, 0.94 percent, was the highest since the FDIC began collecting quarterly income data in 1983.

Banks' cushion of capital, at 7.23 percent of assets, was the highest since 1966.