Skip to content

Choose primary listings better for companies abroad and on small venues - #243

Merged
JerBouma merged 1 commit into
mainfrom
feature/primary-listing-ranking
Oct 12, 2026
Merged

JerBouma merged 1 commit into
mainfrom
feature/primary-listing-ranking

Conversation

@JerBouma

Copy link
Copy Markdown
Owner

One change to how only_primary_listing chooses a company's primary listing. It fixes the cases the Website session and the probes found:

  • Avon resolved to its Aquis line instead of AVON.L.
  • FACC resolved to Prague instead of Vienna.
  • STMicroelectronics resolved to NYSE instead of Paris.

Rules

  • A country without a main venue gets a home venue.
    • That's the venue holding most of its listings, if they're at least 20 and at least 5% of the venue, e.g. Vienna for Austria, Mexico City, Buenos Aires.
    • It counts as main only for that country's own companies, so Buenos Aires' CEDEARs don't become primaries.
  • Own venues first. A home line on its country's own venue (the venue it leads, or its home venue) outranks a home-currency line on a venue another country leads: Vienna over Prague. Home currencies also come from those own venues.
  • At home, ISIN lines win. A line without an ISIN gives way to a line with exactly the same name that has one: Avon's Aquis line to AVON.L.
  • Abroad, the ISIN country's currency on a selective venue wins. A line in the currency of the company's ISIN country, on a venue with few foreign listings, beats the rest: STMicroelectronics on Paris, Stellantis on Paris, argenx on Brussels. Euro lines on Xetra or Hamburg, full of foreign lines, don't count, so Accenture, Medtronic, CRH, Linde and NXP stay on NYSE/Nasdaq.
  • Two existing bugs fixed:
    • Share classes (preferreds) no longer set the bar for a company's other lines.
    • A known country is no longer replaced by the country of a namesake. Frontline had no primary because it took India from Frontline Corporation.

Effect on the data

  • 865 primary flags change.
  • Improvements:
    • Mexican and Argentine companies now resolve to their home exchange instead of their NYSE depositary receipts (América Móvil, FEMSA, CEMEX, YPF, Banorte).
    • Austrian companies resolve to Vienna (Erste, OMV, Raiffeisen).
    • Companies listed on both of India's exchanges now get one primary, on BSE.
    • Old secondary lines drop out.
  • Checks:
    • A set of 40 companies with a known primary, including every case earlier attempts broke: 38 exact (was 33). The other two still return a second primary as before: Glencore with its LSE international line, Air T with its preferred.
    • Every company keeps at least one primary. The only ISINs without one are depositary receipts whose company is now primary at home.
    • Ranking time is unchanged (about 4 s) and memory grows by about 27MB.
  • Data fixes: Frontline plc is in Cyprus on every line, and Danone's Milan line is French.

Four new unit tests cover the rules. Checks: full test suite (407 passed), identifier gate, black and ruff.

- A country that leads no main venue gets the venue holding most of its listings
  as its home venue, for its own companies only (Vienna for Austria, Mexico City,
  Buenos Aires): FACC.VI instead of Prague, America Movil's AMXB.MX instead of its ADR.
- A home line on its country's own venue outranks one on a venue another country
  leads, and home currencies also come from those own venues.
- At home, a line without an ISIN gives way to a line of the same name with one
  (Avon's Aquis line to AVON.L).
- Abroad, a line in the currency of the company's ISIN country on a selective venue
  (few foreign listings) beats the rest: STMicroelectronics in Paris, argenx in
  Brussels; euro lines on Xetra don't count, so Accenture stays on NYSE.
- Share classes don't set the bar for a company's other lines, and a known country
  is no longer replaced by a namesake's (Frontline).
- Data: Frontline plc is in Cyprus on every line; Danone's Milan line is French.
@JerBouma
JerBouma merged commit be902c1 into main Oct 12, 2026
4 checks passed
@JerBouma
JerBouma deleted the feature/primary-listing-ranking branch October 12, 2026 19:38
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