New York CNN Business  — 

Goldman Sachs revealed a 41% surge in revenue Wednesday as the Wall Street bank capitalized on booming markets and a flurry of dealmaking.

The stronger-than-expected results were driven by record investment banking revenue and a nine-year high for its trading arm.

Goldman’s robust quarter underscores the bifurcated rebound in the United States from the pandemic. Although unemployment remains high and bankruptcies are mounting, the red-hot stock market has largely recovered and companies are raising record sums of money in capital markets.

That backdrop plays perfectly to the strengths of Goldman Sachs, which is far more exposed to Wall Street than Main Street.

Goldman Sachs (GS) reported revenue surged to $13.3 billion, blowing away estimates of $9.8 billion. It was Goldman’s second-highest quarterly revenue ever.

Although net earnings were flat at $2.4 billion, that stands in stark contrast to the sharp declines in profit reported Tuesday by JPMorgan Chase (JPM) and Citigroup (C). Wells Fargo (WFC), the big bank most closely tied to Main Street, suffered its first loss since the 2008 financial crisis.

Per-share profit rose 8% at Goldman Sachs to $6.26, far exceeding expectations for $3.78.

Goldman Sachs CEO David Solomon acknowledged the “very challenging environment” and said the economic outlook “remains uncertain.”

Shares of Goldman Sachs rallied 4% premarket on the earnings beat. The bank is only down 7% so far this year, compared with a 36% plunge for the KBW Bank Index (BKX).

The return of greed has been good for Goldman Sachs

Goldman Sachs reported record investment banking revenue of $2.7 billion, including record revenue for underwriting both debt and stock deals.

That dealmaking was only made possible by the return of greed on Wall Street. Unprecedented action from the Federal Reserve – slashing rates to zero, buying unlimited amounts of government debt and even scooping up corporate bonds – unfroze capital markets. That paved the way for a resurgence of stock and debt sales that Goldman Sachs and other Wall Street banks earn fat fees on.

US companies raised nearly $190 billion via stock sales alone during the second quarter – the most on Dealogic records going back to 1995. That includes high-profile IPOs by online insurer Lemonade, software firm ZoomInfo and grocery chain Albertsons. Goldman Sachs said it ranked No. 1 worldwide in stock sales this year. And it’s No. 1 for advising on M&A deals.

Meanwhile, Goldman’s trading business, which has stumbled in recent years, is thriving on the market turbulence and a surge of trading activity by clients like hedge funds and portfolio managers.

The bank’s fixed income, currency and commodities unit generated $4.2 billion in revenue, the highest in nine years. Goldman cited “strong client activity.”

Goldman’s equities unit posted revenue of $2.9 billion – the highest in 11 years.

Like other banks, Goldman Sachs is also receiving a flood of new deposits. The bank’s digital consumer deposit platform, which launched years ago as Marcus, reported a record $20 billion influx in deposits to $92 billion.