Hedge funds bet big on Donald Trump winning the presidency, and now they're looking to cash out.

This play goes back to the 2008 collapse of the housing bubble, and the many spectacular government actions to rescue Wall Street from a crisis caused by its own predation and stupidity. One of these was to take full government control of two huge players in the mortgage market — Fannie Mae and Freddie Mac — and direct all profits into government coffers.

However, hedge funds continued to buy shares in the companies, hoping that, with a lobbying effort, they might get the government to re-privatize Fannie and Freddie, and make a quick buck at government expense. There is every sign that under a Trump administration, that effort is going to work.

Let me back up a bit. The policy point of Fannie and Freddie is bizarre, but also interesting — a classic window into the deep structure of American policymaking. Back during the Great Depression, the housing market also collapsed, and millions of mortgages were in default. New Dealers initially attacked the crisis with the Home Owner's Loan Corporation, which directly bought up defaulted mortgages to keep people in their homes, and with the Fair Housing Act, which created the Federal Housing Administration (FHA) to insure mortgages and set lending standards (some of which were infamously racist).

In 1938, with the crisis passed, New Dealers further strengthened the mortgage market with the Federal National Mortgage Association (Fannie Mae). This government agency basically created the secondary mortgage market of mortgage-backed securities, mostly composed of loans insured under FHA. The idea was to expand the capital available for mortgage lending, and it worked reasonably well. (All this created the traditional 30-year mortgage, which did not exist before the New Deal.) For a generation afterwards, Fannie Mae was virtually the only player in the secondary mortgage market.

Fannie Mae was split up and partially privatized in 1968, and then supplemented with a similarly partially-private Federal Home Loan Mortgage Corporation (Freddie Mac) in 1970.

Now, fast forward through lots of deregulation to the go-go years of the mortgage bubble in the mid-2000s. The great bulk of the garbage mortgage lending and securitizing during that time was done by private business, but Fannie and Freddie got into the game as well — naturally, right as the whole thing was about to collapse. These institutions were and are gigantic, with combined assets of about $5 trillion as of 2014. They were far too big to fail without taking down the whole financial system.

Given that the overall government approach to the financial crisis was "blast Wall Street with a Paris Gun-sized firehose of free money, and look the other way as they continue to commit endless crimes," it's notable that the Bush administration brought Fannie and Freddie into federal conservatorship during the early days of the crisis. Essentially, the feds took full control of and responsibility for the two institutions, and backstopped their books with $100 billion in government capital. Even more unusually, in 2012, the Obama administration changed the terms of the conservatorship to transfer all profits into government coffers. It's a perfectly sensible idea, it's just surprising anytime Wall Street misses an opportunity to loot the public fisc.

Of course, financial titans immediately began mobilizing to rectify this situation, as David Dayen explains at The Intercept. Because of government control and the profits-taking policy, Fannie and Freddie shares were trading at dirt cheap prices. Investors, most notably John Paulson (who profited immensely from betting against the housing bubble) snapped them up and began pressuring the government to return Fannie and Freddie to private ownership — thus granting them a massive payoff for zero work. During the 2016 election, the major portion of this effort was directed at Trump, who was lavished with money and attention.

Before the election, Fannie and Freddie were both trading at a bit above a buck-fifty. Trump's pick for treasury secretary, Steven Mnuchin — a hedge fundie who spent 17 years at Goldman Sachs — said recently that Fannie and Freddie should be privatized, sending shares skyrocketing to near $4 at time of writing.

There are many deep problems with the old model of housing finance, and it's unclear whether Fannie and Freddie's policy model is the right one for the future. But that should not obscure what is happening here. Without the 2008 rescue, these two entities would have certainly collapsed. The only reason they are profitable today is because of the government backstop and capital infusion. A bunch of Wall Street goons saw an opportunity to turn a quick profit at the government expense — both directly in terms of money invested, and indirectly in terms of bleeding the institution whose strength rests on the entire American citizenry — by deluging the political system with money, and it worked. There aren't many better examples of how parasitic financial profits can be.