Warren Buffett's $1 million bet that index funds would beat hedge funds got a lot of attention, but that charitable bet is a drop in the bucket compared to large bets on stock indexes he made for Berkshire Hathaway (BRK.A -0.28%) (BRK.B -0.68%).

When the $1 million charitable bet commenced on January 1, 2008, Berkshire Hathaway had already risked as much as $35 billion of its wealth that stock market indexes would go up over a period spanning 15 to 20 years, a bet that would grow as large as $38 billion just one year later.

Those wagers have paid off handsomely over the years, and some will expire this year, locking in big gains for Berkshire.

Warren Buffett at the annual shareholder's meeting.

Image source: The Motley Fool.

How Warren Buffett bet big on stock indexes

From 2004 to 2008, Buffett made a series of large bets that four major global stock indexes -- the S&P 500, FTSE 100, Euro Stoxx 50, and Nikkei 225 -- would go up over a period of 15 to 20 years. In effect, Berkshire Hathaway was writing insurance policies for investors who wanted to protect themselves against long-term losses in the stock market.

In his 2008 letter to shareholders, Buffett explained what made these insurance contracts so lucrative:

To illustrate, we might sell a $1 billion 15-year put contract on the S&P 500 when that index is at, say, 1300. If the index is at 1170 -- down 10% -- on the day of maturity, we would pay $100 million. If it is above 1300, we owe nothing. For us to lose $1 billion, the index would have to go to zero. In the meantime, the sale of the put would have delivered us a premium -- perhaps $100 million to $150 million -- that we would be free to invest as we wish.

At their peak, Berkshire could have lost as much as $38 billion on these wagers, assuming that the four stock market indexes fell to zero and never recovered. Of course, such a loss would be extraordinary, if not impossible. Thus, Berkshire's actual risk was much smaller, though difficult to quantify.

Early losses

Berkshire wrote most of its equity index bets over a period spanning from 2004 to 2008, though it didn't start breaking out much detail on the bets in its annual reports until 2008. The bets that remain open today generated approximately $4.2 billion in premiums for Berkshire, which it received up front.

The starting date for these wagers is important because the bets were generally made before the 2008 financial crisis and the precipitous decline in the value of stocks around the world. During the financial crisis, these bets resulted in massive losses, at least on paper:

Bar chart of losses from Berkshire's index bets

Data source: Securities and Exchange Commission filings. Chart by author.

If its bets were closed at the end of 2008, Berkshire Hathaway would have had to pay $10.8 billion to the parties who took the other side of the wager. But the bets were structured so that they could only be settled at the end of the contract period, or if both parties agreed to settling up early. Thus, Berkshire didn't have to lock in that loss by settling up earlier than it originally planned.

Over the years, global stock indexes have roared back from their crisis-era lows. If all of Berkshire's bets were closed today, it would pay out only $640 million in losses to investors who took the other side, thus booking a profit of approximately $3.6 billion, or the $4.2 billion premium received upfront minus $640 million in losses on a handful of wagers.

The first of Berkshire's big bets will be settled later this year, in June 2018, with all of its wagers coming to a close by January 2026. For now, it looks like Buffett's long-term bet on global stock markets was a genius move, giving Berkshire Hathaway $4.2 billion of cash upfront to invest as it pleased, and non-GAAP profits of $3.6 billion as of the third quarter of 2017.