Investors (and presidents) should be careful what they wish for.

President Donald Trump's biggest legislative accomplishment may lead to inflationary conditions and the end of the nine-year bull market for stocks.

The Republican tax overhaul, which the self-proclaimed "king of debt" Trump signed into law in December, lowered the corporate tax rate to 21 percent from 35 percent. The Congressional Budget Office estimated the tax bill will increase the deficit by $1.5 trillion over the next decade and by $136 billion in fiscal 2018.

Some are concerned that adding fiscal stimulus at this late stage of the economy cycle with a jobs markets at or near full employment will spur a rise in inflation.

Former Federal Reserve Chairman Alan Greenspan predicted both inflation and interest rates will surge as a result of the country's growing national debt and budget deficit.

"We are dealing with a fiscally unstable long-term outlook in which inflation will take hold," Greenspan said in an interview on Bloomberg Television last Wednesday. "I think we're getting to the point now where the breakout is going to be on the inflation upside. The only question is when."

The rates breakout may have started last week.

On Friday a stronger-than-expected jobs report and wage number sent interest rates higher, sparking a 2.1 percent sell-off in the S&P 500 that day. The benchmark 10-year yield rose to a four-year high of 2.85 percent.

Investors are now concerned the Federal Reserve will reduce its monetary stimulus and increase interest rates more aggressively as the economy continues to strengthen.

Billionaire hedge fund manager Dan Loeb last month specifically called out the risk of inflation to the market rally.

"Low inflation has been a critical support for the market because it has allowed the Fed to be unhurried in its rate normalization," Loeb wrote in a letter to clients. "We are watching closely to see how a tightening labor market and recently announced wage hikes will shape the future path of inflation."

The S&P 500 index has rallied 32 percent since the Nov. 8, 2016, Trump election through January, something the president has heralded many times in public appearances and on Twitter. The benchmark index is down more than 6 percent this month through Monday.

The market's two-day swoon comes after the World Economic Forum in Davos, Switzerland, in late January, where American CEOs embraced Trump's corporate tax cuts and expressed optimism over the stock market and economy.

The extreme positive sentiment by investors and corporations actually worried one legendary investor.

"There is a good amount of euphoria out there," Jeff Vinik told CNBC on Jan. 26. "I don't remember a time honestly, maybe back to 2000, when there was so much good news and so much bullishness. And every instinct of mine tells me when that is the case, you should be a little cautious."

The euphoria can even infect the most experienced investors.

Bridgewater Associates founder Ray Dalio predicted at Davos "a market blowoff" rally, fueled by cash from banks, corporations and investors.

"There is a lot of cash on the sidelines. ... We're going to be inundated with cash," Dalio said Jan. 23. "If you're holding cash, you're going to feel pretty stupid."

As inflation rises from Trump's fiscal stimulus, this key risk for the stock market, according to Loeb, means a correction is ahead for equities even if the economy improves.

At year-end, investors who stay in cash may not feel so dumb.