After a decade of stagnation, shares of FedEx (NYSE:FDX) have rocketed higher in the last year or so. As recently as mid-2013, FedEx stock was trading for less than $100, but it has steadily risen to eclipse $150, thanks largely to the impact of a cost-cutting plan first announced in late 2012.

FDX Chart

FedEx Stock 10-Year Price Chart, data by YCharts.

FedEx stock has plenty of momentum, and the company's projection that adjusted EPS could rise 26% to 33% this year has lots of investors excited. However, there are a few clouds on the horizon at FedEx, which could cause the stock to give up some of its recent gains.

Amazon could cut out the middleman

FedEx's ground shipping business has been its real growth engine recently. FedEx Ground revenue has grown 56% in the last four years alone. The rise of e-commerce has been a key driver of that growth, as Internet retailers are shipping more and more packages to customers.

However, one particular company accounts for a large part of that growth: Amazon.com. The e-commerce giant accounts for a significant proportion of e-commerce shipments, but its huge size gives it a lot of leverage over delivery companies.

E Commerce Amazon Box Amzn

Amazon may eventually bring most of its deliveries in-house.

FedEx recently lost a big chunk of business from Amazon, presumably because competitors were offering lower prices. Longer-term, Amazon.com's growth could challenge FedEx in another way -- Amazon has begun developing an in-house package delivery service.

For now, third-party shippers like FedEx will probably remain the most sensible delivery option for most Amazon packages. Eventually, though, Amazon might have enough scale to bring a large volume of its deliveries in-house.

It could use its economies of scale to gain e-commerce market share, undermining the growth of FedEx's other e-commerce customers. In a worst-case scenario, Amazon could start delivering packages for other retailers, thus becoming a direct competitor to FedEx.

The USPS is getting aggressive

FedEx faces a more imminent threat from the USPS. The USPS has a complicated relationship with FedEx. It competes with FedEx on a variety of shipping services, but it also acts as a supplier (it undertakes final delivery of FedEx SmartPost packages) and as a customer (FedEx provides air transport for domestic Priority and Express Mail).

The competitive aspect of the USPS-FedEx relationship may be on the rise. In August, the Postal Regulatory Commission -- which, as the name implies, regulates the Post Office -- gave the USPS permission to cut prices for big customers. USPS customers shipping more than 50,000 packages annually have seen Priority Mail prices reduced by up to 58%, effective Sept. 7.

FedEx and UPS have complained that the USPS is using its monopoly position as a letter carrier to compete unfairly in the package delivery business. The reality is more complicated. Volume discounts are common at FedEx and UPS.

Shipping Fedex Ground Trucks Fdx

FedEx could soon face a new dose of competition. 

As a regulated institution, the USPS didn't have the same leeway. With lower prices, the USPS is on a more even footing with FedEx and UPS.  As a result, its Priority Mail product may become a viable alternative for expedited e-commerce deliveries. This will put pressure on some of FedEx's faster -- and more lucrative -- delivery services.

Valuation is less compelling

A third potential problem for FedEx investors is the company's valuation. Even as competitive threats have started to crop up, FedEx stock has soared. In mid-2013, FedEx shares were still trading for less than $100. That was about 16 times adjusted EPS of $6.23 for FY 13.

Considering that FedEx's cost-cutting plan offered an opportunity to boost earnings by $1.7 billion -- or more than 50% -- over a three- to four-year period, this was a very conservative valuation. A lot of things could go wrong without damaging the bull case for FedEx stock.

By contrast, FedEx now trades for 17 times the high end of its FY 15 earnings guidance. That guidance already includes most of the benefit from the company's cost-cutting program. It doesn't take into account a significant shift by Amazon.com or other major shippers from FedEx toward the USPS or other alternatives.

In other words, FedEx needs to execute well in order to live up to its current stock price. Even if it does everything within its power to maximize earnings, it could still be tripped up by tougher competition, particularly from the Post Office. Thus there is more downside for FedEx stock today than at any other point in the last few years.

Foolish bottom line

Going forward, FedEx may be able to continue growing earnings by continuing to invest in efficiency and productivity initiatives. A return to faster global economic growth would help as well.

However, investors should recognize that FedEx stock is now a lot pricier than it has been in recent years. At the same time, competitive threats are rising. A more aggressive stance by the USPS could have a particularly large impact on FedEx's margins. If FedEx loses other major customers to the USPS, FedEx stock could drop significantly.

Adam Levine-Weinberg has no position in any stocks mentioned. The Motley Fool recommends Amazon.com, FedEx, and United Parcel Service. The Motley Fool owns shares of Amazon.com. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.