As historians, politicians and the American public weigh up the Obama legacy, at least US investors will be praising the outgoing president.
Under Barack Obama, Wall Street enjoyed outsized returns, with the benchmark S&P; 500 index rising 181 per cent over the eight years the Democrat was in office. It's the second-highest S&P; 500 gain of any US presidency since World War II.
More World News Videos
The Obama years
A look back at the key moments from President Barack Obama's two terms in the White House.
Mr Obama's capitalist record is helped by timing â he took over towards the end of the global financial crisis, which saw shares extend their plunge in the first few months of his presidency, wiping out all the gains made in the early 2000s.
But the turnaround came in March 2009, just two months after his inauguration.
![The S&P 500 rose 181.13 per cent during Obama's two terms - the second-highest gain under any president since World War II.](/web/20170120095858im_/http://www.smh.com.au/content/dam/images/g/k/h/w/k/3/image.related.articleLeadwide.620x349.gtv7eu.png/1484903469312.jpg)
Wall Street benefited from a period of massive quantitative easing by the US Federal Reserve, as well as fiscal action by the US government such as the Recovery Act in 2009, which combined a range of tax incentives and stimulus spending in key sectors worth $US831 billion over a decade.
These factors combined to cement a slow but steady recovery from the GFC that engulfed president George Bush's final term.
The stellar run proves correct Mr Obama's 2009 advice to investors. Just two months after his inauguration, the president strongly encouraged investors to return to the market.
"Profit and earning ratios are starting to get to the point where buying stocks is a potentially good deal if you've got a long-term perspective on it," he said.
![The record for the most Wall Street-friendly president is held by Bill Clinton.](/web/20170120095858im_/http://www.smh.com.au/content/dam/images/g/s/3/c/g/8/image.related.articleLeadwide.620x349.gtv7eu.png/1484903469312.jpg)
A week later, the American sharemarket hit its lowest point during the global financial crisis. But in the long run, investors who listened made a lot of money.
On a sector-by-sector break-down, the booming online economy grew massively during Mr Obama's tenure.
![Some of the largest gains went to gun manufacturers during Obama's tenure.](/web/20170120095858im_/http://www.smh.com.au/content/dam/images/g/t/v/l/a/9/image.related.articleLeadwide.620x349.gtv7eu.png/1484903469312.jpg)
Internet retail stocks were the biggest gainers of any sector, up 1680 per cent on average, while healthcare and real estate stocks also posted strong gains (1097 per cent and 764 per cent respectively).
Some of the sectors to post large declines were coal and fuel (down 75 per cent), oil and gas drilling (16.5 per cent) and commercial property (down 10 per cent).
![The booming online economy grew massively during Obama's tenure.](/web/20170120095858im_/http://www.smh.com.au/content/dam/images/g/o/6/9/f/4/image.related.articleLeadwide.620x349.gtv7eu.png/1484903469312.jpg)
Meanwhile, some sectors grew in apparent opposition to Mr Obama's agenda. In individual stocks, some of the largest gains went to gun manufacturers, as Americans stocked up on firearms in anticipation of their future sale being curtailed by the Democratic administration.
American firearms manufacturer Smith & Wesson saw its shares rise 727 per cent to $US20.56, while Sturm Ruger soared 859 per cent to $US51.55 (the other major American gun manufacturer, Remington Outdoor, is privately held). Both Sturm Ruger and Smith & Wesson have seen their share prices decline after the election of Donald Trump in November.
![The markets turned around just two months after Obama's inauguration.](/web/20170120095858im_/http://www.smh.com.au/content/dam/images/g/t/v/k/r/z/image.related.articleLeadwide.620x349.gtv7eu.png/1484903469312.jpg)
The record for the most Wall-Street-friendly president is still held by Bill Clinton, under whom the S&P; 500 rose 208 per cent.
The benchmark US index also grew strongly under President Ronald Reagan, when it rose 118 per cent.
It initially grew strongly but ended up in the negative under the tenure of George W Bush (down 31 per cent) and also lost some ground under Richard Nixon.