Wild markets are the gift that keeps on giving for Wall Street banks’ trading operations. 

First it was the pandemic, which sent stocks down sharply in early 2020. A massive infusion of government cash arrested the decline and fueled a swift recovery. Everything went up. Meme stocks, a boom in public offerings and the crypto craze followed. Now, inflation and recession fears are sending everything back down again.

Banks make money on the way up and on the way down through trading desks that work the connections between buyers and sellers. JPMorgan Chase & Co. and Citigroup Inc. both expect the second quarter to be among their best ever for trading revenue. At JPMorgan, trading revenue is expected to rise 15% to 20%, executives said recently. Citigroup expects trading revenue to jump more than 25%.

A year ago, bankers were saying they expected the pandemic-era trading boom to peter out. They have been wrong ever since. 

Indeed, little has gone according to plan since Covid-19 struck. U.S. inflation continues to come in higher than expected, reaching levels unseen in decades. Global supply chains thought to be temporarily disrupted by the pandemic remain snarled, pushing up commodity prices. The dollar is rising when inflation should be sending it lower. Recession fears are growing, yet unemployment remains low and American consumers appear to be in good financial health

The confounding economic picture has investors selling stocks and bonds all at once, keeping Wall Street’s trading floors busy. Stocks rallied Wednesday after the Federal Reserve approved its biggest interest-rate increase since 1994, reflecting in part continued expectations on the part of some investors that the market is due for a bounce after this year’s steep declines.

Heading into this week, U.S. cash equities volume was up 16% from the same period a year earlier, according to Credit Suisse analysts. Equity futures and options were up 12%. Both climbed 77% from the second quarter of 2019. While volume is down a bit compared with the first quarter, the analysts said the seasonal decline is smaller than normal.

Volatility also is up sharply for equities and bonds. That is usually good for banks, because it creates more trading volume. The CBOE Market Volatility Index, or VIX, has been on average 48% higher than it was in the second quarter of 2021. A comparable measure for bonds, the ICE Bank of America Merrill Lynch Move Index, is double what it was a year ago.

“Volatility is basically our friend, and we’ve not just had volatility in one or two asset classes,” Andy Morton,

Citigroup’s global head of markets, said at a conference Wednesday. 

Citigroup, he said, has benefited from big corporations trying to insulate their businesses from swings in global interest rates, foreign exchange and commodities. 

Still, market swings aren’t all good news for banks. The stock-market rout has squashed the market for initial public offerings and quieted a merger boom that minted money for banks for much of the past two years. Globally, second-quarter merger volume is down about 20%, according to Dealogic, and IPO volume is down some 70% from a year ago.

SHARE YOUR THOUGHTS

When do you expect bank revenue from the trading of stocks and bonds to return to normal? Join the conversation below.

Mr. Morton said he expects investment-banking fees to fall more than 50% across the industry, Citigroup included.

“Banking is in a difficult spot right now,” Morgan Stanley Chief Executive James Gorman said Monday, alluding to this year’s slow pace of IPOs. “Is it permanently hit? No. It’s delayed. Trading remains active. If trading softens over the next few months, so be it.”

Write to David Benoit at David.Benoit@wsj.com