TAPE 33OPEN TERMINAL
DISPATCH-001▌ FILED 2026-06-05 · 21:30 ET▌ CLEARANCE: PUBLIC

OPERATION SILVER FORK

How a 10× understatement in BABA's market cap was hiding inside the SEC's own data — and the four-line fix that surfaced it. A forensic walk through the company facts JSON, the dei vs us-gaap concept tie-break, and why iteration order is a load-bearing decision when both concepts report on the same period.

▌ FILED BY jst213▌ TAGS:sec edgaradrmarket capconcept tie-break

On the morning of 2026-06-05, a routine spot-check of the terminal's market-cap render for Alibaba Group (BABA) returned a number that did not survive a single glance: $29.15 billion. The actual market cap of BABA at that timestamp was approximately $289 billion — a clean ten-fold understatement. The price was right. The ADR ratio (1 ADS : 8 ordinaries) was right. The arithmetic was right. Only the share count was off, by an order of magnitude.

▸ The Symptom

The output of GET /sec/market-cap/BABA:

{
  "ticker": "BABA",
  "value": 29152607229.6,
  "shares": 1858037427.0,
  "sharesAsOf": "2026-03-31",
  "asOf": "2026-06-05T13:21:20Z",
  "source": "sec+tiingo",
  "adrRatio": 8.0
}

BABA, by 2026, has approximately 18.58 billion ordinary shares outstanding (filed in their 20-F for the period ending 2026-03-31). Divided by the ADR ratio of 8, that is 2.32 billion ADS-equivalents. At a quote of ~$124.78, the implied market cap is ~$289B. The terminal was returning 1.86 billion shares — exactly 10× too small. That specific factor of ten is not a rounding error; it is a load bearing piece of evidence.

▸ The Investigation

The shares-outstanding picker (python/sec_shares.py::_pick_latest_shares) walks every observation across three SEC XBRL concepts and picks the most recent by (end, filed):

_SHARES_CONCEPTS = (
    ("dei", "EntityCommonStockSharesOutstanding"),
    ("us-gaap", "CommonStockSharesOutstanding"),
    ("us-gaap", "CommonStockSharesIssued"),
)

A direct pull of BABA's company facts JSON revealed why: BABA's 20-F for the period ending 2026-03-31 reports all three concepts with identical (end, filed) tuples — but with different values:

dei:EntityCommonStockSharesOutstanding     1,858,037,427    end=2026-03-31  filed=2026-05-20
us-gaap:CommonStockSharesOutstanding      18,580,374,278    end=2026-03-31  filed=2026-05-20
us-gaap:CommonStockSharesIssued           18,580,374,278    end=2026-03-31  filed=2026-05-20

The dei concept reports 1.86B. Theus-gaap concepts report 18.58B — exactly 10× more. The two values are not contradictory; they describe different things. For foreign ADR issuers, the dei cover-page concept is conventionally tagged with the post-deposit ADS-equivalent share count, while us-gaap:CommonStockSharesOutstanding reports the true ordinary share count.

The original picker logic used a strict > comparison on (end, filed). When the tuples were equal — which is exactly the BABA case — the first concept iterated won the tie. Iteration order put dei first. The picker returned 1.86B. Multiplied by the ADR ratio arithmetic, divided by the ADR ratio, multiplied by the price — out came $29B. Wrong by 10×.

▸ The Fix

On ties of (end, filed), prefer us-gaap:CommonStockSharesOutstanding over dei:EntityCommonStockSharesOutstanding. Outstanding also beats Issued (Issued includes treasury). Explicit concept rank instead of iteration order:

_CONCEPT_RANK = {
    ("us-gaap", "CommonStockSharesOutstanding"): 0,
    ("dei",     "EntityCommonStockSharesOutstanding"): 1,
    ("us-gaap", "CommonStockSharesIssued"): 2,
}

# In _pick_latest_shares, the comparison key becomes:
cand = (end, filed, -rank, val_f)
if best is None or cand > best:
    best = cand

Four lines of substance. For domestic filers, all three concepts usually report the same value, so this is a no-op. For foreign ADR filers (BABA, JD, BIDU, PDD, NIO …) it's the difference between a correct market cap and a 10× understatement.

▸ Verification

$ curl /sec/market-cap/BABA
{"ticker":"BABA","value":289621584058,"shares":18580374278,"adrRatio":8.0}

$ curl /sec/market-cap/TSM   # regression check — known ADR
{"ticker":"TSM","value":2220653939782,"shares":25932524521,"adrRatio":5.0}

$ curl /sec/market-cap/AAPL  # regression check — domestic
{"ticker":"AAPL","value":4603972048540,"shares":14687356000,"adrRatio":null}

BABA reads $289.62B. TSM stays $2.22T. AAPL stays $4.60T. No domestic regressions. The fix lands in commit bced856.

▸ The Lesson

Iteration order is a load-bearing decision. When two data sources disagree by an order of magnitude and both are tagged as authoritative by the same regulator, the question is not which is right — both are right, for different purposes. The question is which one your code believes first. The answer cannot be implicit. It has to be explicit, named, and justified in comments next to the rank table.

See also: Rule 26 of the 33— “SEC concept tie-breakers must rank us-gaap Outstanding over dei.”