On Wall Street, the saying, “Pigs get fat, hogs get slaughtered,” cautions against excessive greed. The ditty came to mind this week after private equity pioneer Thomas H. Lee Partners gambled on a higher but riskier offer for its MoneyGram business. They lost.

Here’s what went down.

Jack Ma’s China-based Ant Financial and Kansas-based Euronet Worldwide got into a bit of a bidding war for THL-owned MoneyGram in 2017. At the time, MoneyGram shares were trading at under $13.

Euronet would end up bidding $15.20, while Ant Financial offered $18 a share.

Scott Sperling — THL Partners’ co-president, who is on the boards of Madison Square Garden and iHeart — and his team opted for Ant’s higher offer even though they were cautioned that it was a riskier bet, sources told the Post.

Taking the Euronet offer still would have netted Sperling and his fellow THLers a tidy profit.

The riskier bet last week came back to bite THL. After President Trump’s regulators at the Committee on Foreign Investment in the US, or CFIUS, rejected Ma’s proposal three times — the billionaire businessman walked away from the deal last week.

MoneyGram’s shares, which had soared to $17.92 soon after the Ant proposal was agreed to — but which had slipped slowly to under $13.50 as the likelihood of a deal eroded — fell to $11.71 after Ma ankled the deal. They closed Friday at $12.28, up 4.9 percent, but slipped 2.2 percent in after hours trading.

That leaves Sperling, at least in the short term, looking pretty silly.

Is Euronet still interested, and will it come back with its original $15.20 a share offer?

Who knows?

One source thinks getting the same value would be difficult.

THL owns 45 percent of the common stock, which is worth $279 million, and collected roughly $400 million in two secondary stock sales. That is less than the $750 million THL and co-investor Goldman Sachs invested in the 2008 recap.

The timing of the blowup of the deal is pretty bad for THL, which is in the process of raising a new $3 billion fund, and the headline failure can’t help things.

THL did not return calls.