Equity Ownership Look-Through: From Corporate Registry Data to Relationship Graphs

    This article explains how to build a practical equity ownership look-through module. It covers ownership-path calculations, data modeling, time-aware recursive queries, in-memory traversal, validation rules, exception handling, system architecture, and compliance requirements for tracing ultimate shareholders and estimating indirect ownership percentages.

    1. Background

    Equity ownership look-through means tracing ownership chains layer by layer to identify the ultimate shareholders or beneficial controllers behind a company and calculate indirect ownership at each level. This capability is commonly used for due diligence, anti-money laundering checks, related-party transaction analysis, supplier onboarding, and risk profiling.

    Manually querying corporate registry information becomes inefficient and error-prone when there are many companies or deeply nested ownership structures. Programmatic look-through calculations make results reproducible and provide structured data for downstream risk rules.

    This article describes the key calculation rules, data model, recursive queries, exception handling, engineering architecture, and compliance requirements for a deployable look-through module.

    2. Core Concepts and Calculation Rules

    Look-through calculations rely on two basic rules:

    1. Multiply along a path: The indirect ownership percentage on a single ownership path equals the product of the ownership percentages along that path.
    2. Add across paths: When multiple paths lead to the same ultimate shareholder, the shareholder’s indirect ownership percentage is the sum of the results from all paths.

    For example, Person A owns 60% of Company A, Company A owns 50% of Company B, and Company B owns 40% of Company C. Person A also directly owns 10% of Company B.

    Person A’s ownership of Company C is calculated through two paths:

    • Path 1: A → Company A → Company B → Company C
      0.6 × 0.5 × 0.4 = 0.12
    • Path 2: A → Company B → Company C
      0.1 × 0.4 = 0.04

    Therefore, Person A’s total look-through ownership of Company C is:

    0.12 + 0.04 = 16%

    Ownership percentage should not be confused with control. Determining the actual controller may also require voting arrangements, board appointment rights, acting-in-concert agreements, and other factors. The applicable business rules and regulatory requirements should determine the final control assessment.

    3. Data Model Design

    3.1 Entity Identification

    Each entity should use a unified social credit code or an equivalent unique identifier as its primary key. This prevents companies with identical names from being incorrectly merged.

    Individuals typically do not have such a code. The system should generate a stable internal identifier for each person and store identity-document information separately from look-through data.

    3.2 Table Structure

    1. CREATE TABLE entity (
    2. entity_id VARCHAR(64) PRIMARY KEY,
    3. entity_name VARCHAR(255) NOT NULL,
    4. entity_type VARCHAR(16) NOT NULL, -- COMPANY / PERSON / OTHER
    5. status VARCHAR(16) NOT NULL DEFAULT 'ACTIVE'
    6. );
    7. CREATE TABLE equity_relation (
    8. relation_id VARCHAR(64) PRIMARY KEY,
    9. investor_id VARCHAR(64) NOT NULL, -- Investor
    10. investee_id VARCHAR(64) NOT NULL, -- Investee
    11. ratio DECIMAL(9,6) NOT NULL, -- Range: (0, 1]
    12. valid_from DATE NOT NULL, -- Effective date
    13. valid_to DATE, -- Expiration date; NULL means currently valid
    14. source VARCHAR(64) NOT NULL -- Data source for traceability
    15. );
    16. CREATE INDEX idx_relation_investee ON equity_relation (investee_id);

    Store ratios as decimals between 0 and 1 rather than mixing percentages and decimal fractions. Monetary values and ratios should use fixed-point decimal types instead of floating-point types to prevent precision errors during multiplication.

    3.3 Time Dimensions

    Ownership relationships change over time, so every query should include an effective date.

    A point-in-time query evaluates the ownership structure on a historical date. A current-state query uses the current date as the parameter. All queries should verify that a relationship was valid on the requested date:

    1. valid_from <= as_of AND (valid_to IS NULL OR valid_to > as_of)

    4. Recursive Look-Through Queries

    4.1 SQL Implementation

    Look-through is fundamentally a reverse traversal of a directed graph. The following recursive query starts from the target entity, traverses upstream through its shareholders, multiplies ownership percentages, records each path, and stops cycles.

    1. WITH RECURSIVE upstream AS (
    2. -- Starting point: direct shareholders of the target entity
    3. SELECT
    4. r.investor_id AS node_id,
    5. r.ratio AS penetration,
    6. 1 AS depth,
    7. '/' || r.investee_id || '/' || r.investor_id || '/' AS path
    8. FROM equity_relation r
    9. WHERE r.investee_id = :target_id
    10. AND r.valid_from <= :as_of
    11. AND (r.valid_to IS NULL OR r.valid_to > :as_of)
    12. UNION ALL
    13. -- Recursion: continue tracing the shareholder's shareholders
    14. SELECT
    15. r.investor_id,
    16. u.penetration * r.ratio,
    17. u.depth + 1,
    18. u.path || r.investor_id || '/'
    19. FROM upstream u
    20. JOIN equity_relation r
    21. ON r.investee_id = u.node_id
    22. WHERE u.depth < :max_depth
    23. AND r.valid_from <= :as_of
    24. AND (r.valid_to IS NULL OR r.valid_to > :as_of)
    25. AND u.path NOT LIKE '%/' || r.investor_id || '/%' -- Stop cycles
    26. )
    27. SELECT
    28. u.node_id,
    29. SUM(u.penetration) AS total_penetration
    30. FROM upstream u
    31. JOIN entity e ON e.entity_id = u.node_id
    32. WHERE e.entity_type = 'PERSON'
    33. GROUP BY u.node_id;

    Several details are important:

    • Recursion has three stopping conditions: it ends naturally when no upstream shareholder exists, stops when :max_depth is reached, and terminates a branch when a repeated node is detected.
    • Delimiters at both ends of the path prevent false matches when one ID is a prefix of another. ID character sets should be restricted to safe characters such as letters and digits; otherwise, wildcard characters in a LIKE expression may cause incorrect matches.
    • All parameters must be passed as bound parameters rather than concatenated into SQL strings to prevent injection.
    • Intermediate company nodes also appear in the recursive result. The final query filters by entity_type so that only individual shareholders are returned.

    4.2 In-Memory Implementation

    For smaller graphs or application-level unit testing, the same logic can be implemented in memory:

    1. from collections import defaultdict
    2. from decimal import Decimal
    3. def penetrate(target_id, edges, max_depth=10):
    4. """
    5. edges: Iterable of (investor_id, investee_id, ratio), where ratio is Decimal.
    6. Relationships have already been filtered by effective date.
    7. Returns: {node_id: penetration_ratio} for all upstream nodes.
    8. The caller can filter by entity type.
    9. """
    10. holders_of = defaultdict(list)
    11. for investor, investee, ratio in edges:
    12. holders_of[investee].append((investor, ratio))
    13. result = defaultdict(Decimal)
    14. def dfs(node, acc, depth, visited):
    15. if depth > max_depth:
    16. return
    17. for investor, ratio in holders_of.get(node, []):
    18. if investor in visited: # Stop cycles
    19. continue
    20. value = acc * ratio # Multiply along the path
    21. result[investor] += value # Add across multiple paths
    22. dfs(investor, value, depth + 1, visited | {investor})
    23. dfs(target_id, Decimal(1), 1, frozenset({target_id}))
    24. return result
    25. # Example: Person A -> Company A (60%), Company A -> Company B (50%),
    26. # Person A -> Company B (10%), Company B -> Company C (40%)
    27. edges = [
    28. ("A", "CompanyA", Decimal("0.6")),
    29. ("CompanyA", "CompanyB", Decimal("0.5")),
    30. ("A", "CompanyB", Decimal("0.1")),
    31. ("CompanyB", "CompanyC", Decimal("0.4")),
    32. ]
    33. ratios = penetrate("CompanyC", edges)
    34. persons = {k: v for k, v in ratios.items() if k == "A"}
    35. print(persons) # {'A': Decimal('0.16')}

    The in-memory implementation should produce the same results as the SQL query. Using both implementations for cross-validation provides a foundation for regression testing.

    5. Ratio Definitions and Result Validation

    Look-through results require consistency checks before they are used for downstream decisions.

    • Sum of direct ownership: The combined ownership percentage of all direct shareholders of an entity should not exceed 100%. An excess may indicate incorrect data or duplicate records.
    • Aggregate ultimate ownership: After tracing through all ultimate individuals and other entities, the combined percentage should be close to 100%. A significant gap usually indicates undisclosed shareholders or an incomplete ownership structure. The gap should be labeled as an “untraced portion” rather than being assigned to an arbitrary entity.
    • Rounding rules: Preserve full precision during calculations and round only when producing output, such as retaining two decimal places. Rounding rules should be documented so that different systems produce consistent results.
    • Threshold decisions: Whether a percentage meets a particular threshold should be controlled by configurable business rules rather than hard-coded in application logic.

    6. Anomalous Data and Edge Cases

    Real-world data often contains inconsistencies and incomplete records. Handling strategies should be defined in advance.

    Issue Impact Handling Strategy
    Cross-shareholding creates a cycle Recursion may expand indefinitely Detect cycles, stop the affected path, and generate a cycle alert
    Missing shareholder information Look-through results are incomplete Mark the untraced portion and do not infer missing ownership
    Ownership transfer not reflected in the source data Results may be outdated Rely on incremental updates and record data collection times
    Different entities share the same name Entities may be incorrectly merged Use unique identifiers as keys and prohibit name-based joins
    Conflicting conclusions across data sources Results may be unstable Define source priorities and retain conflicts for manual review
    Ownership and voting rights are separated Control assessments may be inaccurate Store ownership percentage and control relationship as separate fields

    Cycle handling requires particular attention. Cross-shareholding exists in practice, and stopping a cycle only guarantees that the calculation terminates. It does not mean the resulting calculation is legally or commercially valid. Cycles should generate alerts for business users to review.

    7. Engineering Architecture

    A deployable look-through service typically includes the following layers:

    1. Data ingestion → Cleaning and normalization → Relationship storage
    2. → Look-through calculation service → Result cache → Query API
    3. ↓ ↑
    4. Exception queue Incremental update events

    Responsibilities include:

    • Data ingestion: Obtain corporate data through authorized or public channels. Store original files in object storage for later auditing and replay.
    • Cleaning and normalization: Standardize entity identifiers, ratio formats, and date formats. Send anomalous records to a message queue for dedicated handling.
    • Relationship storage: Use a relational database to store entities and equity relationships. Create an index on the investee field.
    • Calculation service: Execute recursive queries or in-memory traversal. Cache results for frequently queried entities and invalidate them when data changes.
    • Query API: Provide authenticated query access, record access logs, and monitor API latency and data-update latency.

    On a cloud platform such as Baidu AI Cloud, the architecture can use general-purpose capabilities including object storage, message queues, logging, and monitoring and alerting services. Specific service specifications and pricing should be verified in the official documentation.

    8. Compliance and Data Security

    Equity data may involve information about companies and individuals, so compliance should be addressed during the initial design stage.

    • Lawful data sources: Use only data obtained from public channels or with explicit authorization, and do not use it beyond the authorized purpose.
    • Data minimization: Store only fields required for the look-through calculation. Sensitive identity information, such as personal identification numbers, should be masked or excluded from the database.
    • Access control: Restrict queries by role. Sensitive results may require approval or secondary confirmation.
    • Audit trails: Record the operator, target entity, point-in-time parameter, and result summary for every query, and define a retention period.
    • Result qualification: A look-through result is a data-based calculation, not a legal determination. Reports should state the data source and collection date.

    9. Practical Recommendations

    1. Standardize entity identifiers and time definitions before implementing the calculation logic. No algorithm can produce reliable results when the underlying data standards are inconsistent.
    2. Validate the SQL and in-memory implementations against the same test cases. Deploy only after their results are consistent.
    3. Save a path snapshot for every look-through result so that the origin of a conclusion can be explained later.
    4. Make business parameters such as thresholds, rounding rules, and source priorities configurable instead of requiring code changes for every adjustment.
    5. Monitor cycles, missing data, and source conflicts continuously. Data quality should be tracked alongside calculation success.

    Equity ownership look-through may appear to be a simple recursive summation problem. In practice, the more difficult issues are data quality, time definitions, and compliance boundaries. Once these three areas are handled properly, the calculation module itself becomes much easier to maintain.