# Free-Float Market-Cap Index

`D03-F02-A03` · Index and Benchmark Engineering → Weighting and Capping · archetype `record-transform` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/index-and-benchmark-engineering/weighting-and-capping/free-float-market-cap-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/weighting-and-capping/free-float-market-cap-index";
```

## Signature

```ts
calculate(data)
```

Weight by the shares that can actually be bought. Excluding strategic, government and insider holdings is what makes an index replicable — a fund cannot buy shares that are not for sale.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ constituents: Constituent[] }` | yes | Constituents carrying price, shares outstanding and a free-float factor. |

## Returns

`{ ids, floatMarketValues, weights }`

Float-adjusted market values and the weights they imply.

## Errors

- When a float factor falls outside 0…1 — 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
{
  "constituents": [
    {
      "id": "A",
      "price": 20,
      "shares": 1000000,
      "floatFactor": 0.65,
      "fx": 1
    },
    {
      "id": "B",
      "price": 40,
      "shares": 500000,
      "floatFactor": 0.9,
      "fx": 1
    },
    {
      "id": "C",
      "price": 30,
      "shares": 800000,
      "floatFactor": 0.5,
      "fx": 1.1
    }
  ]
}
```

### Call

```ts
calculate(data)
```

### Returns

object with 3 fields: ids, floatMarketValues, weights

```json
{
  "ids": ["A", "B", "C", "D"],
  "floatMarketValues": [13000000, 18000000, 13200000, 12960000],
  "weights": [0.227432, 0.314906, 0.230931, 0.226732]
}
```

## 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/weighting-and-capping/free-float-market-cap-index/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/index-and-benchmark-engineering/weighting-and-capping/free-float-market-cap-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
