Goldman Sachs has finally recovered from the 2008 financial crisis. Ironically, the main catalyst is President Trump's promises to undo safeguards put in place to prevent another meltdown.

Goldman Sachs stock closed on Tuesday at a new all-time high, taking out the prior record that was set in October 2007.

Virtually all bank stocks have been on fire since Trump's victory in anticipating of lighter regulation, higher interest rates and faster growth. But Goldman Sachs (GS) has been particularly hot, surging an incredible 37% since the election. That's quadruple the S&P 500's post-election advance.

Clearly, Goldman Sachs has already emerged as a big winner of Trump's pledge to "do a big number" on Dodd-Frank, the 2010 Wall Street reform law.

"If you really think deregulation is coming and banks are going to be cut loose, who's going to win? It's going to be them. We've seen that time and again," said Michael Block, chief market strategist at Rhino Trading.

Goldman's market value surged by $4 billion on the day that Trump signed an executive order beginning the process of rolling back Dodd-Frank.

Related: Elizabeth Warren probes Goldman's ties to Trump

The irony is that Trump slammed Wall Street and Goldman Sachs during the campaign. He even used an image of Goldman Sachs CEO Lloyd Blankfein during his closing campaign ad while condemning the "global power structure."

But Trump has gone from criticizing Wall Street and Goldman Sachs to hiring Goldman veterans to help him govern. Trump's two biggest economic hires are Treasury Secretary Steven Mnuchin, a former Goldman Sachs partner, and top economic adviser Gary Cohn, who stepped down in December as chief operating officer of Goldman Sachs.

Analysts say those hires may actually be helping Goldman stock.

"With so many Goldman Sachs alums in the administration, maybe some think that policies will skew in the bank's favor," said Michael Wong, a Morningstar analyst who covers Goldman Sachs.

Wong cautioned that he doesn't think "anyone should make an investment thesis based on that."

Mnuchin, who was confirmed on Monday as treasury secretary, is in favor of reforming the Volcker Rule, which prevents big banks like Goldman Sachs from making risky bets with their own money.

Goldman's post-election surge can't really be explained by higher interest rates. Higher rates provide a bigger boost to the profits of consumer-focused lenders like Bank of America and Wells Fargo (WFC) than investment banks like Goldman.

"Higher interest rates is not playing that much into Goldman Sachs' valuation," said Wong.

But Goldman Sachs would benefit from faster growth and increased CEO confidence that could spark a wave of lucrative M&A and IPO deals.

Related: Janet Yellen debunks Trump's Dodd-Frank case

Goldman shares have made a remarkable rebound from the 2008 crisis when many investors feared the complete collapse of the financial system. Goldman is up 380% since its low of $52 in November 2008.

While JPMorgan Chase returned to its pre-crisis high in 2013, it wasn't until now for Goldman stock. Other big banks like Bank of America (BAC), Citigroup (C) and Morgan Stanley (MS) are nowhere near their all-time highs.

But is the Goldman rally overdone?

After all, not even Trump is talking about completely repealing Dodd-Frank and efforts to water regulation down are running into resistance, including from Federal Reserve chief Janet Yellen.

Wong thinks Goldman shares are "slightly overvalued" at this point.

"They're pricing in a lot of perfection in terms of deregulation and the ability to take advantage of that," Block said.