# SAINHE — About, method and engineering

> Page: https://sainhe.com/contact

## What SAINHE is

A free, non-commercial investment-analysis site built and maintained by one student, Hugo Waldmeyer. It measures and flags; it never
forecasts prices or recommends trades. Every figure carries its source.

## How a number reaches the page

1. **Fetch** (GitHub Actions, several times a day): prices and FX from Yahoo Finance and the ECB, Gazprom from the Moscow Exchange,
   rates from FRED, the ECB, the Bundesbank, Japan's Ministry of Finance and ChinaBond, valuation from multpl.com, the implied equity
   risk premium from Aswath Damodaran, headlines from RSS.
2. **Filings**: US 10-K and 20-F from SEC EDGAR (XBRL company facts, and the filing's own XBRL instance when the API lags),
   European annual reports from ESEF (filings.xbrl.org). Yahoo statements only where no machine-readable filing exists, shown as
   secondary. A missing figure is N/D, never interpolated or imputed.
3. **Compute** (Python, SQLite): returns, moving averages, money flow; reverse DCF, earnings power value, residual earnings, ROIC vs
   WACC per currency; portfolio statistics, bootstrap Monte Carlo with an extreme-value tail, crisis replay, turbulence.
4. **Render**: static HTML (Jinja2) plus a JSON data layer (/data/*.json), deployed to Cloudflare Pages, and a facts
   registry (/data/facts/): one record per published number with unit, date, source and method. A build stops if the
   same fact carries two values anywhere on the site.
5. **Check**: unit tests on the valuation engine, the portfolio engine and the front-end arithmetic run on every change; a quality
   pass cross-checks XBRL against a second source; every Monday a job compares the published values with FRED, the ECB, the
   Bundesbank, Damodaran, the SEC and Yahoo and opens an issue on any drift or silent source.

## Rules the code enforces

- No forecasts: the only forward-looking figures are what the price implies (reverse DCF) and external analyst consensus.
- Free public data only; every threshold lives in configuration, none is hard-coded.
- Each number links to its formula, inputs and filing (XBRL tag, accession number).
- No language model anywhere in the data pipeline: everything is deterministic and reproducible.

## For AI agents and developers

- Facts registry: https://sainhe.com/data/facts/manifest.json (one id = one value; dates, listings and sources are explicit)
- Read-only REST API: https://sainhe.com/api (OpenAPI: https://sainhe.com/api/openapi.json)
- MCP server (Streamable HTTP): https://sainhe.com/mcp — tools get_company, list_companies, compare_companies, get_indicator,
  list_sectors, get_watchlist, explain_term, get_data_freshness
- One fact sheet per company: https://sainhe.com/stock/{TICKER}.md · glossary: https://sainhe.com/glossary.md

## Source code

Public repository: https://github.com/MUGIWARA95D/sainhe-v4

## Legal

Informational only, not investment advice. SAINHE publishes measurements computed from public data; it does not recommend buying or selling any security. No cookies, no tracking, no analytics. Hosted by Cloudflare. Full text: https://sainhe.com/contact#ct-legal
