Indonesia's presidential election is just two weeks away and a narrowing lead for frontrunner Joko "Jokowi" Widodo spells uncertainty for local markets.
"The election [campaign] in the past few months has been a roller coaster ride and that really raises political uncertainty and what that might do to the policy setting in the post-election environment," Euben Paracuelles, Southeast Asia economist at Nomura, told CNBC last week.
"We have a potentially more fragmented parliament that the new president is going to have to contend with," he added.
The winner of the July 9 election will lead Indonesia, Southeast Asia's biggest economy and home to the world's biggest Muslim population, for the next five years.
This election matters, say analysts, because the new president's policies will shape the economic outlook and foreign investment and comes at a time when economic growth has fallen to its lowest level in four years.
Opinion polls show that Jokowi and rival Prabowo Subianto, an ex-general, are close although Jokowi maintains a slight lead.
Jokowi, the popular governor of Indonesia's capital city Jakarta, is viewed as the more market friendly candidate.
It's no surprise then that stocks have edged down since news last month that Indonesia's second-largest political party, Golkar, unexpectedly switched its support away from Jokowi to main rival Prabowo. That means that Prabowo has a slightly larger coalition to campaign for him than frontrunner Jokowi ahead of the election.
The country's benchmark stock index fell to an over six-week low on Monday and is down roughly 4.6 percent from a one-year peak hit in May.
"Earlier this year markets were positioned for a smooth path for "Jokowi" towards the presidency," said Wellian Wiranto, an economist at OCBC Bank who has been following the presidential race closely.
"Now we're transitioning into an environment where we're not sure that Jokowi will win and there's even a slight possibility that Prabowo could win," he added.
Analysts say Prabowo has a more nationalistic agenda than Jokowi and the election campaign has seen Jokowi move to a more nationalistic stance in response– something that could be a concern for foreign investors.
Regardless of who wins next month's election, the challenges they will face remain the same.
"The fiscal deficit, for example, has widened and is very close to the 3 percent of GDP (gross domestic product) constitutional limit," said Hak Bin Chua, Bank of America Merrill Lynch's Asean economist.
Economists say a ban on mineral ore exports, lower-than-expected coal and palm oil exports and falling oil production could exacerbate Indonesia's budget and current account deficits.
"So regardless of who wins, they would have to get around to hiking fuel subsidies. I think that would be necessary to provide the fiscal room to provide for the infrastructure spending they [election candidates] are pushing for," he said.
Indonesia, alongside India, was punished by investors last year for not doing enough to tackle wide current account deficits and the two countries bore the brunt of the selling in Asia when fears about Federal Reserve tapering hit emerging markets.