JPMorgan (JPM  ) shares initially opened 3% lower after the company handily exceeded analysts' estimates on the top and bottom lines but issued cautious commentary about the macro environment. Traders furiously bought the dip as shares closed up by more than 2.5%. The stock is now at a six-month high, and it's up by more than 40% from the October low.

Given JPMorgan's size and diversified business in addition to traditionally kicking off earnings season, the bank's results are seen as a bellwether for the economy. And like the economy, the company continues to perform well despite numerous headwinds.

Inside the Numbers

In Q4, JPMorgan reported $3.57 in earnings per share which were well above analysts' consensus estimate of $3.07 in earnings per share. Revenue also came in above expectations at $35.6 billion vs $34.3 billion. Overall, earnings were up 6%, while revenue was 17% higher compared to 2021's Q4.

The biggest contributor to the bank's revenue and earnings beat was the strength in interest income which was up 48% due to strong loan demand and higher rates. In total, net interest income came in at $20.3 billion while analysts were looking for $19.3 billion.

One factor in its initial weakness was an unexpected $2.3 billion provision for credit losses which was nearly 50% higher than last year. Despite its strong quarter, the bank noted some 'modest deterioration in the Firm's macroeconomic outlook, now reflecting a mild recession in the central case'.

This wasn't too surprising to anyone who has been paying attention to CEO Jamie Dimon's public comments about the economy, where he has consistently struck a cautious tone. The bank's base case is a mild recession which will push the unemployment rate to 4.9%. Some of the risks it sees are continued geopolitical tensions, higher energy and food prices, purchasing power being eroded, and the Federal Reserve's aggressively hawkish policy.

In terms of guidance for 2023, the bank said it expects $73 billion in net interest income, and $81 billion in expenses, about $5 billion more than 2022 due to higher wages, higher headcount, and some planned investments in tech upgrades.