The last laugh on the Flipkart deal could be reserved for Sam Walton reincarnated: current Walmart (WMT) - Get Report CEO Doug McMillon. 

Wall Street panned McMillon's $16 billion splurge on India's main grocery delivery platform on Wednesday over fears of short-term earnings dilution. To be fair, the market has good reason to be upset.

Walmart says that if the transaction were to close at the end of the second quarter of this fiscal year, it expects a negative impact to earnings of about $0.25 to $0.30 a share. Next year the profit hit could be around 60 cents a share. That's a stunning amount reflective of upstart Flipkart being nowhere near profitability. 

But, buried in the deal terms is this line: "While the immediate focus will be on serving customers and growing the business, Walmart supports Flipkart's ambition to transition into a publicly-listed, majority-owned subsidiary in the future." Should Flipkart go public, as is likely as investors (including Flipkart's founders, Microsoft (MSFT) - Get Report , etc.) seek to cash in on the excitement around India's retail market growth, Walmart stands to earn a hefty sum given its 77% stake in the company. 

Long-time Jefferies analyst Dan Binder ran some numbers. 

"Management was clear, the focus is to grow this business rapidly. It already disclosed 50% growth in the last year and if we assume that the company could grow its $4.6 billion in sales at 50% for the next three years, then an IPO two years from now would be factoring in about $15.5 billion in forward sales. Assuming a 2-3x multiple, WMT's 77% stake would be worth about $30 billion at the midpoint, which isn't too shabby. Valuation comps in the US are more plentiful than India from what we could find and our 2-3x multiple seems quite reasonable. As we look at comps in India, the range is wide but overall higher, possibly reflecting the large market and early stages of ecommerce growth plus some scarcity value for few public consumer ecommerce plays. As can be seen with a few examples below, a 5x multiple on EV/sales would not be unreasonable and that would produce much higher values or 2x the $30 billion mentioned above. Provided there aren't major surprises, this quick math would suggest that the market should have bid WMT stock up on this deal, not down. Of course, we understand the knee jerk reaction today, but we think long-term investors could end up getting rewarded nicely for this investment."

A $30 billion payday for an initial investment of $16 billion? Doesn't take a rocket scientist to understand why McMillon pulled the trigger.