Avowed fast-food aficionado Warren Buffett was slated to get a very large payout from a hamburger joint as 2017 came to a close. His Berkshire Hathaway (BRK.A 0.55%) (BRK.B 0.50%) was essentially being paid back for a monster deal it helped finance in the restaurant industry.

As with many Buffett ventures, the arrangement has been a success. Let's unwrap it.

Juicy hamburger with all the trimmings!

Image source: Restaurant Brands International.

One giant burger

The company compensating Buffett for his meal is Canada-based Restaurant Brands International (QSR 1.00%), an ambitious young fast-food conglomerate. The driving force behind Restaurant Brands is 3G Capital, a Brazil-based investment company that bought fast-food mainstay Burger King for almost $3.3 billion in 2010.

Slightly over four years later, it purchased top Canadian coffee chain Tim Hortons in a $12.5 billion deal, with Berkshire's help. Subsequently, Burger King and Tim Horton's were merged into a single entity, RBI.

The RBI deal wasn't the first collaboration between 3G Capital and Berkshire. The two teamed up in early 2013 to acquire condiments-maker Heinz, which, through another corporate marriage, became Kraft Heinz the following year.

Back to RBI. Berkshire's assistance in that deal came in the form of $3 billion in financing, or almost 25% of the total price. For its money, Berkshire received just over 68.5 million preferred RBI shares. It was also given warrants -- technically, a single warrant -- allowing it to buy slightly over 8.4 million common shares at an exercise price of $0.01 apiece. Berkshire exercised the warrant immediately after the deal closed, and as of the end of September, it still held the resulting shares.

The financing deal gives RBI the option to redeem some, or all, of Berkshire's preferred stock. It indicated it would fully redeem the stake, plus dividends that have accrued from it. The redemption rate alone is 9.9%, which means Buffett is getting an effective interest payment of $297 million on the original $3 billion in financing.

On top of that are the dividends, which are hefty at 9% per year. This adds $810 million onto his return, which doesn't factor "an additional amount, if necessary, to produce an after-tax yield as if the dividends were paid by a U.S.-based company," according to a recent Berkshire regulatory filing.

On top of that, Buffett's investment vehicle still owns that RBI stake derived from the warrant. At the most recent closing stock price, that holding would be worth over $523 million, even after we net out the exercise price.

A need to spend

For any financier, it's pleasant to close a year by closing a deal. This one must be particularly heartening for Buffett, and not only because of the windfall. Earlier in the year, he came up to bat twice as a dealmaker, and whiffed in both instances.

The first was another attempted megadeal in league with partner 3G Capital, a Kraft Heinz play for European consumer-goods giant Unilever, which was swiftly and unceremoniously rejected by the target. The second was an attempted buyout of utility Oncor Electric Delivery. This one folded because the company selected a higher bid from another utility, Sempra Energy.

Ironically, it seems Buffett put up the financing for the RBI deal in order to put at least some of Berkshire's large and growing cash pile to active use. As of September, said stack had risen to $109 billion. A cash profit of over $1 billion in cash is nice, but it's going to make the pile even higher, if only incrementally.

That's a happy problem to have, but still a problem. I think, however, Buffett and his team will come up with some smart ways to utilize that money. We shouldn't be surprised to see more financing deals from Berkshire in the new year.