A new report from Boston Consulting Group found that the number of millionaires in China has soared to a record-high 4 million, thanks in large part to the country’s stock market boom. Just last year, the country added 1 million U.S.-dollar millionaires.

According to the South China Morning Post, citing the Boston Consulting Group (BCG), these new millionaires have at least $1 million in cash, stocks and other financial investments, excluding other assets like real estate, business ownerships, luxury goods and collectibles.

As a whole, the Chinese have become more prosperous with the growth of the middle class. Much of China’s wealth, outside of state-owned companies, is the result of entrepreneurial foresight on the part of the business owners who were on the front end of expansion. “China has been the workshop of the world, and the individuals who capitalized on that trend have done very well,” Mykolas Rambus, the CEO of Wealth-X, a wealth research firm, told the BBC.

Now the nation's economy is slowing, albeit to a pace still far faster than developed Western nations': In 2014, gross domestic product grew by 7.4 percent, the slowest in 24 years, versus 2.4 percent in the U.S. and 1.3 percent in the European Union. Despite the slowdown, the stock market has become another creator of vast wealth for many Chinese. 

The report said that China’s status as the nation with the second-largest population of millionaires was mainly driven by investments in stocks, as the equity market rose by 38 percent for the year.

Private wealth growth in the world last year was focused in the Asia-Pacific region (minus Japan), which outperformed average global growth. Private wealth in the region rose by 29 percent last year to $47 trillion, turning it into the second-wealthiest region in the world and overtaking Europe. The report explains that the boost was the result of private wealth growth, specifically in India and China.

That said, looking forward, growth will likely taper, as stock markets in Asia are expected to slow. “We have seen a really strong equity market that has had a very strong effect on existing assets,” Daniel Kessler, leader of BCG’s wealth management division, said. “But looking forward, we assume a moderation in the market performance.”