President Donald Trump's top economic adviser is walking away from Goldman Sachs with a payout of more than $100 million.

Gary Cohn, the Wall Street firm's former second-in-command, was chosen by Trump to lead the influential National Economic Council.

Like some of Trump's other high-profile picks, Cohn's career has made him enormously wealthy. His 25 years at Goldman (GS) have enabled him to build up a huge pile of bonuses and stock awards that he was due to receive in the coming years.

Taking the job with the Trump administration means he has to cut his financial ties to Goldman to satisfy government ethics rules. In a filing late Tuesday, the investment bank mapped out how that's happening.

Related: Goldman' No. 2 is Trump's top economic adviser

Goldman says it paid Cohn $65 million in cash for long-term bonuses he was owed. It also sped up stock awards worth $35 million and lifted restrictions on $23 million in locked-up Goldman shares so Cohn could sell them.

Although the total works out at more than $123 million, the amount Cohn will end up with will be lower because of taxes.

It's not a bad time to be selling out of Goldman stock: the bank's shares are trading near their highest level in years after rallying along with those of other banks following Trump's election victory.

And the flow of money doesn't end there: Cohn also has to cash out his stakes in private equity and hedge funds run by Goldman. The bank didn't say how much those investments are worth.

Goldman wasn't immediately available for comment outside of office hours.

Related: Will Rex Tillerson get a tax break on his big Exxon payout?

The announcement of Cohn's big exit package follows the roughly $180 million payout that Trump's secretary of state pick, Rex Tillerson, is set to receive from ExxonMobil (XOM), the oil giant he used to run.

Known for his financial market savvy, Cohn was seen as the heir apparent to Goldman CEO Lloyd Blankfein.

With Blankfein showing no sign of stepping back from the top job, Cohn accepted Trump's offer to run his economic council.

He's expected to act as the president's quarterback on the economy, coordinating policymaking between various agencies and programs to ensure it's in line with the administration's goals. The NEC chief works inside the White House and helps frame the debate on the biggest economic issues.

Related: Donald Trump's curious Goldman Sachs connections

Cohn isn't the only Goldman alum chosen by Trump, who held up the bank as a symbol of the corrupt establishment during his campaign.

Others include Treasury secretary pick Steven Mnuchin, chief strategist Steve Bannon and Anthony Scaramucci, who will serve as a liaison between Trump and the business world.

The bank has also provided high-profile members of previous administrations.

President George W. Bush famously tapped then-Goldman CEO Hank Paulson to lead Treasury in 2006, and President Bill Clinton named Robert Rubin, another longtime Goldman exec, as his Treasury secretary.

-- Matt Egan contributed to this report.