# Backward Split Adjustment

`D02-F01-A01` · Corporate Actions and Security Master Data → Adjustment Factors · archetype `record-transform` · difficulty 2/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/corporate-actions-and-security-master-data/adjustment-factors/backward-split-adjustment/
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/corporate-actions-and-security-master-data/adjustment-factors/backward-split-adjustment";
```

## Signature

```ts
calculate(input)
```

Restates prices before a split onto the post-split basis so the series is continuous across the event. Without it a 2-for-1 split reads as a 50% crash, and every indicator and return computed over it is wrong.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | `{ prices: number[]; volumes: number[]; eventIndex: number; postSplitSharesPerPreSplitShare: number }` | yes | `prices` and `volumes` are the raw series; `eventIndex` is the first observation trading on the new basis. `postSplitSharesPerPreSplitShare` states the ratio in the only direction that is unambiguous — 2 means each old share became two, so pre-event prices are divided by 2 and volumes multiplied by it. |

## Returns

`{ adjustedPrices, adjustedVolumes, eventIndex, ratioConvention }`

The adjusted series plus the ratio convention that was applied, echoed back — because the single most common error in this calculation is inverting the ratio, and a result that states its own convention can be checked.

## Errors

- When the ratio is not positive — throws
- When eventIndex falls outside the series — throws

## Complexity

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

## Worked example

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

### Input

`input`:

```json
{
  "prices": [120, 123, 60, 62],
  "volumes": [1000, 1200, 2400, 2000],
  "eventIndex": 2,
  "postSplitSharesPerPreSplitShare": 2
}
```

### Call

```ts
calculate(input)
```

### Returns

object with 4 fields: adjustedPrices, adjustedVolumes, eventIndex, ratioConvention

```json
{
  "adjustedPrices": [60, 61.5, 60, 62],
  "adjustedVolumes": [2000, 2400, 2400, 2000],
  "eventIndex": 2,
  "ratioConvention": "post_split_shares_per_pre_split_share"
}
```

## 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/adjustment-factors/backward-split-adjustment/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/corporate-actions-and-security-master-data/adjustment-factors/backward-split-adjustment/impl.ts
- Standalone repository: https://github.com/IslamBaraka90/Fintech-Backward-Split-Adjustment-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
