Some might describe it as one of the most successful prop trading bets since the crisis.

Goldman Sachs is on track to earn as much as a 12,000% return on an extremely prescient $5 million investment in Uber Technologies made back in 2011, just a year after the company started offering rides via a mobile app. Though the profit from this investment is many times larger than total underwriting fees from the deal, the roughly $600 million windfall (assuming Uber debuts near the top of its recently lowered trading range) is still only cold consolation for Goldman's top tech bankers, who recently suffered a stinging defeat at the hands of their arch-rival Morgan Stanley when the lost out on the honor of being the lead underwriter in the upcoming offering.

Because at Goldman, there's no excuse for leaving any fee revenue on the table. Especially when that capital instead goes to Morgan Stanley on a deal Goldman should have won.

In a story published on Monday, Bloomberg chronicled how Goldman became the first major bank to actively court Uber's business, beginning with the venture-fund investment back in 2011, before watching Uber's loyalties shift as Gary Cohn - Uber's biggest advocate from within Goldman - departed to serve in the Trump Administration, and Uber co-founder and CEO Travis Kalanick was ousted by his own board after a series of embarrassing PR scandals that nearly upended the firm's business.

Gary Cohn

It also puts the longtime rivals in an unusual position: Goldman now finds itself rooting for Morgan Stanley. It's a rare example of where the two banks' interests are perfectly aligned.

Cohn, who has largely kept away from the limelight since his star turn as one of Michael Wolfe's key sources in 'Fire and Fury;' seized on the opportunity to regale Bloomberg's reporters with stories about the tremendous foresight he exercised in marshaling Goldman toward the deal. To hear Cohn tell it, his persuasiveness managed to overcome the skeptics inside Goldman, including, according to some anonymous sources quoted in the story (though Cohn reportedly wouldn't name names), CEO David Solomon.

Though in the spirit of giving credit where credit is due, BBG acknowledged that Solomon championed the creation of the internal fund that financed the deal, which consisted entirely of the bank's own money.

In the years after the financial crisis, Solomon - then Goldman’s co-head of investment banking, and now the firm’s chief executive officer - championed the creation of a fund that drove the investment in Uber, according to Gregg Lemkau, who led the tech, media and telecom group at the time and now leads the firm’s investment banking division. The fund held a dedicated pool of the bank’s own capital for dealmakers to deploy in promising startups. The idea: Plow the money into fledgling companies and hope their growth simultaneously brings in profits and burnishes the Wall Street firm’s credentials for investment banking mandates.

Goldman's involvement with Uber started when one of the firm's top tech bankers first met with Kalanick at a pub in Dublin. That banker, Scott Stanford, soon became a trusted counsel to Kalanick.

"David had the foresight to develop an investing platform for his bankers," said Scott Stanford, a former Goldman Sachs banker who brought Uber to the attention of his bosses. "It’s a win-win for everyone." Stanford is now with the venture-capital firm ACME (formerly Sherpa Capital), another early backer of Uber. It was over meat pies and beers in a Dublin pub that Stanford first met Uber founder Travis Kalanick. At the time, Stanford was leading Goldman Sachs’s internet investment-banking practice and had previously secured investments in other companies, such as Facebook Inc. and LinkedIn Corp., from other corners of the bank. Before long, he had become a trusted counsel to Uber. When the ride-hailing company launched a fundraising round in 2011, Stanford pushed for Goldman to chip in some money.

When it came time to pitch the investment to Goldman's top executives, CFO David Viniar became convinced when he heard his college-age daughter raving to him about the app.

At Goldman, where rule-by-committee is the norm, there were a few unsure of putting the firm’s capital behind such an unproven company. Serendipity helped. One executive, former Chief Financial Officer David Viniar, told colleagues that the first he heard of Uber was from his daughter days before the investment came up for approval. She raved about a new app that brings cabs to your doorstep. The investment was green-lit and bankers set about figuring out how to get closer to the company. Cohn was quick to build a rapport with Kalanick, taking a liking to the brash and pugnacious founder of the ride-hailing startup during frequent trips to Silicon Valley. Other Goldman bankers on the ground like George Lee also courted the company, making sure Kalanick was at some of the firm’s marquee events, such as an annual confab for tech startups in Las Vegas.

A few years later, when Uber was again casting about for financing, Goldman put up another $1.6 billion mostly raised from the firm's private banking clients.

One former banker, Gautam Gupta, eventually moved over to Uber and rose to become the company's CFO. Around the same time, Cohn sought to "bear hug" the relationship - ensuring that Goldman would forever become the bankers of choice for Uber.

By 2015, Uber was growing rapidly but needed more cash to fund its unprofitable operations, so Cohn spearheaded a $1.6 billion deal that was largely marketed to his firm’s private-wealth clients. Meanwhile, Gautam Gupta, an up-and-coming Goldman banker, had moved to Uber and in the span of a few years climbed to CFO. It was starting to look like Goldman had set out a virtual no trespassing sign for rivals. Among members of Kalanick’s inner circle, it was understood that when the company eventually went public, Goldman Sachs would bag the top role, according to people with knowledge of the situation. "That would have been my view,” Cohn said. “I had a very, very strong relationship with that management team. I bear-hugged the relationship.”

Alas, this wouldn't last. After Trump's election, Morgan Stanley started making inroads by offering Uber aggressive financing terms.

Yet a sequence of events starting around 2016 began to change that.

When Uber canvassed a group of banks for new borrowings, it was Morgan Stanley that came back with the most aggressive terms. At the time, much of Wall Street was grappling with diktats imposed by federal regulators on lending to risky companies. Morgan Stanley proceeded anyway. Some bankers were frustrated with the rigid guidelines but decided to take the hit in favor of cultivating a promising client, people said. When authorities sent missives asking them to stay away, executives found more discreet ways to keep helping Uber -- like switching their role on debt deals to adviser instead of the lead arranger. Then two other developments weakened Goldman’s grip: Weeks after the 2016 presidential election, Cohn left to join Donald Trump’s White House. The next year, Uber’s top management was swept out, following allegations of boorish behavior and toxic workplace culture. Morgan Stanley kept edging into more conversations, private placements and debt deals. Michael Grimes, a top Morgan Stanley banker, even moonlighted as an Uber driver. And as one of Wall Street’s top underwriters of technology IPOs, Morgan Stanley was a safe pick for Uber’s board once it was ready to proceed with a sale.

Then an exodus of key Goldman employees allowed Morgan to steal the relationship out from under Goldman, a maneuver that culminated with Morgan being named "lead left" during the upcoming IPO, which is expected to go live on Friday.

We expect the bank's analysts to follow up with a 'buy' rating not long after.