Traders now have a better idea why stocks surged the day after President Donald Trump's Congressional speech.

The gained 32 points, or 1.37 percent, on Wednesday, for its best trading session of 2017. The index briefly cracked the 2,400 level, while the Dow Jones industrial average topped 21,000. Trade volume was the highest for the year so far.

A big factor was buying in a single exchange-traded fund. According to data from Bank of American Merrill Lynch, the benchmark saw a huge inflow of $8.2 billion on Wednesday, its largest for a single day since Dec. 19, 2014.

Daily inflows to SPDR S&P ETF (SPY)

Source: Bank of America Merrill Lynch



Certainly, one ETF alone did not account for all of the S&P's rise. Investors were generally encouraged following Trump's first speech before a joint session of Congress, and commentary from Fed officials that increased expectations for a March hike to interest rates.



"I think one of the things the president did in that speech was act like a president," said JJ Kinahan, chief strategist at TD Ameritrade. "The message of unity and hope is one people have been dying to hear from him. I think it was a vote of confidence."

"I just hope people aren't doing an all-in [or] all-out" trade, he said, noting that "when details on the tax plan hit, it might be difficult for the market to sustain this."

U.S. stocks posted inflows for a fourth week out of five in the week ended Wednesday, the BofAML report said, citing data from EPFR Global. Emerging market stocks had their first outflows in eight weeks, while European stocks saw their largest outflow in 13 weeks of $1.7 billion, the report said.

— CNBC's Chris Hayes contributed to this report.