Uber (UBER 2.36%) CEO Dara Khosrowshahi is taking advantage of his company's stock performance so far this year.

The head of the ride-sharing network sold 100,000 shares of stock at the end of June, representing roughly 6.6% of his holdings. It was the first time Khosrowshahi sold shares since Jan. 2021, when the stock traded around $55. He's accumulated a lot more equity in the company through share purchases and compensation in the past two and a half years.

So why is Khosrowshahi selling shares now? Should investors follow suit and lighten up on Uber stock?

The reason Khosrowshahi sold his shares

Khosrowshahi's stock sale was part of a 10b5-1 plan, which automatically executes a trade based on predetermined criteria.

For Khosrowshahi's sale, it appeared to execute when the stock hit $45 per share. Shares recently reached that threshold for the first time since Jan. 2022.

10b5-1 plans are designed to eliminate the possibility of insider trading. That is to say, Khosrowshahi didn't make the sell decision based on knowledge that isn't publicly available. He likely sold to take profits and decrease his exposure to Uber's stock price fluctuations.

It's a prudent move for someone who has a significant amount of net worth tied up in a single company. And while investors want a CEO with an aligned interest in pushing the share price higher over the long term, Khosrowshahi still holds a significant amount of Uber stock and receives compensation in the form of stock options. Investors can rest assured he's still very much aligned with that goal.

Should investors sell shares, too?

Shares of Uber are up more than 90% year to date, trading at a level it hasn't consistently seen since 2021. Many investors may have already made a significant profit on their holdings.

But taking profits here could be a mistake unless you're simply rebalancing your portfolio.

From a pure valuation standpoint, Uber shares trade at an enterprise-value-to-sales ratio of less than 3. And its price to gross bookings is less than 0.8.

Sales are rising steadily, and analysts expect annual growth of about 17% this year and next year. Gross bookings could grow even faster. Management previously guided for $165 billion to $175 billion in gross bookings in 2024, representing a compound annual growth rate of about 21% from 2022.

Long-term investors should also consider the massive competitive advantage Uber's building in its massive network of drivers, customers, and merchants. Each piece in the network supports growth in other places. For example, more drivers mean customers get rides and deliveries more quickly.

The benefits of this network are seen in Uber's recent deal with Domino's. The pizza company is willing to share revenue with Uber in exchange for placement within its app. That's the power of having a solid customer base that's consistently opening the app. Uber's network isn't even delivering the pizzas -- it's pure profit for the company. Likewise, Uber's growing ad business is a result of the network effect.

With shares still trading at an attractive valuation, Uber shareholders shouldn't be scared off by the CEO's stock sale. The long-term case for Uber remains very much intact.