You can’t necessarily bank on the future.

An astonishing 50% of US commercial banks could be gone in the coming years — a huge loss of over 3,000 FDIC-insured institutions — just as many start to report record profits, according to new research.

Banks in the US and worldwide are “not remotely” in a good place as the cost pressures of rapid advances in expensive technology shift customer assets to more innovative, nontraditional rivals — and hand the largest retail banks a clear advantage over undercapitalized players, according to bank technology expert Sultan Meghji.

The smaller US banks could disappear in a harsh wave of bank consolidations and failures.

“It wouldn’t be surprising if the number of banks in the US drops by 50% — while the five largest regulated entities grow their already massive amount of regulated deposits,” Meghji, CEO at Neocova, a financial services technology company, said.

McKinsey & Co., in a recent report, said almost 60% of banks in the US and worldwide could be wiped out in an economic downturn because of their low return on equity as well as technology challenges.

Since there were no small bank failures in 2018 and just four this year — City National Bank of New Jersey, Resolute Bank in Ohio, Louisa Community Bank in Kentucky and the Enloe State Bank in Texas — Dick Bove, chief strategist at Odeon Capital Group, thinks it would take an economic depression to shatter the current success of the American bank sector.

The trouble is overseas, according to Bove. And many say trouble overseas is bad for the entire global financial system.

“The Chinese banks have had massive amounts of real estate built up over the years which is not providing them a return — so there is a big risk there,” Bove said. “European banks are dealing with the negative interest rates, so there is a risk there, too.”

Meghji also said agricultural fallout from the on-again, off-again tariff wars with China can’t be discounted.

US farm foreclosures alone were up 24% in the 12 months ending September 2019, according to American Farm Bureau Federation statistics.