Like many Chinese people, Jacky hoped that he could make enough money investing in China’s stock markets to help pay for an apartment in a big city. But in 2015 he lost $30,000, and in 2021 he lost $80,000. After that, he shut down his trading account and started investing in Chinese funds that track stocks in the United States.

It’s a perilous time for investors in China. Their main vehicle, so-called A shares of Chinese companies, fell more than 11 percent in 2023 and have continued their losses this year. Many investors have instead flocked to the exchange-traded funds that track foreign markets and that have been performing much better.

Putting money in stocks is inherently risky. But Chinese investors are experiencing something especially alarming: financial losses in the markets, declining home values and a government that doesn’t want any public discussion of what’s happening.

With their frustrations piling up, Chinese investors recently found a way to vent that wouldn’t be quickly censored. They started leaving comments on an innocuous post about giraffe conservation on the official Weibo social media account of the U.S. Embassy in China. They lamented the poor performance of their portfolios and revealed their broader despair, anger and frustration. The giraffe post has been liked nearly one million times since Feb. 2, much more than what the embassy’s Weibo posts usually get. Many of the comments also offered admiration for the United States, as well as unhappiness about their own country.

“The different stock markets’ performances reflect the distances between America and China in terms of national power, technology, humanity and sense of well-being,” a commenter wrote.

The comments demonstrate a growing loss of confidence by the Chinese public in the stock market, the country’s economic prospects and the Chinese Communist Party’s ability to govern.