In June of 2019, it looked as though Shopify's (NYSE:SHOP) stock could do no wrong. Shares were up 1,000% over the past three years. The stock was valued at $37 billion.

And yet, the company hadn't turned a profit. It had negative free cash flow. And, it was valued at $37 billion.

That led my colleague Simon Erickson and I to make a bet -- a public bet shared within the Twitter-sphere.

Last week, the company closed at $430.20 -- a 31.6% gain from our starting point; I collected my win. 

I can't emphasize this enough: Over the short term, I could just as easily have lost this bet. The bet itself spanned a measly six months. I am much more concerned with where things are headed over the next decade.

That said, Shopify has five traits that I look for in an investment. When all five are present, I really don't care how expensive the stock is; I believe the scales are tipped in my favor. Let's dig into all five.

A man in an office cubicle cheering as his colleagues go about their work

Image source: Getty Images.

1. A simple, inspiring, all-encompassing mission

I'm an annoying stickler about mission statements. I need to know the existential reason a company exists in the first place. If it's just to make money, I want nothing to do with it. And I'm just an investor -- imagine how much more important that is to customers and employees!

From day one, Shopify's mission has been very simple: "to make commerce better for everyone." When we've interviewed founder/CEO Tobi Lutke, it's clear this mission is in his bones.

His resolve in the mission has certainly been tested. When groups protested Shopify hosting a website with views that many found objectionable, Lutke agreed, but he refused to discontinue service, saying, "If we start blocking out voices, we would fall short of our goals as a company to make commerce better for everyone."

2. Demonstrated optionality

Another part of that mission statement is that it's optionable. That simply means there are endless ways Shopify can fulfill that mission. One look at the company's history bears this out:

  • Shopify started as predominantly a software-as-a-service (SaaS) company, helping merchants set up an e-commerce presence. 
  • It then branched into "Merchant Services," helping process payments, print shipping labels, and even giving out loans.
  • Recently, it announced it was building out its own fulfillment network.

The point is: The world is going to change -- as it always does. A company needs to be able to evolve, guided by its mission. Shopify has demonstrated an ability to do this. Over the long run, I don't need to know what those changes will be; it's enough to know that Shopify has proven it can evolve.

3. It must have a defensible moat

In the business world, success breeds competition. If a company doesn't have some type of sustainable advantage, the competition will eventually catch up. 

Shopify enjoys two key moats:

  • High switching costs: When a small business has its website, inventory tracking, social media presence, payment solutions, and (soon) fulfillment network all on one platform, the last thing it wants to do is change to a different one. It's expensive and a pain.
  • Network effects: Shopify allows third-party developers to sell tools on its app store. Shopify gets a cut of each sale. That's nice, but it's not the main point. The company has over 2,500 apps available specifically for its 1,000,000-plus merchants. This draws in more third-party developers and merchants.

When those forces combine, they provide a wide moat, keeping merchants locked in for the long haul.

4. Financial fortitude

Of course, a company also needs to be able to pay the bills. Even if it's mission-driven with optionality and a wide moat, those things won't matter if it can't pay the bills.

Shopify isn't yet profitable or free-cash-flow-positive, but I think it has tons of financial fortitude. Currently, the company has $2 billion in cash and zero long-term debt.

Shopify is purposely spending a little bit more than it earns to both grab an enormous opportunity and manage investor expectations. That's a smart move. And if a recession hits, it could easily hit the brakes on spending and be just fine.

5. Skin -- and soul -- in the game

Finally, I want to know that the people building this organization truly care about what they do. Being a founder-led company, Shopify already has a leg up. I've discovered that founder-leaders often view a company as a kind of extension of themselves, which makes them devoted to building something of lasting value.

If that weren't enough, consider the following:

  • Lutke owns over 60% of Class B shares, meaning he will suffer financially if we -- as investors -- suffer. 
  • Employees like working there: They give Shopify 4.0 stars out of 5.0 -- a very solid score.
  • Those same employees give Lutke a 92% approval rating.

When people care about what they're building, have a financial stake in it, and enjoy being a part of it all, good things happen.

What this all means for investors

Does all of this mean you should run out and devote tons of money to Shopify? Hardly. Investing is a game best played by adding small amounts over time. That's what I've done with my own Shopify stake.

Rather, these are lessons you can apply across the board. When a stock seems expensive, look deeper. If it shares these characteristics -- and you have a truly long-term mentality -- it's worth considering buying it anyway.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.