Do you cash out or stick to your guns? Twitter co-founder Ev Williams says you should only sell your company if the offer captures the upside, there’s an imminent threat, or you personally want to. “Any of them will suffice,” but Twitter didn’t have any, says Williams.

In the Medium post, Williams discusses how in 2008, one of the tech giants was interested in acquiring Twitter. He didn’t reveal who it was, but around that time, Fortune and others reported that Twitter was in talks with Microsoft, Facebook and Google. In an email to Twitter investors, Williams explained his three reasons companies should sell, and why Twitter didn’t have to.

The first and most obvious reason to sell is if the financials of the offer capture the upside of your company’s potential. If the offer significantly exceeds the eventual value of your company, then sell. That calculation requires looking closely at your market. Is it a grand, world-changing space where success could earn you a fortune? Or is it a discrete opportunity where even if you hit a home run and win outright, there’s a limit to your value. Think Google vs. a photo-sharing app. Ev saw Twitter’s short-form communication as having enormous potential, so the acquisition offer wasn’t big enough.

Second, is there an imminent threat to your company? Something that could derail your business and hamper the entire space or give your competitors an opening? Then selling out could net you a payday that might never materialize if you try to defeat that threat yourself and fail. Ev cites YouTube’s legal issues around copyright and PayPal’s fraud problem as reasons why it was smart for them to sell to Google and eBay, respectively, to get help fighting these risks. In Twitter’s case, the threat was the fail whale. It had been having scalability issues causing the site to crash, giving Twitter a reputation of unreliability. But by the time the offer came through, Ev thought Twitter had the fail whale harpooned.

Finally, the companies should sell if the founders really want to. Sometimes they want to move on to a new idea, or have lost enthusiasm for the current one. Other times the founders see the acquiring company as the right home that could take their business to new heights, or they want to go work there and learn more. Ev was excited to be the new CEO of Twitter, and thought the acquirer wouldn’t be the right cultural fit for his team.

It looks like Williams bet right. Now Twitter is flying towards an IPO. Revenue is expected to continue doubling year over year, and it’s got a new ads API that could boost sales. And Twitter’s user-base notoriety has grown significantly since it was an essentially unmonetized social network with just 50 employees that “probably had fewer than ten million users.”

Then again, Ev had already sold Blogger to Google and made his nest egg. The next hundred million dollars isn’t quite as tempting when you already have a couple mill in the bank.