JPMorgan, Goldman Sachs smiling today

jp morgan earnings exterior

For JPMorgan, Main Street may be looking better than Wall Street.

That was the takeaway from the company's second-quarter earnings Tuesday: growth in consumer and community banking made up for a sharp drop in trading revenue. And a significant uptick in deposits and credit cards was yet another sign that consumers helped drive its latest results.

Related: Finding a low-fee prepaid card is about to get easier

"Consumers, middle market companies and corporations are in increasingly good financial shape and the labor market is showing steady improvement," Chairman and CEO Jamie Dimon said in a statement.

Still, profit and revenue were lower compared with the same quarter last year, when the bank's mortgage machine put up big numbers. JPMorgan said mortgage originations fell 66% from that period.

JPMorgan (JPM) reported a second-quarter profit of $6 billion, or $1.46 per share, significantly better than the $1.30 per share analysts were expecting. Revenue came in at $25.3 billion, which also beat forecasts.

Analysts and investors were relieved to hear Dimon on the company's earnings conference call. The bank chief was diagnosed with cancer earlier this month, but sounded upbeat and reassured investors that his prognosis is "excellent" and that he plans to continue working through radiation treatment, which he will start soon.

"I feel great, I have some of the best doctors doctors in the world," Dimon said. "I am fortunate that this is curable."

Anthony Polini, a bank analyst with Raymond James, gave kudos to JPMorgan for promptly disclosing Dimon's diagnosis. "I don't see how they could have handled it any better," he said.

Despite the less-than-stellar trading atmosphere, one bank is smiling big: Goldman Sachs (GS) reported earnings Tuesday that also exceed expectations.

It was a much different kind of win for Goldman compared to its rival JPMorgan. Even though Goldman Sachs relies heavily on its trading prowess, the bank pulled off a strong quarter thanks to a hot investment banking environment for mergers and acquisitions and initial public offerings.

Related: IPO market achieves liftoff

Goldman Sachs made $2.04 billion, or $4.10 per share in the second quarter on revenues of $9.13 billion. Both earnings and revenue surpassed analyst predictions.

The bank's revenue from underwriting bonds came in at a record high. Many companies have taken advantage of persistently low interest rates to fund bond offerings, and fees from such activities can be lucrative for banks.

Related: Bond investors chase yield in scary places

JPMorgan also experienced strength in investment banking, proving that its good fortunes last quarter weren't all thanks to the consumer.

Still, a steep drop-off in trading revenue worrisome for Wall Street. Trading in both stocks and bonds fell at both banks due to lower market volume and stricter regulation.

But Marty Mosby, a bank analyst with Vining Sparks in Memphis, Tennessee, said that Goldman's bond trading business should pick up once there's a clearer picture of where interest rates are going.

JPMorgan shares jumped almost 4% in afternoon trading Tuesday, while Goldman was up about 1%

CNNMoney Sponsors