Basic Prerequisites: Financial Statements & Accounting (the three statements). No prior data or programming knowledge needed.


1. Intuition & Practical Objective

This page builds the why of fundamental data with no prior knowledge needed. The objective is one idea: a fundamental number is not a fact of nature - it is a claim made by a company, on a date, in a document, under a set of accounting rules; and “where the numbers come from” is a question with a real, inspectable answer.

Start with the dumbest question: where does “FY2022 revenue = 1000” actually live? It is not in a database in the sky. It is a number typed into a 10-K filed with the SEC, tagged with an XBRL element name, stored in EDGAR, and then copied - with each provider’s own adjustments - into Sharadar, Compustat, Bloomberg, Yahoo. Every one of those copies can differ, and the original is always the filing.

Three steps:

  1. There is a chain, and it starts at the regulator. Company types numbers into a filing → files it with the SEC → EDGAR stores it (raw HTML plus XBRL-tagged facts) → commercial vendors standardize and resell it. Going upstream buys you fidelity and costs you effort; going downstream buys you convenience and costs you control. (The Corpus’s data-sources-and-corporate-data section is explicit: EDGAR is the club’s primary raw input.)

  2. The chain is a four-layer stack, and the layers are not interchangeable.

    LayerWhat it isExampleWho owns the risk
    L0 rawThe filing as published10-K HTML + XBRL companyfacts JSONnobody standardizes it for you
    L1 canonicalTagged concepts mapped to a fixed schemaus-gaap:NetIncomeLoss → net_incometag ambiguity - see 02 · SEC EDGAR & XBRL
    L2 panelOne row per (firm, period, as-of date)a PIT table that is never overwrittenlook-ahead if you skip the as-of date
    L3 signalMargins, ROE, growth, screen ranksROE = NI / avg equitybias propagation from every layer below

    The whole discipline of this folder is: never compute L3 on anything but an honest L2. Most people compute L3 directly off an L0/L1 convenience download and never notice the leak.

  3. “As reported” is not “as restated,” and the difference is the future. A company’s 2020 revenue will be re-filed in a later 10-K/10-K/A if it is reclassified. If your database shows the restated 2020 figure while you are standing in 2021, your screen is reading a number that did not exist yet - the classic look-ahead leak, and the subject of 05 · Failure Modes.


2. Mathematical Ground Truth & Derivations

The provenance tuple. Every fundamental observation is

and the operational rule is that the observation is usable only from :

A “point-in-time panel” is one that keeps every vintage of (concept, period) separately, keyed by , instead of overwriting on restatement:

Overwriting on restatement collapses to one row per period and destroys the only information that tells you whether a backtest was honest.

The flow/stock distinction that trips up extraction. Income-statement and cash-flow facts are duration facts (they carry a start and an end); balance-sheet facts are instant facts (they carry only an end). Mapping both into one schema without recording which is which is the most common beginner extraction bug:

The look-ahead arithmetic, exactly. Let be revenue for year as first reported and its eventually-restated value. A restatement of year changes the measured growth of by

so even a single restated denominator silently rewrites every growth number that depends on it - which is why the leak is so easy to miss and so corrosive to a screen (§3 measures it).


3. Computational Implementation - the stack, and one measured look-ahead leak

Stdlib only. It prints the four-layer stack and then quantifies a single 2020 restatement’s effect on the 2021 growth figure a screen would have computed at the time.

The lesson is not that 5.93 points is enormous - it is that the same firm, the same two years produced two materially different growth readings depending only on which vintage of the database was read. Multiply that across a screen of hundreds of names and it is the difference between a real edge and a data artifact.


4. Failure Modes & First-Principles Breakdowns

  1. Provenance blindness (first principle: a number is a claim, not a fact). “Revenue is 1000” is incomplete without who tagged it, when, and whether it was later revised. Always carry source and as-of alongside the value. Fully developed in 05 · Failure Modes.
  2. Convenience-first extraction (first principle: the downstream copy encodes choices). Starting from a Yahoo quoteSummary scrape means inheriting an unknown standardization and no as-of date - fine for eyeballing a P/E, fatal for a backtest. Start from EDGAR when fidelity matters (02).
  3. Duration/instant confusion (first principle: flows span a period, stocks are a point). Storing a balance-sheet “instant” in the same column as a P&L “duration” makes every average-denominator ratio wrong. Tag the fact type at L1.
  4. Overwriting on restatement (first principle: must keep vintages). A panel that keeps only the latest value cannot reconstruct the past - the exact defect that makes naive Compustat backtests look better than they were (03).

5. References

  • SEC, EDGAR APIs documentation
  • XBRL US / XBRL International taxonomies
  • Ittelson, Financial Statements: A Step-by-Step Guide
  • Penman, Financial Statement Analysis and Security Valuation
  • Sloan, Richard (TAR, 1996)

6. Connected Graph Bridges