Factbox-The U.S. debt ceiling and markets: Gauging the fallout

FILE PHOTO: The U.S Treasury building in Washington.

NEW YORK (Reuters) - U.S. President Joe Biden is at odds with Republicans in Congress over raising the $31.4 trillion debt ceiling, a showdown that looms as a risk factor for markets.

The Congressional Budget Office on Wednesday said the U.S. Treasury Department will exhaust its ability to pay all its bills sometime between July and September, unless the current cap on borrowing is either raised or suspended.

Many past debt-limit standoffs have been resolved without significant market fallout but that hasn't always been the case: a 2011 debt ceiling showdown roiled markets and led to a downgrade Standard & Poor's.

Here is some background about the debt ceiling debate and its impact on markets:

** Though months remain for lawmakers to reach an agreement, there are signs stock investors may already be pricing in risk around the debt ceiling debate.

According to Goldman Sachs, while debt limit debates typically have had "limited" impact on the broad market, stocks exposed to government spending have commonly lagged in the weeks prior to the debt ceiling deadline. A basket of such stocks has trailed the S&P 500 by a median of 5 percentage points in the weeks ahead of the four most recent debt limit deadlines, Goldman said in a note late last month.

** This year, the Goldman Sachs government exposure basket has gained only 4.4% as of Tuesday's close, compared with a 7.7% gain for the S&P 500. Stocks in the basket belong to a range of industries that could be affected by a shutdown, including healthcare, aerospace and defense, professional services, and materials.

** However, 90% of respondents in a Deutsche Bank global financial market survey taken late last month said the debt ceiling has no influence or only limited influence on their 2023 outlook. That led Deutsche Bank's head of global economics and thematic research Jim Reid to note that markets might be caught off guard by major fallout from a debt showdown.

** Stocks fell sharply during the debt-ceiling showdown in 2011, which came alongside economic unease in Europe that roiled markets. The S&P 500 sold off about 17% between late July and mid-August of 2011, while the Cboe Market Volatility index spiked above 40.

** An October 2013 showdown was less concerning to risk assets but created "temporary dislocations" in the Treasury market, with Treasury bills maturing in the "default" zone trading at a steep discount to nearby securities, according to Deutsche Bank.

** In 2011 and 2013, equities declined in the month leading up to the date the debt ceiling was raised, but then bounced back, according to Brian Levitt, global market strategist at Invesco. The S&P 500 fell 17.2% and 4% in 2011 and 2013 one month ahead of that date, Levitt said in a note. The index rose 28.1% and 21.4% in the ensuing 12 months in those years.

(Reporting by Lewis Krauskopf; Editing by Ira Iosebashvili and Marguerita Choy)