Revelio–Compustat company mapping¶
This crosswalk connects Revelio firms (rcid) to Compustat firms (gvkey).
flowchart LR
revelio[(Revelio company reference)]
comp[(Processed annual Compustat)]
crsp[(CRSP Stocknames + CCM)]
wcik[(WRDS historical CIK--GVKEY links)]
match[Validate supplied GVKEYs<br/>then match historical CIK or dated CUSIP]
mapping[(Revelio-Compustat mapping)]
revelio --> match
comp --> match
crsp --> match
wcik --> match
match --> mapping
classDef source fill:#e8eef7,stroke:#52739e
classDef process fill:#fff0cc,stroke:#a66b00
classDef data fill:#e2f2e7,stroke:#3b7a4b
class revelio,comp,crsp,wcik source
class match process
class mapping data
Inputs
| Dataset | Location |
|---|---|
| Revelio company reference | /data/revelio/revelio_individual_company_ref.parquet |
| Processed annual Compustat | /data/full/processed/compustat_annual.parquet |
| Project-raw historical CIK--GVKEY links | /data/full/raw/wciklink_gvkey.parquet |
| Project-raw CRSP security history | /data/full/raw/crsp_stocknames.parquet |
| Project-raw CCM links | /data/full/raw/ccm_linktable.parquet |
Build
| Component | Location |
|---|---|
| Builder | shared/data/build_mapping_rcid_gvkey.py |
| Runtime | hct-tower-model-cuda-… (CPU execution) |
| Entry point | python -m shared.data.build_mapping_rcid_gvkey --config shared/config/config_full.yaml |
Output
| Dataset | File / location | Grain | Key and variables |
|---|---|---|---|
| Audited Revelio--Compustat mapping | mapping_rcid_gvkey.parquet in /data/full/processed/ |
One selected Compustat link per retained Revelio firm | Key: rcidVariables include gvkey, mapping_quality, match provenance, conflict flags, and one-to-one preference fields |
The builder retains Revelio-provided GVKEYs only when they occur in the processed Compustat universe. It then recovers exact CIK matches from the WRDS historical CIK--GVKEY table only when all eligible historical evidence identifies one GVKEY. CIKs with several historical GVKEYs remain auditable but cannot silently select one. Only for the remaining firms, the builder follows the Revelio CUSIP through CRSP Stocknames V2 and standard CCM links. Tickers and fuzzy names are not used.
The output has four quality tiers:
| Quality | match_method |
Rule |
|---|---|---|
| 1 | revelio_gvkey |
Revelio-supplied GVKEY exists in Compustat; conflicting CIK or CUSIP evidence is flagged, not silently replaced. |
| 2 | historical_cik_unique |
Exact CIK's eligible WRDS historical evidence identifies one Compustat GVKEY and belongs to one eligible Revelio RCID. A conflicting CUSIP--CCM link is flagged. |
| 3 | historical_cik_shared |
Exact CIK's eligible WRDS historical evidence identifies one Compustat GVKEY but is shared by several Revelio RCIDs. Preference fields identify an unambiguous representative only when parent-root and CUSIP signals agree. |
| 4 | cusip_ccm |
No earlier match; the CUSIP chain produces exactly one GVKEY with one continuous valid CRSP--CCM interval. |
| Column | Meaning |
|---|---|
rcid |
Revelio firm identifier |
gvkey |
Compustat firm identifier, stored without zero padding |
mapping_quality / match_method |
The quality tier and selected evidence path |
has_cik_conflict / has_cusip_ccm_conflict |
Evidence identifies a different GVKEY; the selected quality-tier link remains visible for audit |
cik_evidence_sources / cik_evidence_descriptions |
WRDS sources and link labels supporting the historical CIK candidates |
cik_evidence_start / cik_evidence_end |
Earliest and latest link dates across the historical CIK evidence retained for audit |
cusip_ccm_link_start / cusip_ccm_link_end |
Continuous valid interval for quality-4 CUSIP--CCM links |
is_preferred_rcid_within_shared_cik |
Quality-3 preference within a shared-CIK group |
is_preferred_rcid_for_gvkey |
Conservative strict one-to-one subset across all qualities |
Important limitations:
- several
rcidvalues can map to onegvkey; useis_preferred_rcid_for_gvkeyonly when a conservative one-to-one view is required; - Revelio's CIK and CUSIP values are current snapshots, rather than dated identifier histories;
- RCIDs with a Revelio GVKEY absent from the delivered Compustat universe are excluded rather than rematched;
- CUSIP links with multiple GVKEYs or discontinuous valid intervals are excluded from quality 4.
When aggregating to gvkey, downstream code must explicitly handle multiple
Revelio firms per Compustat firm. CRSP PERMNOs are resolved at the relevant
reporting date through the dated CCM link table; no static RCID--GVKEY--PERMNO
mapping is produced.