Jakub Porzycki | Nurphoto | Getty Images

Among the big winners in Elon Musk’s agreement to follow through with his deal to buy Twitter is an activist hedge fund based in a coastal Florida city that was just wrecked by Hurricane Ian.

Pentwater Capital, a 15-year-old firm with close to $5 billion in assets, bought a 2.4% stake in Twitter during the second quarter. The purchase of 18.1 million shares cost Pentwater roughly $725 million.

At $54.20, the price Musk has agreed to pay for Twitter, Pentwater’s stake would be worth about $980 million. The stock closed up 22% on Tuesday at $52, which is still below the acquisition price, signaling that Wall Street isn’t entirely convinced the deal will close.

The Tesla and SpaceX CEO said on Tuesday that he’d sent Twitter a letter informing the company of his intent to stick to the terms of the April agreement after previously trying to back out. The two sides were scheduled in court in two weeks, and part of Musk’s latest proposal involved putting an end to the litigation. Twitter has said it received the letter and intends to close the transaction at $54.20, but did not comment on the litigation.

When Pentwater jumped into Twitter, the social media company was in a holding pattern. The stock was languishing as Musk was putting out critical tweets about the company’s bot and spam problem, hinting at a sense of buyer’s remorse. The stock dropped as low as $32.55 on July 11, just after Musk officially tried to terminate the deal.

Pentwater was taking advantage of what the firm saw as a clear arbitrage opportunity. There was a signed contract on the table and a bunch of money to be made as long as the deal reached its logical conclusion.

“In my 23-year career doing this, I’ve never seen an acquirer walk away without any reason,” said Matthew Halbower, Pentwater’s founder, in an interview on Tuesday after Musk’s filing landed with the SEC. “The probability of him being able to walk away was very low.”

Halbower said the only two reasons that Musk would have to tear up the deal would be if there was fraud in Twitter’s financial statements or if there was a material event that changed the value of the company. Neither of those issues were at play, Halbower said.

Greenlight Capital also jumped in during the second quarter, paying an average of $37.24 for the stock. In an investor letter, Greenlight’s David Einhorn said there’s was $17 per share in upside rewards if the deal closed and an equal amount in losses if it collapsed.

“So we are getting 50-50 odds on something that should happen 95%+ of the time,” he wrote.

While Pentwater instantly made Twitter one of its top holdings when it purchased shares in the second quarter, the firm hedged its bet with a hefty investment in puts in case the stock dropped in value. So a portion of the gains from its equity investment will pay for the puts.

Pentwater has made other bets in and around the social media space. The firm is one of the top investors in Digital World Acquisition Corp., the special purpose acquisition company that’s been trying to take former President Donald Trump’s media company public, though the deal is being investigated by the SEC and the company recently missed a key deadline to hold onto $1 billion in funding. Trump’s app, Truth Social, was created after the ex-president was booted from Twitter following the events of Jan. 6.

Halbower said Pentwater has 44 employees, with just seven or so in its office in Naples, Florida. The firm also has locations near Chicago and in New York, Minneapolis and London.

The Naples office had its power restored on Sunday, four days after Hurricane Ian slammed into the west coast of Florida as a Category 4 storm. The office reopened on Monday, Halbower said.

Across the state, roughly 380,000 homes and businesses were without power as of Tuesday afternoon, down from a peak of 2.6 million on Thursday, according to PowerOutage.us. Collier County, which includes Naples, remains one of the counties with the most outages.

Pentwater isn’t the only investor that’s set for a big payday should the Musk deal close.

Longtime shareholder Saudi Prince Alwaleed bin Talal owns 39.95 million shares, worth $2.17 billion at the acquisition price. Jack Dorsey, Twitter’s co-founder and former CEO, owns 18.04 million shares, valued at close to $1 billion. Among institutions, the only investors with a bigger stake than Pentwater are Vanguard, BlackRock, SSgA and Fidelity.

WATCH: What is Elon’s real game here?