Facebook Inc. (FB) CEO Mark Zuckerberg was busy selling stock in the months before the company’s worst one-day decline in six years over data security concerns.

Facebook’s stock sank 8% Monday on allegations that controversial data analysis firm Cambridge Analytica had obtained private information of an estimated 51.3 million Facebook users without their consent. It’s the same London-based firm that helped President Donald Trump’s 2016 campaign. Facebook’s policies reportedly allowed Cambridge Analytica to access and hold users’ data for years without permission.

Today, shares continued their downward spiral on the Federal Trade Commission as well as officials in the U.K. are investigating how the data was handled. (See also: Facebook Shares Fall After Data Leak Bombshell.)

Down $5 Billion

So far this year, Zuckerberg has sold 4.9 million shares, making a roughly $900 million profit, according to MarketWatch calculations based on Securities and Exchange Commission filings.

If he had sold after Monday’s close, those shares would have been worth $855 million. Essentially, Zuckerberg saved an estimated $45 million by selling before the turmoil. However, as he still holds a significant stake in the company, he took a $5 billion decline in his net worth. Zuckerberg said in September that he planned to sell off about $6 billion worth of shares of Facebook to fund a philanthropic organization he founded with his wife, Priscilla Chan, called the Chan Zuckerberg Initiative.

In the past year, Facebook shares have gained 20.4%, but they’re now down 5% since the start of the year. (See also: Why Facebook Shares Could Fall 20%.)