Jamie Dimon, chief executive officer of JPMorgan Chase & Co.Jason Alden | Bloomberg | Getty ImagesSomewhere, Jamie Dimon is smiling.J.P. Morgan Chase is close to winning the lead advisory role for the initial public offering of Saudi Aramco, the world’s most profitable corporation, edging out rivals for the plum assignment, according to people with knowledge of the situation. A final decision is expected next week and could still change, the people said.Morgan Stanley, which had been jockeying with J.P. Morgan for top billing on the deal, was hurt by its work leading the Uber IPO, according to these people.Saudi officials, who are large owners of Uber through the country’s sovereign wealth fund, were displeased with Morgan Stanley after its bankers misjudged demand for the ride-sharing giant’s stock in May. The shares tumbled 18% in the first two days of trading and are still well below the IPO price of $45.The move caps years of efforts by global investment banks to woo the Saudi kingdom for lucrative deals. An IPO of state-owned Saudi Aramco, the world’s largest oil company and the Saudi government’s main source of revenue, has been the centerpiece of a plan by Crown Prince Mohammad bin Salman to diversify the country away from fossil fuels.With the title of lead advisor comes bragging rights in the high-stakes world of investment banking. Not only is J.P. Morgan in line for the biggest share of fees from a Saudi Aramco IPO, if it pulls off the listing smoothly, it is positioned well for future capital markets assignments from the firm.As lead advisor, J.P. Morgan bankers are privy to the most important discussions involving major decisions with the IPO, and will coordinate the other investment banks on the deal as they distribute shares to their respective institutional clients.Until recently, J.P. Morgan has been viewed as an also-ran behind Morgan Stanley and Goldman Sachs when it comes to advising on IPOs. So it must be particularly sweet to Dimon, the longtime CEO and chairman of J.P. Morgan, that his bank is close to winning the listing. Saudi Aramco produced $111.1 billion in profit last year, more than double what tech giant Apple made.Second time’s the charmStill, this is the second time that Saudi officials have convened banks for a potential listing, and the on-again, off-again IPO process isn’t a lock.An IPO was delayed last year by Mohammad bin Salman, known as MBS, as Saudi Aramco pursued a $69 billion takeover of a Saudi chemical producer. At the time, Saudi officials said that they wanted to raise $100 billion by selling a 5% stake in Saudi Aramco, valuing the company at $2 trillion. That would far outstrip the $25 billion raised in the 2014 IPO of Chinese e-commerce company Alibaba.Now, encouraged by the strong reception to a $12 billion bond offering in April, MBS is keen to push ahead with a listing as early as November, according to the people.That is at least several months ahead of earlier reports that they sought to list in 2020 or 2021. The tentative plan is first to list on the domestic Saudi exchange this year, selling perhaps $25 billion worth of shares, then to sell stock in London or New York next year.The reason for the haste: Concern that stock markets might be less receptive to a huge offering of shares at some point next year. The so-called IPO window may close as a global economic slowdown takes hold and markets decline.After selecting its advisers, Saudi officials and their bankers will make a final determination on whether it is pushing forward with an IPO and hash out the valuation it is seeking in October, the people said.A sudden crash in equity markets or the price of oil could scuttle the deal once again, the people said.Still, the plans indicate that Saudi officials believe the international consternation over the murder of Jamal Khashoggi has largely subsided. Khashoggi, a Saudi dissident and Washington Post columnist, disappeared almost a year ago after entering the Saudi consulate in Istanbul.