Bank of America posted a profit of $3.5 billion in the second quarter on the back of a huge quarter from the bank’s trading and investment bank.

The Charlotte-based bank joined other Wall Street firms like Goldman Sachs and JPMorgan in benefiting from a volatile market bringing in huge fees for the firms’ trading operations. Bank of America’s global markets business brought in more profits by itself than the 3 other business segments did combined in the second quarter.

Still, steps are being taken at the bank to prepare for a wave of coming defaults from customers who were hurt economically by the coronavirus pandemic. Bank of America build up $4 billion in reserve in the second quarter to gird for that impact. The bank has now set aside over $7 billion in the past two quarters.

“In the most tumultuous period since the Great Depression, we delivered for our clients, our employees, our communities and our shareholders,” CEO Brian Moynihan said in a statement. Shares fell 2.7% to $23.93.

Revenue for the quarter dropped to $22.3 billion from $22.8 billion the quarter prior. Non-interest expense slid slightly to $13.4 billion from $13.5 billion last quarter. Profit in the consumer bank slid sharply to $71 million from $1.8 billion last quarter, offset by strong quarters in the global markets business and from its commercial lending business.

“One of the true advantages of our company is our diverse business mix,” CFO Paul Donofrio said on a call with reporters. Many of the businesses that helped drive the quarter’s profits were one’s the bank bolstered when it bought Merrill Lynch in 2008.

While its New York offices drove the quarter’s profit, the bank is still closely linked to the U.S. economy through its widespread deposit base. The bank has processed 1.8 million payment deferrals since the pandemic began, 1.7 million of which are still in place. Over 95% of credit card deferrals were from people who were current on their payments when they made the request.

Federal stimulus programs are broadly supporting American consumers and businesses at the moment, with expanded unemployment benefits paying unemployed workers $600 more a week. That stimulus expires at the end of July. Federal stimulus, among other programs, means that for the bank, “we are expensing losses today even though they haven’t happened yet,” Donofrio said.

The bank, which employs 16,000 in Charlotte, has said it won’t lay people off during the pandemic.

Wells Fargo, its big bank peer, pledged $10 billion in cuts Tuesday after a dismal second quarter saw the bank post its first loss since the financial crisis.