As a businessman, Donald Trump gained fame as a gambling czar rivaling his renown as a developer. But a close examination of his record in gaming reveals that while Trump profited richly, his stock and bondholders could hardly have fared worse. It’s undeniable that Trump’s special arrangements with his casino company displayed his trademark creativity. Among the most imaginative deals was a package that gave him a bonus despite the fact that his casino empire was losing tens of millions of dollars a year, and an agreement to that had the casinos spend hundreds of thousands of dollars a year on Trump Ice bottled water for the mini-bars. That’s a lot of chips for flat aqua bottled in plastic.

From mid-1995 to early 2009, Trump served as chairman of Trump Hotels and Casino Resorts (renamed Trump Entertainment Resorts in 2004), and held the CEO title for five years (mid-2000 to mid-2005). During Trump’s 13 years as chairman, the casino empire lost a total of $1.1 billion, twice declared bankruptcy, and wrote down or restructured $1.8 billion in debt. Over the same period, the company paid Trump—essentially Trump paying himself—roughly $82 million by Fortune’s estimates, collected from a dizzying variety of sources spelled out in the company’s proxy filings, as varied as payments for use of Trump’s private plane to fees paid directly Trump for access to his name and marketing expertise.

It’s important to recognize the importance of the casino empire’s role in Trump’s vaunted mid-1990s comeback. At that time, Trump was still struggling financially from his missteps of the late ’80s and early ’90s. The IPO of Trump Hotels was what finally fueled Trump’s comeback, and eventually to his current highly disputed claim that he is now worth over $10 billion. That climb got its start with financing through the offering from individual and institutional investors and bond investors, which in large deals like Trump’s were typically pension funds and insurance companies.

In June of 1995, Trump took Trump Hotels public, and it soon grew to encompass three Atlantic City casinos, the Trump Plaza, Trump’s Castle, and the Trump Taj Mahal, as well as a riverboat emporium in Gary, Indiana. By 1996, the company boasted a market cap exceeding $1 billion, making Trump’s 41% stake worth around $400 million. That was perhaps the only time a major pillar of the GOP front runner’s net worth was verifiable and transparent.

(Read More: Why Former Trump University Students Are Suing For Fraud)

But from its beginning as a public company, Trump Hotels struggled under a heavy debt load, which started at $494 million, and rose to $1.8 billion as Trump piled on more and more debt consolidating his empire under the public company. In the end, it was the excessive borrowings that proved the company’s undoing. Nonetheless, it never seemed to diminish Trump’s annual paycheck.

 

That’s because Trump’s bonus arrangement with the company sidestepped the ravages of debt. Under his unusual pay deal, Trump Hotels granted its chairman annual incentive pay based on EBITDA, an acronym for earnings before interest, taxes, depreciation and amortization. The key omission is interest. The deal, eventually called the Castle Services Agreement, stipulated that if Trump¹s Castle, later renamed the Trump Marina, generated EBITDA of $50 million or more, Trump would receive a payment guaranteed payment of $1.5 million. In addition, he’d get an extra bonus, called a “profit override,” of 10% of every dollar exceeding $45 million.

The rub was that though the Trump Marina posted decent operating earnings before interest expense, its part of the company’s huge debt load resulted in big losses after paying its creditors. From 1999 to 2001, the Trump Marina lost $76 million as interest payments swamped its operating profits. That picture applied to the entire company. Over the same three year period, the company¹s interest bill totaled a staggering $646 million, almost twice its earnings from operations. Those interest costs were the principal component of its combined net losses of $278 million over those three years. But because of the EBITDA formula, Trump still qualified for an annual bonus. Over that period, Trump pocketed $7.5 million from the Castle Services agreement, and around $15 million over the seven or so years the arrangement existed.

Castle Services was just one fixture in a broad array of special deals Trump cut with his own company. In 1995, Trump Hotels leased Trump-owned land next to one of the casinos for $3.3 million, and purchased two parcels from its chairman in 1995 and 1996 for a total of $24.6 million. In the former year, it agreed to “forgive” a $3 million loan to Trump—for money he’d spent developing the riverboat casino—if sometime over the next two years, the stock price exceeded $25 for ten of 15 trading days. Trump Hotel’s shares clearly that mark in March of 1996, and the loan was canceled.

Unfortunately, the stock performance that management assumed was durable enough to justify that generous loan forgiveness was not to last. The stock peaked the month of the debt forgiveness at $29.25, and fell steadily from there—to just over $1 by the end of 2001.

The company also rewarded Trump for “utilizing certain facilities owned by Mr. Trump to entertain high-end customers.” Those expenses totaled $4.65 million from 1998 through 2000. In 1995, Trump’s gambling empire signed a 10-year lease to rent space in Trump Tower, the casino chairman’s Fifth Avenue office building, for $115,000 the first year, and rising from there.

In the 2006 proxy statement, Trump Hotels disclosed that it paid $87,000 “for the periodic use of Mr. Trump’s airplane and golf-courses to entertain high-end customers” and $319,000 to “pilot and maintain” the jet. Purchases of “Trump labeled merchandise” came to $563,000, “including $470,000 for Trump Ice bottled water served to our customers.”

In 2003, amid big losses, Trump Hotels ended the Castle EBITDA agreement. But Trump still cleaned up. It was replaced by a guaranteed $2 million annual fee in exchange for his marketing support.

Trump Hotels and its successor, Trump Entertainment, filed for bankruptcy in late 2004, then again in early 2009, when Trump finally departed as chairman. The company’s travails weren’t over. It surrendered to chapter 11 a third time in 2014. It’s now a subsidiary of Icahn Enterprises, run by The Donald’s now friend, legendary financier Carl Icahn.

No amount of spin will make Trump’s dozen years at the helm of a Trump Hotels, the only public company Trump has ever run, look like anything but a flop that damaged thousands of shareholders, bondholders, and workers. The sole “winner” now packs arenas across America, mesmerizing tens of thousands of cheering fans with tales of his business triumphs.

Update: An earlier version of this story said that Trump’s Castle Services agreement covered profits at all of his casinos. In fact, it only applied to the EBITDA profits of Trump Castle.