# Percentage-Decrement Index

`D03-F05-A05` · Index and Benchmark Engineering → Strategy Indices · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/index-and-benchmark-engineering/strategy-indices/percentage-decrement-index/
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/strategy-indices/percentage-decrement-index";
```

## Signature

```ts
calculate(data)
```

The same idea as a fixed decrement, but proportional to the level. The two diverge as the index moves: a points decrement bites harder when the level is low, a percentage one scales with it.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ underlyingLevels: number[]; annualDecrementRate: number; dayCount: number; baseLevel: number }` | yes | `annualDecrementRate` is a fraction per year, pro-rated by `dayCount`. `baseLevel` is the index value at the start of the series; it scales the level but never the returns. |

## Returns

`{ dailyDeductions, levels, endingLevel }`

The proportional deduction per day and the level series.

## Errors

- When dayCount is not positive, or the rate is negative — 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

`data`:

```json
{
  "underlyingLevels": [100, 101, 100.5, 102, 103, 102.6],
  "annualDecrementRate": 0.05,
  "dayCount": 360,
  "baseLevel": 100
}
```

### Call

```ts
calculate(data)
```

### Returns

object with 3 fields: dailyDeductions, levels, endingLevel

```json
{
  "dailyDeductions": [0.000139, 0.000139, 0.000139, 0.000139, 0.000139, 0.000139],
  "levels": [100, 100.986111, 100.472154, 101.957784, 102.943209, 102.529132],
  "endingLevel": 103.913925
}
```

## 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/strategy-indices/percentage-decrement-index/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/index-and-benchmark-engineering/strategy-indices/percentage-decrement-index/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
