With Alibaba officially headed toward an initial public offering, it’s finally time for Yahoo! to cash in.

For years now American investors have bought shares in Yahoo, which owns nearly a quarter of Alibaba, as one of the easiest way to bet on a bright star of the Chinese Internet industry. By some measures Yahoo’s non-Alibaba business accounts for only about 12 percent of its market value.

In a sense, the coming windfall from the IPO will be a legacy of Yahoo’s past glory. It first invested in Alibaba in 2005, paying a piffling $1 billion for a 40 percent share back when the Chinese upstart was after some Silicon Valley savvy. But those roles have pretty much reversed: Yahoo is now the remora to Alibaba’s megaladon.

As of today Yahoo owns about a 24 percent stake of Alibaba, a portion that could be worth as much as $37 billion, according to an average of analyst’s estimates compiled by Bloomberg News. Yahoo will experience its windfall as a mixture of cash and continued equity. Because of agreements between the two companies, Yahoo has to get rid of a significant portion of its holdings the minute Alibaba goes public, selling those shares at the initial price and missing out on the first-day market bump.

Kenneth Goldman, Yahoo’s chief financial officer, recently told investors that Yahoo would likely sell 10 percent of Alibaba and hold on to 14 percent. Such a sale would mean $15.4 billion in cash, added to the $5 billion in cash that Yahoo had as of the end of last year.

This wouldn’t be the first time Yahoo has bolstered its coffers by selling off a portion of Alibaba. Yahoo made $4.6 billion in 2012 by selling shares back to Alibaba itself, valuing the company at a fraction of what it would be today. “Forgive me for using hindsight here, but clearly I wish we hadn’t done that,” said Goldman at a conference earlier this month.

If Yahoo isn’t thrilled at the idea of cashing in on Alibaba right now, investors sure are. Yahoo is up almost 3.5 percent since Friday, in anticipation that it will revisit a move made with its Alibaba cash last time around: a share buyback. SoftBank, which owns 37 percent of Alibaba, is also enjoying a pre-IPO rally that’s driving its shares up as much as 6.6 percent in early trading in Tokyo.

For Yahoo, however, the excitement could be short-lived. While the cash gives it more flexibility to bolster its core business, the company has already been spending like a drunken sailor, and with mixed results. Chief Executive Marissa Mayer has been focusing on increasing the number of people using its services, but this hasn’t been reflected in the company’s bottom line. Yahoo hasn’t had a year of revenue growth since 2008 and has seen its share of the digital advertising market drop every year for even longer.

Eventually the company will have to become something more than a clever way to invest in other companies. But it probably has a while to go before that happens.

Before it's here, it's on the Bloomberg Terminal. LEARN MORE