# Merger Predecessor/Successor Mapping

> Preserve Identity and Entitlements Without Inventing Continuity

`D02-F03-A04` · Corporate Actions and Security Master Data → Identity Continuity · archetype `row-classify` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/corporate-actions-and-security-master-data/identity-continuity/merger-predecessor-successor-mapping/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## Install and import

```bash
npm install fintech-algorithms
```

```ts
import { resolveMerger } from "fintech-algorithms/corporate-actions-and-security-master-data/identity-continuity/merger-predecessor-successor-mapping";
```

## Signature

```ts
resolveMerger(payload)
```

Maps a position in a predecessor company onto what it became: successor shares, cash, or a mix. Getting the entitlement wrong is not a rounding error — it changes the return of the position outright.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `payload` | `{ asOf: string; position: Position; eventVersions: EventVersion[] }` | yes | `eventVersions` is a revision history because merger terms are frequently amended before completion. Point-in-time by construction: `asOf` is the knowledge time, and only revisions available at or before it are eligible. Passing the event date instead of the knowledge date is what lets a backtest use information it could not have had. |

## Returns

`{ state, eventId, selectedRevision, effectiveAt, predecessor, allocations, successorPositions, cashByCurrency, … }`

The resulting positions and cash by currency, with the allocation that produced them and which revision was in force — so a disputed entitlement can be reconstructed.

## Errors

- When no event version is effective at asOf — reported as a state rather than thrown

## Complexity

Time `O(versions)`, space `O(successors)`.

## Worked example

This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.

### Input

`payload`:

```json
{
  "asOf": "2026-07-02T12:00:00Z",
  "position": {
    "predecessorQuantity": "101",
    "electedOptionId": "stock-election",
    "appraisalQuantity": "0"
  },
  "eventVersions": [
    {
      "eventId": "SYNTH-MERGER-001",
      "revision": 1,
      "status": "confirmed",
      "availableAt": "2026-05-01T12:00:00Z",
      "announcedAt": "2026-04-15T12:00:00Z",
      "closingAt": "2026-06-30T20:00:00Z",
      "effectiveAt": "2026-06-30T20:00:00Z",
      "delistingAt": "2026-07-01T13:30:00Z",
      "sourceIds": ["SYNTH-DEFINITIVE-AGREEMENT-R1", "SYNTH-CLOSING-NOTICE"],
      "predecessor": {
        "issuerId": "ISSUER-TARGET",
        "instrumentId": "INSTR-TARGET-COMMON",
        "shareClassId": "CLASS-TARGET-A",
        "listingId": "LIST-TARGET-XNAS",
        "identifiers": [
          {
            "scheme": "PACKAGE_SECURITY_KEY",
            "value": "SYNTH-TARGET-A",
            "sourceId": "SYNTH-SECURITY-MASTER"
          }
        ]
      },
      "options": [
        {
          "optionId": "stock-election",
          "stockLegs": [
            {
              "legId": "STOCK-LEG-1",
              "ratioPerAllocatedPredecessorShare": "0.6",
              "sourceId": "SYNTH-DEFINITIVE-AGREEMENT-R1",
              "successor": {
                "issuerId": "ISSUER-SUCCESSOR",
                "instrumentId": "INSTR-SUCCESSOR-COMMON",
                "shareClassId": "CLASS-SUCCESSOR-A",
                "listingId": "LIST-SUCCESSOR-XNYS",
                "identifiers": [
                  {
                    "scheme": "PACKAGE_SECURITY_KEY",
                    "value": "SYNTH-SUCCESSOR-A",
                    "sourceId": "SYNTH-SECURITY-MASTER"
                  }
                ]
              },
              "fractionalPolicy": {
                "mode": "cash_in_lieu",
                "lotSize": "1",
                "pricePerShare": "40",
                "currency": "USD",
                "observedAt": "2026-06-30T20:00:00Z",
                "availableAt": "2026-06-30T20:01:00Z",
                "sourceId": "SYNTH-CIL-PRICE"
              }
            }
          ],
          "cashLegs": [
            {
              "legId": "CASH-1",
              "kind": "consideration",
              "amountPerAllocatedPredecessorShare": "5",
              "currency": "USD",
              "sourceId": "SYNTH-DEFINITIVE-AGREEMENT-R1"
            },
            {
              "legId": "TAX-1",
              "kind": "withholding",
              "amountPerAllocatedPredecessorShare": "0.2",
              "currency": "USD",
              "sourceId": "SYNTH-TAX-INSTRUCTION"
            },
            {
              "legId": "FEE-1",
              "kind": "fee",
              "amountPerAllocatedPredecessorShare": "0.05",
              "currency": "USD",
              "sourceId": "SYNTH-AGENT-INSTRUCTION"
            }
          ]
        },
        {
          "optionId": "cash-election",
          "stockLegs": [],
          "cashLegs": [
            {
              "legId": "CASH-2",
              "kind": "consideration",
              "amountPerAllocatedPredecessorShare": "35",
              "currency": "USD",
              "sourceId": "SYNTH-DEFINITIVE-AGREEMENT-R1"
            },
            {
              "legId": "FEE-2",
              "kind": "fee",
              "amountPerAllocatedPredecessorShare": "0.05",
              "currency": "USD",
              "sourceId": "SYNTH-AGENT-INSTRUCTION"
            }
          ]
        }
      ],
      "electionRules": {
        "fallbackOptionId": "cash-election",
        "fulfilledFractions": {
          "stock-election": "0.75",
          "cash-election": "1"
        }
      },
      "termsSupported": true
    }
  ]
}
```

### Call

```ts
resolveMerger(payload)
```

### Returns

object with 13 fields: state, eventId, selectedRevision, effectiveAt, predecessor, allocations, successorPositions, cashByCurrency, …

```json
{
  "state": "mapped",
  "eventId": "SYNTH-MERGER-001",
  "selectedRevision": 1,
  "effectiveAt": "2026-06-30T20:00:00Z",
  "predecessor": {
    "issuerId": "ISSUER-TARGET",
    "instrumentId": "INSTR-TARGET-COMMON",
    "shareClassId": "CLASS-TARGET-A",
    "listingId": "LIST-TARGET-XNAS",
    "identifiers": [
      {
        "scheme": "PACKAGE_SECURITY_KEY",
        "value": "SYNTH-TARGET-A",
        "sourceId": "SYNTH-SECURITY-MASTER"
      }
    ]
  },
  "allocations": [
    {
      "optionId": "stock-election",
      "role": "elected",
      "fulfilledFraction": "0.750000",
      "allocatedPredecessorQuantity": "75.750000"
    },
    {
      "optionId": "cash-election",
      "role": "fallback",
      "fulfilledFraction": "0.250000",
      "allocatedPredecessorQuantity": "25.250000"
    }
  ],
  "successorPositions": [
    {
      "issuerId": "ISSUER-SUCCESSOR",
      "instrumentId": "INSTR-SUCCESSOR-COMMON",
      "shareClassId": "CLASS-SUCCESSOR-A",
      "listingId": "LIST-SUCCESSOR-XNYS",
      "quantity": "45.000000"
    }
  ],
  "cashByCurrency": [
    {
      "currency": "USD",
      "consideration": "1262.500000",
      "appraisal": "0.000000",
      "withholding": "15.150000",
      "fees": "5.050000",
      "cashInLieu": "18.000000",
      "net": "1260.300000"
    }
  ],
  "fractionalSettlements": [
    {
      "stockLegId": "STOCK-LEG-1",
      "grossQuantity": "45.450000",
      "deliverableQuantity": "45.000000",
      "fractionalQuantity": "0.450000",
      "cashInLieu": "18.000000",
      "currency": "USD",
      "sourceId": "SYNTH-CIL-PRICE"
    }
  ],
  "identityEdges": [
    {
      "relation": "predecessor_instrument_to_successor_instrument",
      "fromInstrumentId": "INSTR-TARGET-COMMON",
      "toInstrumentId": "INSTR-SUCCESSOR-COMMON",
      "effectiveAt": "2026-06-30T20:00:00Z",
      "sourceId": "SYNTH-DEFINITIVE-AGREEMENT-R1"
    }
  ],
  "listingState": {
    "predecessor": "inactive",
    "successors": "not_established"
  },
  "priceAdjustment": {
    "state": "not_computed",
    "reason": "Identity and entitlement mapping does not create a historical price-adjustment series."
  },
  "diagnostics": {
    "asOf": "2026-07-02T12:00:00Z",
    "selectedVersionAvailableAt": "2026-05-01T12:00:00Z",
    "sourceIds": [
      "SYNTH-AGENT-INSTRUCTION",
      "SYNTH-CIL-PRICE",
      "SYNTH-CLOSING-NOTICE",
      "SYNTH-DEFINITIVE-AGREEMENT-R1",
      "SYNTH-SECURITY-MASTER",
      "SYNTH-TAX-INSTRUCTION"
    ]
  }
}
```

## Verification and provenance

Tier: **verified** (via input-expected).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.1.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/corporate-actions-and-security-master-data/identity-continuity/merger-predecessor-successor-mapping/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/corporate-actions-and-security-master-data/identity-continuity/merger-predecessor-successor-mapping/impl.ts
- Standalone repository: https://github.com/IslamBaraka90/Fintech-Merger-Predecessor-Successor-Mapping-Corporate-Actions-algorithm
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/corporate-actions-and-security-master-data/llms.txt
