Apple is getting closer to the $1 trillion mark.
Shares of the iPhone maker hit another all-time high Wednesday. At $163.89, they are just $30 a share away from making Apple the first U.S. company to cross the $1 trillion threshold in terms of market capitalization.
That would put Apple's size slightly less than the gross domestic product of Mexico but among the top 20 economies worldwide.
It is the second straight day the stock hit a record — and the 29th time this year — as anticipation builds for the iPhone 8, which is expected to be introduced this fall.
The iPhone marked its 10th anniversary this year. It was an instant hit when it first came out in 2007, and expectations are that many existing owners have waited for this next iteration to upgrade their old devices.
Apple shares would only need to rise another 18 percent from this level to achieve that milestone, based on calculations using FactSet data. Apple has 5.17 billion shares outstanding and could reach the $1 trillion-dollar market cap level if its shares rose to $193.61.
On Monday, The Wall Street Journal reported, citing sources familiar with the matter, that Apple had scheduled a product-announcement event for Sept. 12. Apple has not confirmed the report.
The iPhone 8 launch will be a "fairly material one for Apple," RBC Capital's Amit Daryanani told CNBC in a phone interview Wednesday.
Back in May, Daryanani laid out how Apple's stock could reach a $1 trillion market cap in 2018. He still expects that iPhone 8 sales, growth in the services business and share buybacks should help Apple reach the $1 trillion market cap in roughly the next half year if price-to-earnings multiples remain the same. The stock could reach that level more quickly if Apple could bring home its $261.5 billion overseas cash hoard (presumably with minimal tax consequences) and the multiple on the stock improved, he said.
Apple shares could easily rise at least 18 percent in the next half year, if history is any guide.
In 11 previous iPhone announcements, Apple shares have climbed a median of nearly 27 percent in the time period between two weeks before each announcement to six months later, according to Kensho, a data analytics tool used by hedge funds.
Apple is already the largest market cap stock in the S&P 500 and made up 4.06 percent of the index's market cap as of Tuesday's close, according to Howard Silverblatt of S&P Dow Jones Indices.
Keeping other things equal, if Apple's market cap rose to $1 trillion, the stock would be 4.74 percent of the S&P 500's market cap, Silverblatt said, ranking Apple ninth when looking at the stocks with the largest percentage of the S&P's market cap at year-end since 1980. IBM holds the top four spots.
If Apple's stock can reach the $1 trillion market cap and "sustainably be there, I think it validates the belief that Apple is not just a smartphone business but a platform," Daryanani said.
On Wednesday, The Wall Street Journal also reported that Apple is allowing Chinese customers to use Tencent's popular mobile WeChat Pay system to make App Store purchases. Apple did not immediately provide CNBC with a comment on the news, which was also widely reported by Asian and tech news websites.
Apple's shares could be even closer to reaching $1 trillion if investors bet on greater growth.
CNBC's Senior Markets Commentator Michael Santoli pointed out that Apple's 12-month trailing price-to-earnings multiple of just over 18 is low compared with that of tech giants Microsoft, Google's parent Alphabet and Facebook, whose multiples, he said, range from 27 to 38. The price-to-earnings ratio reflects how many times earnings investors are willing to pay for a share.
If Apple reached a price-to-earnings ratio of 20 and matched the consensus estimate for fiscal year 2017 earnings per share of $9.45, the stock could reach a $1 trillion market cap at $189 a share, or 15.3 percent higher than Wednesday's price, Santoli said.
To be sure, the road to any major Apple stock gains is likely not a smooth one. Investors' initial reaction to an iPhone 8 announcement may be to sell on the news.
According to Kensho data, a person who bought Apple stock two weeks prior to an iPhone announcement and sold it three months later had a median gain of just 4.5 percent.
With Wednesday's gains, Apple shares are up 41 percent for the year.
"It continues to be a bet on the iPhone, with a great deal riding on how well the iPhone 8 does," Aswath Damodaran, a professor of corporate finance and valuation at New York University's Stern School of Business, told CNBC in an email.
"If it does well, I think [Apple] will make the trillion dollar market cap," he said. "If the iPhone 8 does badly, all bets are off."
Disclosure: CNBC's parent NBCUniversal is a minority investor in Kensho.