Big Wall Street firms enjoyed a stellar 2021 thanks to a booming stock market and a frenzy of mergers and initial public offerings. Bankers and CEOs are reaping the rewards.

Goldman Sachs (GS) announced in its fourth quarter earnings report last month that it set aside $17.7 billion for compensation expenses last year, an increase of 33% from 2020. That works out to an average of nearly $404,000 for the firm’s 43,900 workers. Goldman Sachs CEO David Solomon was the biggest beneficiary. The bank said in a regulatory filing late last week that Solomon took home $35 million in compensation in 2021. That’s up from $27.5 million in 2020.

Solomon received a $2 million salary. The remaining $33 million of the CEO’s 2021 haul is what Goldman Sachs calls “annual variable compensation,” which Solomon received thanks to “the firm’s performance and continued strong progress on its growth strategy, as well as Mr. Solomon’s outstanding individual performance.” More than $23 million of that bonus was paid in stock.

Solomon isn’t the only top Wall Street executive raking in even bigger bucks. Morgan Stanley (MS) CEO James Gorman received a $35 million pay package last year as well, with much of the money also coming in the form of stock. Gorman earned $33 million in 2020. And JPMorgan Chase’s (JPM) long-time chief Jamie Dimon got a $3 million raise — to $34.5 million — in 2021.