In her upcoming book, The Secret Club That Runs the World, CNBC reporter Kate Kelly examines the fraternity of commodities traders whose deals for oil, copper, and livestock create billions in profits. In the excerpt below, she looks at a bad bet Delta Air Lines made on oil prices.

Jon Ruggles was working in his Houston office one morning early in 2011 when a headhunter called with something intriguing. Delta Air Lines DAL was searching for a vice president of fuel, the recruiter said, and the person it hired would rebuild the carrier’s commodity contract trading, or hedging, from scratch. Delta wanted to do everything differently, he explained; it was a serious opportunity, or he wouldn’t have bothered to call.

Ruggles, whose floppy hair and innocent face gave him a boy-next-door quality even at 37, was content at Bank of America’s Merrill Lynch brokerage. Despite the fact that colleagues would occasionally joke about his designer jeans and know-it-all attitude, Ruggles felt comfortable at the place.

That hadn’t been the case everywhere. Ruggles’ résumé was filled with two- and three-year stints. Over the nearly 15 years since leaving a post in the Army, he’d worked in practically every part of the energy-trading business, from drillers to traders to consultants. He’d lived temporarily or more permanently in Houston, London, New York, Los Angeles, and Moscow. But the airline industry, which was notorious for bad trading decisions and a stodgy culture, was one area where he’d never thought to work.

Airlines had a reputation for being comically bereft of any trading savvy, as exemplified by disastrous bets like the one that had led to Emirates Airline’s multibillion-dollar margin call during the crude-oil rout of 2008-09. US Airways Group, also seemingly incapable of navigating the energy markets cost-effectively, had recently given up on hedging the price of fuel through commodity contracts altogether. Others were still tinkering with their programs after experiencing setbacks. Only one, Southwest Airlines LUV , was known for betting correctly over the years, and even its track record had been mixed.

Once he passed the first few rounds of interviews, Ruggles flew to Atlanta to meet Delta’s president, Edward Bastian, and its chief executive, Richard Anderson. The executives were frank about their problems. Delta had been unsuccessful in hedging jet fuel, they explained, and had been burdened with the cost of purchasing hundreds of millions of dollars in commodity positions that hadn’t bet accurately on future market prices, making them useless as a way to curb jet fuel costs.

WHITE BOOK

Delta had bought oil contracts when prices were racing higher and then sold them when prices were lower — the exact opposite of what a good investor would do. Its fuel-hedging loss for 2009 alone had been an astonishing $1.4 billion, a bill that put the company into the red for the year. Since then Delta had slowed the hemorrhaging of money, the executives said, but there was much more still to accomplish if they were to make their hedging efforts truly worthwhile.

In the meeting Ruggles kept his characteristic bluntness, which often got him into trouble at work, in check. In his mind he was horrified. Some of the trades Delta was considering as ways to fix the problem were galactically stupid, he thought. Even as the three men spoke, Delta held a collection of crude-oil contracts, the products most often used to smooth out swings in the price of jet fuel, that were costing hundreds of millions of dollars to keep active. The contracts wouldn’t be successful unless crude prices rose substantially from the $100 level where West Texas oil contracts then were. Keeping all that in mind, Ruggles told the executives that their concerns were warranted.

When he arrived at his new job with a $300,000 salary and $1 million signing bonus, there were some checks on Ruggles’ ability to make changes. Delta’s conservative hedging policy, which forbade the use of complex commodity contracts, he noticed, restricted the possibilities. In general, Ruggles was limited at the time to using options, the right to buy or sell crude at predetermined future prices, and other commonly traded products. But he could put together more sophisticated positions if he did it in a piecemeal fashion, buying single components of the overall bet to build the broader wagers over time.

Using the more incremental approach, then, Ruggles revamped Delta’s market bets with a series of options trades tied to a spectrum of different crude prices. The strategy worked well. Crude stayed in the desired place for the next several months, and Delta’s cost of hedging fell substantially.

Satisfied, Ruggles turned his attention to the physical and technical operations of Delta’s fuel-hedging business. He hired a few more traders and moved the entire group over to the finance floor. He also put up Bloomberg market data terminals, which were ubiquitous on Wall Street trading floors, and set up exchange accounts for Delta on both the Chicago Mercantile Exchange and the IntercontinentalExchange. He arranged for Delta to trade directly with places like Cargill and Koch Industries rather than contacting them through middlemen. When two-foot-deep desks designed for flight reservation takers arrived in his team’s new workspace, Ruggles sent them back, insisting that the group work off a traditional trading desk, which would allow them to collaborate better.

Ruggles also put together a risky trade in heating oil, often used as a hedge for airlines and other energy traders because it was correlated to crude and jet fuel. The bet generated some $100 million and helped to push the airline’s profit-sharing pool into the black. All in all, Delta’s hedge book generated $420 million in gains for the year, capping what could only be considered a remarkable turnaround from where it had been less than a year before.

Despite his early success, Ruggles was in other ways off to a very bad start. Trey Griggs, a senior salesman at Goldman Sachs, which was one of Delta’s primary brokerage firms, called Ruggles shortly after he initiated the heating oil trade. “What the hell are you doing?” he asked. Griggs wanted to know why the airline would possibly want to reserve the right to sell a commodity like heating oil, which seemed like a trade pretty far afield from Delta’s core needs. “From day one,” says a Goldman employee briefed on Delta’s trades at the time, “everybody in the industry thought he was a lunatic.”

Less than a year into his tenure at Delta, Jon Ruggles was upending the airline’s broken hedging operations. His risky heating-oil bet had effectively funded executive bonus checks during a cash crunch. And he was modernizing the flier’s philosophy on trading in general. Ruggles’ little third-floor conclave in the finance building, which had started with a handful of employees and a useless hedge book, now numbered 20.

“The people in the group were like celebrities around the campus,” Ruggles recalls. He made a number of motivational speeches about the hedge group’s accomplishments. “Speaking to a group of 200 flight attendants and saying we were winning the war on fuel — that’s powerful,” he remembers.

That winter Ruggles had put in place a fresh trading position, effectively betting that crude contracts would linger in a range between $105 and $125. During a period when oil was trading in the low $110s for weeks, it seemed like a pretty wide berth.

Initially it worked. For the first quarter of the year, as Brent crude popped 9%, the hedge book generated gains of $45 million, helping Delta stay in the black. But by early June, sparked by robust production from the oil-producing nations of the Middle East at a time when demand in the U.S. was at a 15-year low, crude had crossed below $100 and was now significantly cheaper than the $105 level Ruggles had pinpointed earlier that year as the commodity’s expected bottom price.

The result was a rich irony: Crude was now relatively cheap, but Delta’s hedges were costing it money. To subsidize its trading, the airline had to sell some of its more valuable contracts, which were options, or the right to sell crude, at $105. But it wasn’t enough. As oil got cheaper and cheaper, Delta’s brokers started making additional margin calls, asking for more cash to fund the trades Delta had made.

Ruggles, who was on paternity leave, cut it short to come back to handle the growing crisis. Instead of rushing back to manage the book, however, he was dispatched to Japan to meet some oil executives in Tokyo; it was as if Delta didn’t want him around. Meanwhile, Delta’s president, Bastian, and its treasurer took over the trading. Ruggles says he suggested leaving the original hedge book intact, arguing that even below $105 for crude, the level at which the commodity contracts were no longer effective at hedging crude prices, Delta wouldn’t lose much money because the price of actual jet fuel would be more affordable. But senior management ignored his counsel, he says, buying swaps, or private contracts, betting that the market would stabilize at about $100. “They doubled down when we should have gone the other way,” Ruggles recalls. Eventually, with crude falling to $88, the paper losses mushroomed.

Still, the damage was somewhat contained. Thanks to improvement in passenger revenue, Delta managed to make a profit for the second quarter, despite rising jet fuel costs and a margin requirement of $350 million.

By that fall Ruggles was struggling. He was sleeping poorly, eating junk food, and not seeing nearly enough of his wife, Ivonne, and their new baby. Plus, he was being frozen out of key decisions. Yet despite the turmoil at Delta, he had side projects — including his personal trading account, where for years he had traded contracts on crude, heating oil, and several other high-volume energy commodities in an account registered under his wife’s name. Since Ivonne, who had changed her surname to Ruggles, handled all their finances anyway, using her name seemed a natural step.

Personal trading was common in commodities markets, but not among corporate employees. Some companies, perhaps not thinking ahead about the nature of the work their hedgers performed, didn’t explicitly forbid it. And Ruggles’ personal trading activities had escaped notice at Bank of America while he was there, perhaps because his role was one that didn’t directly involve investing client money.

Late in 2012, however, Delta received a subpoena from the Commodity Futures Trading Commission asking for trading records pertaining to either personal or corporate trading in which Ruggles had engaged. The company itself was apparently not a target. But its head of fuel was.

The implications of the subpoena were grave. As the architect of Delta’s hedging strategy, Ruggles had been in regular possession of nonpublic information on what one of the world’s biggest energy buyers planned to do in the markets. A large enough trade in the crude market could move prices around by multiple dollars per contract; anyone who had advance notice of such a sale could theoretically make huge profits trading ahead of it. And since Ruggles was trading some of the same products at home that he traded at work, the potential for using his corporate knowledge to inform personal positions was omnipresent.

Ruggles argued that the inquiry was not a big deal. The CFTC had been looking at him for a while, he said. (At that point, he later explained, it had probably been more than a year.) He had a personal lawyer in Washington, D.C., and regarded it as his problem alone — nothing for the carrier to worry about. Delta’s lawyers talked over the situation. It seemed strange that Ruggles wouldn’t discuss the probe in greater detail, especially if he had known about it for a while. Surely he realized his job was on the line, they thought.

Later Ruggles would say there were many factors that led to his eventual split with Delta, but that the probe had played “zero” part in his departure. He talked about the criticism Delta had received earlier that year when it had bought an oil refinery, and the blowback he had gotten from brokers like Goldman, which were allegedly concerned about Delta’s trading activities.

But Ruggles’ exit from the company was abrupt to say the least. When the subpoena arrived, he was not in the office, and one of Delta’s higher-ups called him for an explanation. Delta asked again that he return to brief the company’s lawyers. When he did not respond, the company gave him an ultimatum: Show up for a meeting by a certain date in December or be terminated.

He never returned.

Excerpted from The Secret Club That Runs the World: Inside the Fraternity of Commodity Traders, to be published in June 2014 by Portfolio, a member of Penguin Group (USA) LLC. Copyright © 2014 by Kate Kelly.

This story is from the June 16, 2014 issue of  Fortune.