Xiaomi is a perfect example of how taking a company public can make a select number of shareholders a lot of money, even if the IPO flops.

The stock lost about 30% in the six months that followed its Hong Kong debut, making it the city’s worst-performing initial public offering with a value of at least $3 billion, according to data compiled by Bloomberg. Selling pressure intensified this week after a mandatory holding period for some investors expired Wednesday.

For those who snapped up stock in Xiaomi’s earliest funding round, offloading the shares this week still proved to be hugely profitable. They paid as little as 1.95 Hong Kong cents for a slice between September 2010 and May 2011, according to the Beijing-based company’s prospectus. Almost 4 billion shares were sold at that price. Early holders could have pocketed a 56 823% profit if they sold at Tuesday’s close of HK$11.10, without adjusting for stock splits.

You can’t blame investors for rushing to lock in those gains before things get worse for Xiaomi. Analysts have been trimming their profit and sales forecasts, blaming China’s slowing smartphone market and intensifying competition. Xiaomi was one of the most hyped IPOs of 2018, with bankers initially touting a valuation of as much as $100 billion. The company’s market capitalisation has dropped to about $30 billion.