(Bloomberg) — Extreme election night volatility persisted in U.S. equity futures, with the S&P 500 swinging from steep losses to gains, as investors worked to price in shifting odds for Donald Trump’s re-election, a potentially protracted vote count and the implications for economic stimulus.December contracts on the benchmark equity gauge were last up about 1% while futures on the Nasdaq, a defensive trade all year, rose more than twice that. The dollar was also on a roller-coaster ride, surging as much as 1% before settling for a gain of 0.2%. Treasury yields slumped plunged, with the 10-year benchmark down to 0.82%.President Donald Trump was ahead in several contested battleground states that would be key to his re-election chances, while challenger Joe Biden had reason for hope in the Midwest and Southwest in his bid to take the White House. The race for control of the Senate remained up in the air. With key states likely needing some time to count mail-in ballots that will potentially decide the election, investors have started bracing for days of uncertainty.“The idea of it pricing in a decisive result and an election that’s not going to be contested was a little premature, and we’re seeing that right now,” said Liz Young, BNY Mellon Investment Management’s director of market strategy. “It’s going to end up being a lot closer than expected and I still think the likelihood of it being disputed or contested is high.”Markets have been volatile during the final weeks of the campaign as investors fretted over the potential for a contested outcome, a surge in coronavirus cases and stretched valuations that make megacap tech shares look expensive as the economic rebound starts to slow. The S&P 500 has moved at least 1% six of the past seven sessions.While Biden’s solid lead in polls had some investors speculating there would be a relatively quick decision on who will prevail, a surge in mail-in ballots has made it more likely that some states won’t be able to declare a winner Tuesday. That exposes markets to a drawn out process for determining the next president.Adding to anxiety is that markets haven’t always been prescient in knowing what outcome they’d prefer. In 2016, Trump’s perceived recklessness was considered bad news for a stock market that detests uncertainty. Futures plunged the maximum 5% as he took the lead late on Nov. 8, 2016. By morning, as investors warmed to his pledges of cutting taxes and slashing regulations, futures had rebounded higher. The S&P 500 has rallied 57% since his surprise win.Investors have come around on Biden as his lead solidified, banking on his promise to broker a massive aid package to jumpstart the economy hit by the pandemic. Assets seen benefiting most from a Biden administration have climbed alongside his polling lead. The Invesco Solar ETF, ticker TAN, has surged over 140% in the past six months, buoyed by optimism that Biden would boost infrastructure and green-energy spending.Hopes of a multi-trillion fiscal aid package has boosted benchmark Treasury yields to the highest level since June, dragging beaten-down shares of financial companies higher as well. Meanwhile, the Nomura-Wolfe Biden Election Basket — a group of stocks that wagers on potential winners from a Democratic victory while betting against shares seen as losers — climbed to a record on Monday. The basket holds 30 pair trades across sectors including technology, health care, utilities and others.But not all outcomes under Biden are considered market-friendly. He also has pledged to roll back the huge tax cuts that Trump handed corporate America back in 2017, a move that, irrespective of the public-policy merits it may have, at least has the potential to create stress for equities. Democrats have also promised tighter financial regulation and will look at how megacap tech companies operate.Another possibility is that a Biden win is not accompanied by Democrats taking over control of the Senate, leaving Congress divided. That could temper expectations for a spending bill and threaten to stall much of Biden’s platform.The S&P 500 retreated in both September and October after a torrid summer rally. It closed Tuesday about 6% below its all-time high.“The closer the race is, the bigger the risk is,” said Erika Karp, founder and CEO of Cornerstone Capital Group. “A close outcome is a risk to the market. The longer it drags out, the bigger the risks.”For more articles like this, please visit us at bloomberg.comSubscribe now to stay ahead with the most trusted business news source.©2020 Bloomberg L.P.