Corporate Equity Penetration: Modeling Methods and Ratio Calculation Practices

    This article explores the modeling methods and calculation practices for corporate equity penetration. It covers the problem background, data modeling approaches, core calculation rules for cross-shareholding, Python implementation using DFS, engineering best practices, compliance considerations, and phased deployment strategies.

    1. Problem Background

    Equity penetration (or beneficial ownership tracing) refers to the process of tracing up the corporate equity chain to identify ultimate natural person shareholders, actual controllers, or beneficial owners. In scenarios such as due diligence, related-party transaction reviews, anti-money laundering (AML), and compliance audits, direct shareholder information is often insufficient to determine control relationships. It is necessary to restore multi-layered shareholding relationships into a calculable structure to draw accurate conclusions.

    2. Data Modeling

    The first step in penetration calculation is to establish a unified data model. Typically, enterprises and natural persons are abstracted as nodes, and shareholding relationships are abstracted as directed edges. The edge direction points from the investor to the investee, and the edge attribute is the shareholding ratio, ranging from 0 to 1.

    There are three common storage methods:

    • Relational tables: A shareholder relationship table with fields including the investee identifier, investor identifier, shareholding ratio, contribution type (subscribed or paid-in), effective date, and expiration date. Multi-layer penetration can be achieved using recursive queries.
    • Adjacency list with in-memory structures: Loading relationships into a dictionary where the key is the investee and the value is a list of (investor, ratio) tuples. Suitable for small data volumes and offline analysis.
    • Graph databases: Natively support multi-hop traversal, suitable for frequent querying of multi-layer relationships, correlation analysis, or discovering hidden connections.

    When selecting a storage method, consider data scale, update frequency, and query patterns. For small data volumes primarily requiring batch calculation, in-memory structures are sufficient. For online interactive queries of multi-layer relationships, graph storage is more appropriate.

    3. Core Rules for Penetration Calculation

    Penetration calculation relies on the following four rules.

    1. Single-path ratio multiplication. When holding shares continuously along a path, the final shareholding ratio equals the product of the edge ratios along the path. For example, if A holds 60% of B, and B holds 50% of C, then A indirectly holds 30% of C (0.6 × 0.5).

    2. Multi-path ratio addition. When the same natural person holds shares in the same target enterprise through multiple paths, the ratios obtained from each path must be accumulated. For example, if a person directly holds 10% of the target enterprise and indirectly holds 15% through two intermediate enterprises, their total shareholding is 25%.

    3. Circular shareholding handling. In actual data, cross-shareholding may occur where A holds B and B holds A. The penetration process must record nodes already visited on the current path. Once the same node is encountered again, an error should be thrown immediately, or it should be truncated according to predefined rules to prevent infinite recursion.

    4. Threshold determination. In practice, only relationships reaching a certain ratio are usually of concern. The industry commonly uses 25%, 50%, and other values as reference lines for control or beneficial ownership. The specific threshold should be based on applicable regulatory requirements or internal compliance policies and should not be arbitrarily hardcoded in the program.

    4. Code Implementation

    The following example implements penetration calculation using Depth-First Search (DFS) with built-in circular shareholding detection. The data is fictional.

    1. from collections import defaultdict
    2. def ultimate_holdings(shareholders: dict, target: str) -> dict:
    3. """
    4. Calculate the penetration shareholding ratio of each ultimate holder (nodes with no identifiable upstream) for the target enterprise.
    5. shareholders: {investee: [(investor, shareholding_ratio), ...]}, ratio ranges from 0 to 1
    6. target: The target enterprise to penetrate
    7. """
    8. result = defaultdict(float)
    9. def dfs(node: str, ratio: float, path: list) -> None:
    10. if node in path:
    11. cycle = " -> ".join(path + [node])
    12. raise ValueError(f"Circular shareholding detected: {cycle}")
    13. upstream = shareholders.get(node)
    14. if not upstream:
    15. # No identifiable upstream, considered an ultimate holder
    16. result[node] += ratio
    17. return
    18. for holder, pct in upstream:
    19. dfs(holder, ratio * pct, path + [node])
    20. dfs(target, 1.0, [])
    21. return dict(result)
    22. if __name__ == "__main__":
    23. shareholders = {
    24. "TargetCo": [("CompanyC", 0.5), ("ZhangSan", 0.3), ("LiSi", 0.2)],
    25. "CompanyC": [("WangWu", 0.6), ("ZhaoLiu", 0.4)],
    26. }
    27. print(ultimate_holdings(shareholders, "TargetCo"))
    28. # Expected output: {'WangWu': 0.3, 'ZhaoLiu': 0.2, 'ZhangSan': 0.3, 'LiSi': 0.2}

    The execution logic of the code is as follows. Starting from the target enterprise, the initial ratio is 1. For each edge traversed upward, the ratio is multiplied by the edge’s shareholding ratio. When reaching a node with no upstream records, the current ratio is accumulated into that node’s result. This way, when multiple paths point to the same person, the accumulation is completed automatically.

    If the sample data is changed to “Company C holds Target Co, and Target Co holds Company C,” the function will raise an exception containing the complete cycle path, making it easier to locate the problematic data.

    5. Engineering Implementation Essentials

    Precision control. After multi-layer multiplications of shareholding ratios, floating-point errors will gradually accumulate. For precise calculation of amounts or ratios, fixed-point or decimal types can be used. For external display, decimal places should be retained and rounded according to unified rules.

    Time validity management. Equity relationships change over time. When calculating, expired records should be filtered based on the statistical base date. Historical versions need to be retained to reproduce the penetration results at a specific point in the past.

    Data sources. The credibility of penetration results depends on the input data. Registration information from legitimate channels and internal ledgers should be prioritized, and the source and update time of each relationship should be recorded. Nodes with missing data should be explicitly marked as “penetration incomplete” and should not be treated as ultimate holders.

    Performance optimization. For large-scale relationship graphs, the results of calculated nodes can be cached. During incremental data updates, only the affected downstream nodes need to be recalculated without full recomputation.

    Depth limit. A maximum penetration depth should be set. When the limit is exceeded, mark the result as incomplete and return the identified portion to prevent recursion from going out of control due to anomalous data.

    6. Compliance and Security

    Equity data typically contains natural persons’ personal information. Development should follow the principle of minimum necessity. Query interfaces require access control and access audit logs. During page display, sensitive fields such as ID numbers and addresses should be masked. Sensitive fields should be encrypted during storage, and encryption keys should be managed by a dedicated key management service and must not be written into code or configuration files.

    7. Deployment Recommendations

    It is recommended to proceed in phases. The first phase should only target single enterprises with two to three layers of penetration to verify the correctness of ratio calculation and cycle detection. The second phase can then expand to full-graph batch calculation and online querying.

    Test cases should cover the following boundary conditions: circular shareholding, multi-path aggregation for the same person, zero-ratio relationships, nodes without upstream, and chains exceeding the maximum depth. After each code modification, regression tests should be performed using these samples to ensure the results are consistent with manual calculations.