Hundreds of thousands of Robinhood Markets Inc.’s customers bought shares in the trading app’s rocky initial public offering earlier this week.

In a post on its app, Robinhood said 301,573 users participated in the IPO, which raised about $2 billion and valued the company at $32 billion. That represents about 1.3% of the company’s 22.5 million funded accounts as of June 30.

Breaking with recent Wall Street tradition, the company sold a big chunk of the shares in its hotly anticipated debut to the small-time investors who trade on its app. As much of 25% of the IPO shares went to Robinhood customers, The Wall Street Journal earlier reported. In a typical IPO, individual investors get well under 10%.

The decision helped make for a volatile first day of trading in Robinhood shares. The stock opened Thursday even with the $38 IPO price and quickly fell more than 10%. It closed down 8% at $34.82. The stock did a bit better on Friday, closing up about 1% at $35.15.

An allocation of 25% would mean the average Robinhood customer participating in the IPO spent about $1,600 to buy 41 shares.

While a small share of Robinhood’s customer base, the number of users who invested in the deal is high for a typical IPO offered on the trading app. Some 78,250 Robinhood users bought shares in fitness company F45 Training Holdings Inc.’s recent public offering, the most popular IPO offered on Robinhood before its own.

The brokerage app Robinhood has transformed retail trading. WSJ explains its rise amid a series of legal investigations and regulatory challenges. Photo illustration: Jacob Reynolds/WSJ The Wall Street Journal Interactive Edition

Write to Marie Beaudette at marie.beaudette@wsj.com