ValuFlow Methodology Reading List Contact ← Back to ValuFlow
← ValuFlow · Project Overview
Models & Methodology · Living Document

How the Models Work

A transparent breakdown of models built inside ValuFlow — the financial theory behind each one, how data flows through the pipeline, and exactly where to find the code. This page grows as the project does.

Foundation

Project Pipeline

The end-to-end flow of ValuFlow — from raw API data through modeling, qualitative intelligence, and dashboard output. Steps marked as planned represent the direction the project is actively building toward.

Step 01 Active
FMP API Ingestion
FMP's API is called to pull company profiles, financial statements, price data, key metrics, ratios, and treasury rates — covering all NYSE and NASDAQ tickers. Raw data is written directly to Snowflake's RAW schema, untransformed and exactly as received.
FMP API RAW Schema 2,033 Tickers
Step 02 Active
Staging & Normalization
Raw data is cleaned, typed, and normalized into the STAGING schema — columns renamed, data types cast, and derived metrics calculated (margins, growth rates, valuation inputs, D/E ratios). Staging tables are the model-ready layer that every downstream script queries from.
STAGING Schema Python · Pandas Derived Metrics
Step 03 Active
Model Execution
Financial models run against staged data — pulling from Snowflake, executing calculations in Python, and writing versioned outputs back to the RESULTS schema. Models can also call FMP directly during execution for current data, such as live S&P 500 prices for beta regression.
Python Models RESULTS Schema FMP Live Data
Step 04 Active
Qualitative Intelligence — Anthropic Claude Sonnet 4.6
Model outputs are passed to Anthropic's Claude Sonnet 4.6 via API to generate qualitative commentary — contextualizing quantitative results with industry knowledge, risk factors, and analytical perspective. Outputs are written to Snowflake alongside the model results.
Anthropic API Claude Sonnet 4.6 Qualitative Output
Step 05 Planned
Qualitative → Quantitative Translation
Structured qualitative outputs from Claude are translated into numerical signals — sentiment scores, risk adjustments, and model modifiers — that feed directly into valuation inputs. Closes the gap between narrative analysis and quantitative model assumptions.
NLP Signals Model Inputs Planned
Step 06 Active
Power BI Dashboard
All model outputs written to Snowflake are connected live to a Power BI dashboard — filterable by sector, industry, company, and regression frequency. Published publicly via Power BI Premium as the primary output layer for ValuFlow results.
Power BI Live Snowflake Connection Publicly Published

Foundation

Snowflake Architecture

The three-schema Snowflake structure that feeds every model. RAW holds exactly what comes in from the API — nothing transformed. STAGING cleans and normalizes. RESULTS holds model outputs, one table per model version.

RAW Schema
Ingested As-Is
Exact API response — no transformation. Every field exactly as FMP delivers it.
16
Tables
13.7M
Rows
Annual + Quarterly
Price · Treasury · Profiles · Financials
STAGING Schema
Cleaned & Typed
Normalized, typed, and model-ready. Derived metrics calculated here — margins, growth rates, valuation inputs.
18
Tables
13.7M
Rows
Annual + Quarterly
+ Growth · Margins · Valuation Inputs
RESULTS Schema
Model Outputs
One table per model version — immutable once written. Each run permanently preserved.
1
Table Live
Growing
As models run
BETA_SENSITIVITY_REGRESSION_FLOW_V1
+ CAPM_V1 · WACC_V1 · DCF_V1 · coming
↓ Models built on this foundation
Category 01 2 Published

Beta Models

Beta measures a security's sensitivity to market movements — the foundation of risk-adjusted return analysis. These models calculate both levered and unlevered beta across multiple regression frequencies, using the S&P 500 as the market proxy and Hamada's Equation to strip out the effect of financial leverage.

→ Beta Book Value Mass Model → Beta Market Value v1.4.0
Beta Book Value Mass Model
Beta Model v1.3.1 · Mass Run — Regression Flow v1.0.0
Calculates levered and unlevered beta for all companies across NYSE and NASDAQ across daily, weekly, and monthly return frequencies in a single execution. Levered beta via OLS regression against the S&P 500; unlevered beta via Hamada's Equation (Book Value). Outputs written to Snowflake and visualized in the live Power BI dashboard.
Published
Methodology
  • OLS Regression → Levered Beta (βL) — Each stock's periodic returns are regressed against S&P 500 returns; the slope coefficient is levered beta — market-observed risk inclusive of capital structure
  • Three Frequencies — Daily, weekly, and monthly return windows run as separate full passes; analyzing beta behavior across frequencies surfaces whether risk signals are driven by short-term noise or structural market sensitivity — a key input into the industry analysis layer being developed alongside this model
  • Hamada's Equation (Book Value) → Unlevered Beta (βU) — βU = βL ÷ [1 + (1 − Tax Rate) × (Total Debt ÷ Total Stockholders' Equity)]; tax rate fixed at 21% (US corporate); debt and equity sourced from the most recent annual balance sheet filing — isolates business risk from capital structure effects
  • Beta Distortion — βL − βU; measures how much financial leverage inflates perceived market risk above true business risk; expressed both in raw units and as a percentage of βU for cross-industry comparability
  • Alpha vs Benchmark — Regression intercept compared against a risk-free-rate-adjusted benchmark alpha; classified as Outperformed or Underperformed
  • Risk-Free Rate — 10-year US Treasury yield averaged over the regression window, sourced from FMP via Snowflake to ensure current rates are used
  • Outputs per ticker per frequency — βL, βU, Beta Distortion, Beta Distortion %, Alpha, Alpha vs Benchmark, R², Firm-Specific Risk, Std Error, P-Value, D/E Ratio, Risk-Free Rate
Data Flow
Inputs
STAGING.PRICE_DATA RAW.SP500_PRICES STAGING.BALANCE_SHEET_ANNUAL RAW.TICKER_UNIVERSE RAW.TREASURY_RATES
Processing
Return Calculation OLS Regression Hamada (Book Value)
Output Table
VFMODELS.BETA.BETA_SENSITIVITY_REGRESSION_FLOW_V1
Dashboard
Beta Market Value Model
Beta Model v1.4.0 · Single-Ticker · Market Value Hamada
Advances the unlevering methodology from book value to market value — using a Damodaran Synthetic Rating approach to estimate the market value of debt (Dmv) and pulling market cap directly from Snowflake as the market value of equity (Emv). Levered beta via OLS regression; unlevered beta via full market value Hamada. Dmv and Emv written to Snowflake as point-in-time snapshots. Next step: mass run version across all NYSE and NASDAQ tickers with full Snowflake output.
Published
Methodology
  • OLS Regression → Levered Beta (βL) — Stock returns regressed against the S&P 500; slope coefficient is levered beta inclusive of capital structure
  • Damodaran Synthetic Rating → Dmv — Interest Coverage Ratio (ICR) mapped to a synthetic credit rating using Damodaran's live spread table (NYU, updated annually); default spread + 10Y Treasury = pre-tax cost of debt (Kd); semi-annual bond cash flows discounted at Kd to derive Dmv
  • ICR Methodology — Configurable as latest year or 3-year average; implied coupon rate derived as Interest Expense ÷ Total Debt
  • Market Value of Equity (Emv) — Pulled directly from RAW.SHARES_OUTSTANDING as market cap; point-in-time snapshot
  • Hamada's Equation (Market Value) → Unlevered Beta (βU) — βU = βL ÷ [1 + (1 − Tax Rate) × (Dmv ÷ Emv)]; uses market value D/E ratio throughout — more economically accurate than book value approach
  • Dynamic Tax Rate — Pulled from STAGING.FINANCIALS_CLEAN; falls back to 0% for companies with NOL carryforwards
  • Risk-Free Rate — 10Y Treasury yield pulled live from FMP API at time of execution
Data Flow
Inputs
STAGING.VALUATION_INPUTS STAGING.FINANCIALS_CLEAN RAW.SHARES_OUTSTANDING RAW.PRICE_DATA RAW.SP500_PRICES Damodaran NYU Spread Table FMP Treasury Rates API
Processing
ICR → Synthetic Rating Bond Discounting → Dmv
OLS Regression → βL Hamada (Market Value) → βU
Snowflake Outputs
VALUFLOW.MODELS.DMV_OUTPUT
VALUFLOW.MODELS.EMV_OUTPUT
Next: mass run version with full Snowflake write for βL · βU

The Bigger Picture

What's Being Built

ValuFlow is designed as a layered analytical framework — each model building on the last. Below is the full model inventory: what's been built and what's in progress.

Built
OLS Beta Regression — Levered Beta (βL)
Beta Model v1.3.1 · Mass Run v1.0.0
Regresses individual stock returns against the S&P 500 via OLS across daily, weekly, and monthly frequencies for 2,033 companies simultaneously. The slope coefficient of the regression is levered beta — market-observed risk that includes the effect of each company's capital structure.
Hamada's Equation (Book Value) — Unlevered Beta (βU)
Beta Model v1.3.1 · Book Value · Tax Rate 21%
Applies Hamada's Equation using book value debt and equity to unlever βL — isolating pure business risk from capital structure effects. Formula: βU = βL ÷ [1 + (1 − 0.21) × (Total Debt ÷ Total Stockholders' Equity)]. Debt and equity sourced from the most recent annual balance sheet filing in Snowflake.
Hamada's Equation (Market Value) — Unlevered Beta (βU)
Beta Model v1.4.0 · Market Value · Dynamic Tax Rate · Mass Run Pending
Advances the unlevering approach to market value — Dmv derived via Damodaran Synthetic Rating (ICR → credit rating → default spread → bond discounting); Emv from market cap. βU = βL ÷ [1 + (1 − t) × (Dmv ÷ Emv)]. Dynamic tax rate; Dmv and Emv written to Snowflake. Mass run version with full Snowflake output in progress.
In Progress / Planned
CAPM
Cost of Capital · Stage 4
Active
Credit Rating Model
Cost of Capital · Stage 4
Planned
WACC
Cost of Capital · Stage 4
Planned
DCF
Intrinsic Value · Stage 5
Planned
Comps
Intrinsic Value · Stage 5
Planned
LBO
Extended Models · Stage 7
Planned
EV/IC
Extended Models · Stage 7
Planned
Monte Carlo
Extended Models · Stage 7
Planned
Explore ValuFlow

See the full project overview, roadmap, and how everything fits together.