Skip to content

Value foreign companies on their home listing and answer in the user's US line - #28

Merged
zanwenfu merged 2 commits into
mainfrom
fix/home-listing-valuation
Sep 29, 2026
Merged

zanwenfu merged 2 commits into
mainfrom
fix/home-listing-valuation

Conversation

@zanwenfu

@zanwenfu zanwenfu commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Why

A foreign company's US line was valued against the S&P 500, which it barely moves with. AstraZeneca's NYSE shares gave a beta of 0.50 (the floor) against 0.96 for its London shares. With the same risk-free rate, premium, cost of debt and tax, the model published a $159.47 fair value on one line and withheld a $106.61 one on the other. Answers were also given in whichever listing the valuation happened to run on, often in pounds, pence or yen, for a user who asked about a US ticker.

What changes

  • Value on the home listing. A US line of a non-US company moves to its home listing (AZN → AZN.L, TM → 7203.T, BABA → 9988.HK, SHEL → SHEL.L, …) only when all of these hold:

    • it is the same issuer on its home exchange, not OTC and not a receipt;
    • it is quoted in a unit the scraper reads (London pence yes; Tel Aviv agorot and Johannesburg cents no);
    • there is a clean receipt ratio from Yahoo's share counts (measured exactly: TM 10, BABA 8, BP 6, HSBC 5, TSM 5, HDB 3, SHEL/BHP 2, most others 1);
    • the US price is within 25% of the home price × the ratio;
    • an exchange rate exists for the conversion.
  • Answer in the user's listing. The answer opens in the US line, with ticker, exchange, dollar price, ratio, exchange rate, VYNN's figures per US share and the Street's mean target per US share. For example:

    HSBC (NYSE, $101.18): HSBC Holdings plc is valued on its home listing, HSBA.L; one HSBC share represents 5 HSBA.L shares. Per HSBC share, the supported DCF scenario estimate is $73.00. The Street's mean target is $101.09 per HSBC share.

    The same view covers named companies with an exchange-listed US line: Toyota → TM, Shell → SHEL. A home ticker the user typed (7203.T) is answered as typed.

  • The guard. Where per-home-share figures differ from per-US-share ones (a London Shell share is half a SHEL share), only the per-US-share figures count as published. Withheld figures are matched as whole numbers. The Street block is labelled with its share basis.

  • Cards, price evidence and follow-up reports use the user's line. A follow-up read_report finds a report filed under the home listing.

Production bugs fixed along the way (each reproduced on live data)

Bug Production today After
"should i buy UL?" valued Hindustan Unilever (₹, −57%) Unilever on ULVR.L, per UL share
"should i buy BABA?" yuan figures labelled dollars: "$729.76 USD" for a $108.76 stock, "+295%" HOLD, $114.11 per BABA share, +4.9%
"should i buy AstraZeneca?" / "HSBC?" dollar figures labelled £ … GBP labelled USD, plus per-US-share figures
"analyze SPOT" valued a Frankfurt line trading 430 shares/day, with a DAX beta valued on SPOT

Resolver fixes behind these:

  • one-word names must match exactly;
  • a candidate's domicile must match the issuer's;
  • Hong Kong short names are codes ("BABA-W"), so the long name is read too;
  • Hong Kong counts as home for issuers domiciled in China;
  • the currency swap needs the home market or a line traded at scale (Stellantis keeps Milan).

Behaviour changes to know

  • Typed US tickers of foreign companies now value on the home listing. AZN goes from HOLD $169.14 on the NYSE line to NOT RATED, $106–134 per AZN share.
  • The job label and book row show the valued listing (AZN.L, 9988.HK).
  • The downloadable report is for the valued listing.

Validation

  • Server gates (production image vs candidate):
  • Valuation canary (16 names): PASS every time, all expectations matched.
  • Independent adversarial review: 10 findings. All were reproduced before fixing, and the fixed ones are covered by tests. Examples: London-share figures accepted as NYSE-share figures; Stellantis losing Milan; "18.0%" matching "8.0%"; follow-up reports not found.
  • Tests: 1,673 pass. 32 mutations, each reintroducing a bug these changes fix, are all caught.

US filers stay on their US line (second commit)

As you asked, a company whose main market is the US is valued and answered entirely on its US line. "Main market" is the SEC's filer status, read by src/sec_filer.py (public files, cached on disk):

  • A company that files its annual report on Form 10-K reports as a US company. It is never moved. If it is named and resolves to its foreign line, it is valued back on the US line.
  • 20-F and 40-F filers are foreign issuers and keep the home-listing rule.

Why the SEC and not trading volume: Infosys's NYSE ADR trades 1.8× its Mumbai line and Yum China's NYSE line 1.9× Hong Kong's. Yahoo reports dollar accounts on both lines for both, and marks no receipts, so nothing else separated them.

gate25 (8 questions, production vs candidate), canary PASS:

Asked Valued on
SHOP / "Shopify" SHOP (unchanged)
YUMC / "Yum China" YUMC. The named question resolved to 9987.HK and was moved back ("reports to the SEC as a US company"). Same STRONG BUY $72.10 as production.
WCN WCN (unchanged, HOLD $157.09)
INFY (20-F) INFY.NS: "Per INFY share, $10.90–$11.24; Street $12.53 per INFY share"
AZN, "Toyota" (20-F) AZN.L / 7203.T, answered per AZN / TM share

Other outcomes:

  • A typed SHOP.TO is valued on Toronto, as typed.
  • Thomson Reuters, Brookfield and Agnico Eagle are 40-F filers, so they value on Toronto and are answered per US share.

The SEC answers without a contact email today, but its fair-access policy asks for one in the User-Agent. The reference-data User-Agent also named vynn.ai (another company's domain); it now names vynnai.com.

Tests: 1,682 pass; the 5 new mutations are caught.

Ready to merge.

🤖 Generated with Claude Code

zanwenfu and others added 2 commits September 28, 2026 20:03
…s US line

A foreign company's US line was valued against the S&P 500, which it barely
moves with. AstraZeneca's NYSE shares gave a beta of 0.50 (the floor) against
0.96 for its London shares. With the same risk-free rate, premium, cost of debt
and tax, the model published a $159.47 fair value on one line and withheld a
$106.61 one on the other.

A US line of a non-US company (AZN, SHEL, HSBC, BABA, TM, TSM, ...) is now
valued on its home listing, and the answer is stated back per US share in
dollars. A company the user names, rather than types, is answered in its
US-exchange line when it has one.

- src/listing_view.py (new):
  - home_line_for decides the move. It requires the same issuer on its home
    exchange, not OTC and not a receipt, a quote unit the scraper reads, a
    receipt ratio from Yahoo's share counts, a US price within 25% of the home
    price times the ratio, and an exchange rate the scraper can convert with.
  - us_line_for finds the US line of a named company.
  - build_view, view_figures and lead_paragraph produce the per-US-share
    figures, including the Street's mean target, and the answer's opening.
- The templates open in the user's line.
- The guard:
  - Where per-home-share figures differ from per-US-share ones (a London
    Shell share is half an NYSE share), only the per-US-share figures count as
    published.
  - Withheld figures are matched as whole numbers.
  - The Street block names the share its targets are for.
- Result cards, price evidence and follow-up report lookups use the user's
  line.

Fixed while validating (each reproduced on live data):
- UL was valued as Hindustan Unilever. One-word names must now match exactly,
  and a candidate's domicile must match the issuer's.
- SPOT was valued on a Frankfurt line that trades 430 shares a day, against
  the DAX. The currency swap now needs the home market or a line traded at
  scale, so Stellantis keeps Milan.
- The withheld and published templates labelled figures with the listing's
  currency. AstraZeneca's dollar range printed as pounds, and Alibaba's yuan
  figures as dollars ("$729.76" for a $108.76 stock).
- Alibaba's Hong Kong line was invisible to the search, because its short name
  is "BABA-W". Hong Kong now counts as home for issuers domiciled in China.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A company that reports to the SEC as a US company (Form 10-K) trades mainly in
the US. Examples: Yum China (Delaware, NYSE, with a secondary Hong Kong
listing), Waste Connections and Shopify (both also listed in Toronto). These
companies are no longer moved to a home listing. When a named one resolves to
its foreign line, it is valued on the US line instead.

Trading volume could not tell them from a foreign company with a busy ADR:
Infosys's NYSE line trades 1.8x its Mumbai line, Yum China's 1.9x Hong Kong's.
Yahoo does not mark receipts. The SEC's filer status does (10-K versus 20-F or
40-F); src/sec_filer.py reads it from the SEC's public ticker table and each
company's filings, cached on disk.

The reference-data User-Agent named vynn.ai, another company's domain; it now
names vynnai.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zanwenfu
zanwenfu merged commit 86e94a5 into main Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant