Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Workflow:AI4Finance Foundation FinRobot Comps Analysis

From Leeroopedia
Knowledge Sources
Domains Valuation, Comps, Financial_Analysis
Last Updated 2026-10-18 00:00 GMT

Overview

End-to-end process for building a comparable-company analysis (comps) with deterministic trading multiples computed from real filings across a selected peer set.

Description

This workflow runs the standalone comps pipeline. The LLM selects peer tickers (judgment), then deterministic code fetches each peer's financials, FX-normalizes to USD, and computes trading multiples (P/E, EV/EBITDA, P/B) and median statistics via the multiples operator. Every multiple is provenance-tracked; the LLM never emits free-text numbers. The report agent narrates the comparison table.

  • Goal: A comparable-company analysis with per-peer multiples and a peer-median summary, all traceable to filed financials.
  • Scope: From a target ticker and a peer set through per-peer financial fetch, multiple computation, median aggregation, and an LLM-narrated comparison.
  • Strategy: LLM selects peers; code fetches, normalizes, and computes multiples; LLM narrates the table.

Usage

Execute this workflow when you need a relative-valuation comparison across a peer set. The CLI accepts an explicit peer set via `--peers` (3-10 tickers); without it, the LLM selects peers automatically.

  • Input State: A valid public ticker symbol and optionally 3-10 peer tickers.
  • Desired Output: A comps table with per-peer P/E, EV/EBITDA, P/B multiples, a peer-median row, and a narrative comparison.

Execution Steps

Step 1: Target Data

Fetch the financial snapshot and price for the target ticker. The data layer pulls financials and price from the primary provider (FMP) with failover to yfinance. The executor produces a validated FinancialData object carrying revenue, EBITDA, and market cap — the benchmark the peer multiples are compared against.

Key considerations:

  • This step is critical — the peer analysis step reads this FinancialData as the peer target, so a validation failure aborts the pipeline.
  • The target's financials define the benchmark for the comparison table.

Step 2: Statistical Bench

Select comparable companies and compute trading multiples deterministically. The LLM selects peer tickers (or accepts the user-supplied set), then deterministic code fetches each peer's financials, FX-normalizes each to USD, and computes P/E, EV/EBITDA, and P/B via the multiples operator. Peer medians are computed across the set. Every multiple traces to a filed figure; the LLM never emits a free-text number.

Key considerations:

  • Peer selection is the LLM's only contribution — all multiples are code-computed.
  • A minimum of 3 peers is enforced by the validator.
  • Each peer's financials are fetched independently and FX-normalized so a foreign peer's native-currency figures never corrupt the cross-peer comparison.

Step 3: Narrative Output

The report agent writes a comparable-company analysis narrative. The LLM receives the computed multiples table, peer medians, and the target's own multiples as context, and articulates the relative-valuation comparison — it does not select any number.

Key considerations:

  • The LLM only narrates; every figure it cites was computed by code.
  • The validator ensures the output contains a comps table structure.

Execution Diagram