Stocks mostly declined on Tuesday as the previous session's semiconductor rally failed to maintain momentum as market participants gear up for SpaceX's massive initial public offering.

The broader market S&P 500 Index (SPY  ) fell about 0.3% to close at 7,386.65, while the tech-heavy Nasdaq Composite (QQQ  ) lost nearly 1% to settle at 25,678.82. The Dow Jones Industrial Average (DIA  ), however, recovered from its earlier losses and gained 86 points to end the session at 50,872.11.

Tied closely with the artificial intelligence industry, the iShares Semiconductor ETF (SOXX  ) rallied on Monday as investors bought into the dip in shares from Friday's 10% drop -- spurred by some concerns the AI market is reaching its capital peak.

Those same market jitters from Friday are lingering as SpaceX is set to debut the largest offering of all time on Friday, with its valuation sitting at an eye-watering $1.75 trillion.

OpenAI also filed confidently for its own IPO late Monday, joining rival Anthropic in the race to be the first public AI start-up. The AI company is currently valued at more than $850 billion and could go public as soon as the fourth quarter of this year.

"We recently submitted a confidential S-1. We expect it to leak so we're just announcing it. We have not decided on timing yet; it may be a while because there are things we want to do that are likely easier as a private company. But it's a complicated set of tradeoffs and this gives us the option to go public sooner if that ends up being best," OpenAI said in a blog post.

Elsewhere, the Pentagon late Monday added several Chinese companies, including Alibaba (BABA  ), Baidu (BIDU  ) and BYD (BYDDY  ) to its list of entities believed to have aided the Chinese military, known as the 1260H list. The action comes as Beijing and Washington continue trade talks.

Being added to the list does not impose sanctions, but prohibits the Department of War from contracting directly with the companies starting later this month, and from using their products or services through third parties from the start of 2027.

On the economic front, existing home sales rose in May by 3.2% to a seasonally adjusted annualized rate of 4.17 million, the National Association of Realtors reported Tuesday, topping economist estimates. Moreover, the median sales price increased by 1.3% annually to $429,300.

"More Americans are on the move, with home sales rising to the highest level since December. This is great news for the housing market and the economy," said Lawerence Yun, chief economist at NAR, in a statement.

Looking ahead, market participants are likely to trade cautiously as SpaceX's massive IPO approaches. Wednesday also hosts the release of May's Consumer Price Index reading.