Major U.S. banks are poised to report booming second-quarter revenue when results begin Tuesday, led by JPMorgan Chase and Bank of America, with trading income from equities and fixed income expected to approach or exceed records set earlier this year. The surge is being driven by a rare combination of massive deal fees, highlighted by last month’s SpaceX initial public offering, and heightened market volatility sparked by the Iran conflict, which has sent oil prices, interest rates and currencies swinging.

Wells Fargo analyst Mike Mayo described the moment as a “sweet spot” for the sector, noting that both Wall Street and Main Street profit engines are expanding simultaneously. “You saw the largest IPO in history, a pace of mergers that’s on track to be a record year, and a broadening out of trading to include equity and fixed income across myriad geographies,” Mayo told CNBC. He added that the favorable backdrop follows years of navigating higher rates and recession fears, and that “there’s not much more you can ask for.”

Investment banking revenue for the group could surge 26 percent from a year ago, while trading revenue could jump 14 percent, according to KBW analyst Chris McGratty. Besides the hundreds of millions of dollars in fees SpaceX paid banks, led by Goldman Sachs and Morgan Stanley, for the IPO itself, the firms also earned fees for raising debt for the newly public company and stand to manage the wealth of newly minted millionaires and billionaires.

Goldman Sachs and Morgan Stanley likely reaped so-called soft dollars from the SpaceX offering, said Jay Ritter, professor emeritus of finance at the University of Florida’s Warrington College of Business. Soft dollars are fees that hedge funds pay investment banks for a slice of an oversubscribed IPO. “The big money maker for investment banks in IPOs is not the bankers’ fee, but the ability to allocate shares to hedge funds and some active mutual funds that pay soft dollars,” Ritter said.

Trading gains were powered by strength in equities as stock markets climbed during the quarter, as well as heightened fixed-income activity after the Iran conflict sent oil prices, interest rates and currencies swinging, McGratty said. “Banks are doing a good job these days of capturing the upside of volatility, whereas in previous cycles they’ve been caught offsides,” he said.

Mayo contended that the more important development may be away from Wall Street, where commercial lending appears to be turning a corner after years of weakness. Banks are looking to wrest market share from private-credit lenders as an artificial-intelligence-fueled spending boom spreads through the economy. “Demand is back as companies treat the uncertainty as the new normal and build that new factory, invest in plants and get on with business,” Mayo said. The trend could benefit regional lenders such as Fifth Third, because commercial lending represents a larger share of their business than it does for diversified giants like JPMorgan. Consumer banking also appears resilient, rounding out a broadly positive picture for the sector.