Skip to content
All posts
Use case 6 min

Master data as code

DataAstra

An asset manager holds bonds from Juniper Continental Corporation and from Ironvale Continental Incorporated. The portfolio system lists them as two issuers. The fund's concentration limit is set per issuer group, and Juniper is a subsidiary of Ironvale. Counted by issuer, the fund is inside its limit. Counted by group, it is not.

That question, "how much do we really hold in one group?", is a master data question. It needs to know that two records are the same company, or that one company belongs to another. In most estates that knowledge lives in a separate master data product, maintained by a separate team, with its own copy of the parties and its own idea of when they last changed.

On DataAstra it is a block in the pipeline file.

The spine

The example comes from Aldgate, a sample asset manager we built to prove the platform. The firm knows a counterparty three ways: as a client in its CRM, as an issuer on an instrument, and as a registration in the global LEI register (GLEIF). The three do not agree. Some clients carry no LEI, some carry one that has lapsed, and names differ by punctuation and legal suffix.

The party master is a pipeline. Its matching is a spine block, quoted here from the sample organisation's repository, with the market data vendor's name made generic:

spine party_spine {
  input party_candidate
  identity [lei, client_id]
  match deterministic on [lei]
  match deterministic on [registered_name, jurisdiction]
  priority [GLEIF, CRM, MARKET_DATA]
  rules {
    registered_name : longest
    jurisdiction    : highest_priority
    client_type     : most_frequent
  }
  on_failure warn
}

Read it top to bottom. A party is identified by its LEI or its client id. Records match on the LEI where there is one, and fall back to legal name and jurisdiction together where there is not. When sources disagree, GLEIF wins over the CRM, and the CRM over the market data vendor, with a rule per column: the longest registered name, the highest-priority jurisdiction, the most frequent client type.

The last line is a business decision written as code. A party that cannot be resolved is kept and flagged, not set aside: a client the firm cannot match is a compliance question, not a row to drop.

That fallback is the whole reason a party master is not a join. A client with no LEI is still the same legal entity as the issuer the portfolio is exposed to. A join on LEI alone would treat them as two.

Ultimate parents, resolved once

The same pipeline resolves every LEI'd party to its ultimate parent: GLEIF's ultimate-parent relationship where the register records one, otherwise the top of the direct-parent chain. It is resolved here, once, and stored on the golden record. Every position downstream reads the parent from the master instead of walking the register again, so every report agrees on who owns whom.

A quality block in the same file checks the hierarchy: a child is never its own parent.

Tested like the rest

Because the master is a pipeline, it has tests like any other pipeline. The party master's test file gives the transform real rows from the register and the CRM, including a lapsed LEI and Juniper with its two relationship rows to Ironvale, and states exactly the rows it expects back: Juniper's ultimate parent is Ironvale, and an entity the register records no parent for is its own.

The test passes, the pipeline compiles against the real catalog, and its run succeeds. On the sample organisation, every issuer LEI the funds hold is a row of the golden party master, with none missing.

The master id is minted once and kept across runs. A steward's merge folds one identity into another by closing links, never deleting them, so the history of what each source record pointed to, and when, is kept.

Exposure counted once per group

With parents on the master, the exposure model counts positions against the group, one row per position, and the issuer limit is checked against the parent.

On the sample organisation one group, Ironvale, comes out over the limit: its headroom is negative. The limit is checked against the group, because that is how the firm set it, and the group is what the master knows.

We traced the whole chain from that report down to source in from a question to a governed answer.

Why as code

Master data has always been the most important table nobody can review. Match rules sit in a vendor's screen, survivorship in a configuration nobody versions, and the hierarchy in a spreadsheet. As code, the rules are a diff in a pull request, the test says what they must do, the compiler checks them against the catalog, and lineage runs through the golden record like any other table.

Read the demo script, see the platform, or see the use cases.