# Corporate-Action Divisor Bridge

`D03-F01-A04` · Index and Benchmark Engineering → Index Initialization and Continuity · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/index-and-benchmark-engineering/index-initialization-and-continuity/corporate-action-divisor-bridge/
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 { calculate } from "fintech-algorithms/index-and-benchmark-engineering/index-initialization-and-continuity/corporate-action-divisor-bridge";
```

## Signature

```ts
calculate(data)
```

Applies a corporate action to an index by routing its non-market value change through the divisor. Connects D02's event handling to the index level: the constituent's price changes for real, the index level must not.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ preEventMarketValue: number; nonMarketValueChange: number; preEventDivisor: number; action: string }` | yes | `nonMarketValueChange` is the part of the value change that is *not* economic — the part the divisor must absorb. Splitting a change into its market and non-market components correctly is the whole difficulty. |

## Returns

`{ action, preEventLevel, postEventMarketValue, newDivisor, bridgedLevel }`

The rebased divisor and the level either side, which should match.

## Errors

- When the pre-event divisor is not positive — throws

## Complexity

Time `O(1)`, space `O(1)`.

## Worked example

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

### Input

`data`:

```json
{
  "preEventMarketValue": 100000000,
  "nonMarketValueChange": -4000000,
  "preEventDivisor": 100000,
  "action": "special dividend"
}
```

### Call

```ts
calculate(data)
```

### Returns

object with 5 fields: action, preEventLevel, postEventMarketValue, newDivisor, bridgedLevel

```json
{
  "action": "special dividend",
  "preEventLevel": 1000,
  "postEventMarketValue": 96000000,
  "newDivisor": 96000,
  "bridgedLevel": 1000
}
```

## 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/index-and-benchmark-engineering/index-initialization-and-continuity/corporate-action-divisor-bridge/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/index-and-benchmark-engineering/index-initialization-and-continuity/corporate-action-divisor-bridge/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/index-and-benchmark-engineering/llms.txt
