Traders work on the floor of the New York Stock Exchange (NYSE) in New York City, United States during the IPO of Chinese ride-hailing company Didi Global Inc on June 30, 2021.

Brendan McDermid | Reuters

From Krispy Kreme to China’s Didi Chuxing, the busiest week for US IPOs in 17 years was a godsend for Wall Street’s top investment banks.

A cybersecurity company, drug developer and Turkish e-commerce platform were there. At least 14 companies have raised $ 100 million or more in bids on Nasdaq and the New York Stock Exchanges, the most active route for debuts since 2004.

In total, the underwriters generated nearly $ 400 million in fees for helping with the initial public offerings. They’re sitting on an additional $ 259 million in paper profits by Friday’s close of trading, assuming they exercise their options to buy all of their allotted shares at the IPO discount.

The pace of offerings underscores the demand for growth and shows that despite the surge in direct listings that have no underwriters and come with significantly lower advisory fees, IPOs remain the preferred route to market. It’s a very lucrative business for Wall Street and no slowdown is in sight.

Robinhood filed its IPO prospectus on Thursday and is poised to become one of the biggest offers of the year. Rising demand for crypto assets resulted in first-quarter revenue quadrupling to $ 522 million, while the company’s loss grew to $ 1.4 billion, in part due to an emergency fundraising related to the GameStop- Trade mania.

The stock trading app is likely to get a top rating in the market while playing a broader role in the IPO boom by giving retail investors the ability to invest in businesses that historically targeted large institutions. Robinhood reserves up to 35% of its IPO shares for clients.

“I think this is going to be one of the biggest meme stocks of the future,” Thomas Peterffy, chairman of Interactive Brokers, told CNBC’s “Squawk Box” on Friday. “They have negative equity, they have about zero profit, and they’re growing fast. That’s the kind of thing the market has been seeming to like lately. I look forward to them coming into the community and more and more people in the market.”

Goldman, Morgan, JPM the big winners

In last week’s initial public offerings, subscription fees ranged from 2% of the total in the case of massive funding from ridesharing company Didi, to 7% for smaller businesses such as offerings from healthcare companies CVRx, Aerovate Therapeutics and Acumen Pharmaceuticals.

Goldman Sachs and Morgan Stanley, as usual, generated the highest fee income by serving as lead managers for the IPOs of Didi and cybersecurity software provider SentinelOne, the two biggest deals of the week.

Morgan Stanley and JPMorgan Chase were the leading underwriters in the IPO of Turkish online shopping company D-Market Electronic Service & Trading, legal services website LegalZoom and Krispy Kreme, which were the third, fourth and fifth largest deals of the week, respectively.

Donuts will be sold at a Krispy Kreme store in Chicago, Illinois on May 5, 2021. The donut chain reported yesterday that it plans to bring the company back onto the stock exchange.

Scott Olson | Getty Images

In addition to advisory fees, IPOs underwriters also make money by giving them the option to buy stocks at the asking price so they can take advantage of the pop that typically follows. Not all of the issues last week had big initial rallies, but they all resulted in gains for banks that were able to get an allocation.

Despite Didi’s subdued gains in the first three days of trading, the stock’s 11% gain means the underwriters are up $ 66 million in exercising their options. SentinelOne’s paper earnings stand at $ 46 million after this stock rose 27%. The Xometry manufacturing market climbed 58% in three days, generating potential profits of $ 26 million to date, while airport security company CLEAR posted a $ 34 million increase after rising 53 percent.

For Morgan Stanley and JPMorgan, the record IPO stretch comes a week after the two banks were the leads in the IPOs of healthcare technology company Doximity and cloud software provider Confluent.

Those two offers paid combined underwriting fees of $ 74.7 million, and the Doximity deal included a stock allotment that made a profit of $ 83 million based on the IPO. However, Confluent took the unusual step of not giving the underwriters an option to buy at the IPO price.

The company has highlighted the potential importance of this decision in the Risk Factors section of its prospectus:

“Without this option, underwriters may choose not to enter into certain transactions that stabilize, maintain, or otherwise affect the market price of our Class A common stock, such as short sales, stabilizing transactions, and purchases to cover short positions, if any Had such transactions been involved, we would have given the syndicate banks such an option, “said Confluent.

Jeff Tangney, CEO of Doximity, told CNBC’s Deirdre Bosa that while an IPO was the right choice for his company, he is happy to see the rise of direct listings and special purpose vehicles (SPACs) as alternatives as competition drives the cost lowers.

Doximity paid a fee of 5.5% of the listing size, which is roughly this year’s average but below the top rate of 7%.

“It has improved the economy for us,” he said. “Banks ask less and do more, which is good.”

WATCH: Doximity CEO on doctors social network goes public