DEV Community

Cover image for We built a single score that tells you if a company is worth investing in
Milan Charvat
Milan Charvat

Posted on

We built a single score that tells you if a company is worth investing in

Most stock analysis platforms show you 50 metrics and expect you to figure it out yourself. P/E ratio here, debt-to-equity there, profitability in another tab. By the time you've processed everything, you've forgotten what the first number meant.

We asked ourselves: what if we could answer "is this company any good?" with one number?

The problem with stock analysis today

Look at any major stock analysis platform. You'll find dozens of financial ratios, charts, and scores scattered across multiple pages. Each metric tells a piece of the story, but nobody synthesizes it into a clear conclusion. The investor is left to do the hard part themselves.

We build Fair Price Index, a stock valuation platform covering 37,000+ stocks globally. We already had fair price calculations (using a blend of DCF analysis, relative valuation, and analyst consensus). But we kept hearing the same question from users: "OK, the stock is overvalued, but is the company itself actually good?"

Fair price tells you if the stock is cheap or expensive. It doesn't tell you if the business behind it is strong.

One number: the FPI Rating

So we built the FPI Rating — a single score from 0 to 10 that measures company quality.

Six factors, each scored 0-100:

  • Profitability — gross margin, operating margin, net margin, FCF margin
  • Quality — ROIC, ROE, ROA, asset turnover
  • Growth — revenue growth, EPS growth, FCF growth, book value growth
  • Debt — debt-to-equity, net debt/EBITDA, interest coverage, current ratio
  • Stability — beta, revenue volatility, EPS volatility, consecutive profitable years
  • Valuation — EV/EBITDA, P/E, P/FCF, PEG, P/S, P/B

Plus two academic validators: Piotroski F-Score (0-9, financial strength) and Altman Z-Score (bankruptcy risk).

The base rating is the average of six factor scores normalized to 0-10, adjusted by Piotroski (bonus/penalty up to ±0.5) and Altman (safety check, penalty for distress).

The verdict engine

A number alone isn't enough. We also generate a plain-English verdict from the underlying data. The system identifies which factors scored A (strong) and C (weak), and constructs a sentence:

5.8/10 — "Low debt levels and consistent growth trajectory, but weak profitability margins and expensive valuation relative to fundamentals."

No generic templates. Each verdict reflects the actual strengths and weaknesses of that specific company.

Also shipped: Margin of Safety visualization

We also added a Margin of Safety section to every stock page. Three price points on a visual axis:

  • Conservative entry (fair price minus 20%)
  • Fair price (our blended model calculation)
  • Market price (current trading price)

Investors instantly see how far the current price is from a risk-adjusted entry point. Benjamin Graham's concept, visualized.

One fun challenge: when two price points are very close together (like when a stock trades near its entry level), the labels overlap. We solved it by sorting all three points by position and enforcing a minimum visual gap between adjacent points — they spread symmetrically from their midpoint without changing order.

Tech stack

  • Next.js on Vercel (ISR with 24h revalidation for 37,000+ stock pages)
  • TypeScript API client (hey-api generated from OpenAPI spec)
  • Tailwind CSS with terminal-grade dark aesthetic
  • JSON-LD schema markup (FAQPage, BreadcrumbList, FinancialProduct, Organization, WebSite)
  • All data from a proprietary backend API

Try it

Every stock page now shows the FPI Rating and Margin of Safety:
fairpriceindex.com

Full methodology is public:
fairpriceindex.com/methodology

We're building this in public — every update is documented in our changelog.

Would love feedback from the dev community. What would you add?

Top comments (0)