With the Nasdaq Composite in the midst of a strong bull market and in record territory, investors are surely searching far and wide for bargain businesses to buy. Luckily, Etsy (ETSY 0.34%) is one such opportunity.

As of March 22, the e-commerce stock is 77% below its all-time high, which was set in November 2021. But the company is still on solid footing in the grand scheme of things, and its key metrics are much improved from prior to the pandemic.

For long-term investors, here's why Etsy is a spectacular stock to buy right now.

Unique position

In the extremely competitive retail sector, Etsy has carved out a successful niche by focusing on selling unique and vintage items that most shoppers agree are hard to find anywhere else. This means the business actually offers things that are valuable and differentiated, helping it stand out against retailers that aim for mass-market appeal.

To be clear, since a demand surge in 2020 and 2021, Etsy's business has slowed down a bit. Gross merchandise sales, which measures the dollar amount of transactions on the platform, totaled $13.2 billion in 2023, which was 2.5% lower than two years prior.

But last year's figure is significantly higher than it was in 2019. In other words, Etsy is much bigger today. And despite softer economic conditions putting pressure on discretionary purchases, the business is positioned well to capture growth as spending picks up once again.

Economic moat

When looking for businesses to own for the long haul, investors should identify those that possess economic moats. These are attributes that allow certain companies to fend off competition.

Etsy fits the bill here. As a huge marketplace with millions of active buyers and sellers, the business benefits from powerful global network effects. Because there are so many shoppers flocking to the site, merchants who want to target big audiences of potential customers are encouraged to join. This leads to greater product selection, which brings in more buyers. It's a virtuous cycle that gets stronger and more valuable over time.

The network effect exists because Etsy doesn't own any inventory or warehouses itself. It just offers the technological infrastructure to allow buyers and sellers to connect. Given Etsy's scale and worldwide presence, it would be extremely difficult for a new entrant to successfully compete unless it could miraculously attract buyers and sellers from a standing start.

Cash generation

Unlike other growth-focused internet-enabled enterprises, Etsy is in a favorable financial position. The business consistently generates positive earnings and free cash flow. And margins today are much higher than they were 10 years ago. Profitability should hopefully improve over time as Etsy better manages its spending on marketing and product development initiatives.

The management team uses excess cash to repurchase stock. Just in the last 12 months, $577 million was spent to shrink the outstanding share count. This is a smart use of capital, especially right now.

That's because the stock is dirt cheap. It trades at a forward P/E ratio of under 14.5. That kind of bargain is almost impossible to find, particularly for a business that has a clear value proposition for its users, powerful network effects, and the ability to generate net income.

This is a compelling buying opportunity for investors. But it's best to be patient and maintain a long-term time horizon for the stock to play out.