JPMorgan Chase reported a better-than-expected quarterly profit on Tuesday as higher interest income and buoyant consumer lending offset lower activity at its trading desks.

Even as the world’s biggest bank recorded record earnings, there were warning signs that the playing field is beginning to tilt against the financial industry. JPMorgan’s net interest margin declined to 2.49% from 2.57% a year ago as deposit rates rose and the rate the bank paid on other borrowings rose.

Citigroup similarly reported a decline in net interest margin on Monday, which sent bank stocks lower.

Trading volumes have been lower at large US banks as a tit-for-tat tariff war between Beijing and Washington has kept investors on edge. A flattening of the yield curve and rising bets of an interest rate cut have also challenged banks’ ability to boost revenues.

Average loans at the largest US bank, however, increased 2% on the back of an 8% rise in credit-card loans.

The earnings beat was driven by JPMorgan’s consumer bank, Chase, which reported credit card loans were up 2%, credit costs were flat and overall income was up 22%.

Chief executive officer Jamie Dimon remained bullish about the US economy.

“We continue to see positive momentum with the US consumer – healthy confidence levels, solid job creation and rising wages – which are reflected in our Consumer & Community Banking results,” he said in a statement.

Income from consumer and community banking, JPMorgan’s largest business, rose 22% to $4.17 billion, offsetting declines across its other main businesses.

Total net interest income, the difference between what banks pay on deposits and earn on loans, rose 7% to $14.40 billion.

Investors, however, worry that if the US Federal Reserve cuts interest rates in July, it could pressure margins at banks, which have benefited recently from higher rates.

Net income climbed 16% to $9.65 billion. Excluding the tax gain, it earned $2.59 per share. Net revenue rose 4% to $29.57 billion.

Analysts were expecting earnings of $2.50 per share and revenue of $28.90 billion, according to IBES estimate from Refinitiv.

The bank’s return on tangible common equity, a key profit measure for how well it uses shareholder money, rose to 20%, up from 19% in the first quarter and higher than the bank’s 17% target.

JPMorgan’s results are closely watched by investors looking to gauge the health of the US economy.

Among other banks reporting results on Tuesday are Goldman Sachs and Wells Fargo.