A BBC review of his government financial disclosures for the last two years shows he purchased Nvidia shares worth between $23 million and $86 million (£18 million and £66 million). Recent financial disclosures show he purchased $265,000 in the stock and sold as much as $15,000 worth of shares in September.
The department said it had been investigating the company for almost two years. It said it suspected Megaspeed was violating US export controls by helping to get Nvidia chips to companies in China.
Although based in Singapore, Megaspeed has significant business dealings in China.
Nvidia's computer chips, originally designed for gaming consoles, have in recent years become crucial to the continued growth of the artificial intelligence industry.
The president was asked whether Nvidia stock losses after Huang resigned last week had influenced his decision to intervene personally.
"They did ask for assurance on the national security threat,"Trump said.
The board said it had received input from senior levels of the US government and was confident that Huang's reinstatement posed no national security risk.
The company's stock rallied on his reinstatement, as did several other tech stocks, but Nvidia shares did not climb back to where they stood before the scandal. His comeback helped end a week-long losing streak in US stocks that had left the S&P 500 in correction territory.
Trump has bought Nvidia stock 85 separate times through a number of investment accounts. Over 19 sales, he gained between $3.5 million and $10.2 million, according to his government disclosures. He has also sold some of his stake in Nvidia since returning to the presidency.
The value of those holdings would have been affected by the recent fall in Nvidia's stock price amid Huang's exit.
Democrats have accused the Trump administration of selling out national security for financial gain.