New York (CNN Business) Few could have predicted this scenario: The American stock market is brushing up against record highs at the same time that Bernie Sanders is the frontrunner for the Democratic presidential nomination.

Despite the Sanders surge, or perhaps because of it, the Dow has flirted with the 30,000 level for the first time ever. The Nasdaq , even after taking into account Thursday's sudden retreat, is sporting an impressive 8% gain this year. And momentum stocks likeandhave gone bonkers.

If Bernie begins to pull away, that's positive for Trump -- and by extension, positive for stocks."

There are a few schools of thought for why investors are not freaking out about the rise of Sanders. Or at least not yet. Sanders is a self-described democratic socialist who has proudly promised to be a "nightmare" for Wall Street, insurance companies and the fossil fuels industry.

One obvious reason for the muted market reaction: It's just way too early for markets to brace for the potential policies of a Sanders White House. Wall Street is betting that eventually a moderate such as billionaire Michael Bloomberg will win the nomination, perhaps after a contentious convention.

For now, investors are focused on the resilience of the American economy, an ocean of easy money from global central banks and hopes that the coronavirus storm will soon pass.

Others may be dismissing the threat from Sanders because even if elected, he'd have a very difficult time getting bold policies such as a wealth tax and a fracking ban through Congress. That's especially true if Republicans maintain control of the Senate.

Yet the most intriguing explanation is that the success of Sanders is actually bullish for stocks. That's because investors view Sanders as an easy foil for President Donald Trump. And a Trump reelection would signal a continuation of the low taxes and light regulation that investors love, not to mention an obsessive-focus on the stock market.

"You have to conclude that the markets are expecting Sanders to lose, perhaps decisively," said Greg Valliere, chief US policy strategist at AGF Investment.

Trump has gone from underdog to favorite

Traders on prediction market PredictIt seem to agree with that sentiment.

Trump was a slight underdog 90 days ago , with a 42% chance to win reelection. Now, he's the favorite on PredictIt, with a 55% chance of winning in November. That swing has coincided with the rise of Sanders.

"The market perception is that Bernie Sanders will be an easier candidate for President Trump to beat," said Keith Lerner, chief market strategist at Truist/SunTrust Advisory.

By that logic, more strength from Sanders could actually lift stocks further.

"If Bernie begins to pull away, that's positive for Trump -- and by extension, positive for stocks," said David Lafferty, chief market strategist at Natixis Investment Managers.

Some investors may even be betting that a Sanders nomination could tip the scales in Congressional races, allowing Republicans to retake the US House of Representatives.

"If it's Bernie Sanders, could Republicans run the table?" said Ed Mills, Washington policy analyst at Raymond James. "That's where there could be another round of tax cuts."

Stocks have zoomed under Trump

Many believe the most market-friendly outcome to the election would be four more years of Trump.

Wall Street loves the pro-business planks of Trump's economic agenda: low taxes, deregulation and surging government spending. And markets are relieved that the US-China trade war has cooled off.

"There's only one candidate Wall Street will be happy with -- Trump," Valliere wrote in a recent note to clients.

The S&P 500 has climbed nearly 50% since Trump took office in January 2017. The Dow's annualized gain of 13% under Trump is third among all presidents since 1900, according to Bespoke Investment Group.

Of course, there is no guarantee that success would continue in a second Trump term.

The "pro-business" parts of the Trump agenda are "overshadowed by social negative" such as wealth inequality that the market "whistles past," said Art Hogan, chief market strategist at National Securities Corporation.

And then there's the threat of continued, if not additional, volatility in Washington.

"What happens if Trump is unbound by the need to win reelection?" said Mills, the Raymond James analyst. "He's been pretty bombastic in his first term. What does a second term of Trump look like?"

What if Wall Street is underestimating Bernie?

But some market watchers are warning investors not to get overconfident in their political prognostications, especially with the election still nearly nine months away.

Recall that in 2016 few thought it was possible Trump would win the nomination, let alone the presidency. And then he did. Likewise, investment banks warned Trump would be a disaster for stocks. And then he wasn't.

"We make this mistake every four years by saying this is definitely what is happening -- and then it doesn't," said Hogan. "Let's not get ahead of ourselves. It's too early. The players are just warming up."

UBS warned in a report Thursday that while investors have a "high level of confidence" Trump will get reelected, national polls suggest a "close" contest between any Democratic candidate and the president.

"We could just be setting ourselves up for a bigger reaction later on if the market is wrong," said Mills.

The key will be how markets react if Sanders continues his momentum after the Super Tuesday on March 3 when delegate-heavy states such as California, Texas and Virginia vote.

"I would expect some market jitters if Bernie Sanders continues to accumulate delegates and has any kind of high-profile primary wins," Kristina Hooper, chief global market strategist at Invesco, told CNN's Julia Chatterley on Wednesday. "It could create a selloff in the S&P 500."

In other words, the Sanders freakout on Wall Street might not have been canceled. It's just been delayed.