# Liquidity Screen

`D03-F06-A02` · Index and Benchmark Engineering → Governance and Maintenance · archetype `record-transform` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/index-and-benchmark-engineering/governance-and-maintenance/liquidity-screen/
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/governance-and-maintenance/liquidity-screen";
```

## Signature

```ts
calculate(data)
```

Requires sustained tradability, not a single good month. Median turnover over a minimum number of months is the standard test, and the median is deliberate: a mean is dominated by one spike of activity.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ records: Record[]; minimumMedianTurnover: number; minimumMonths: number }` | yes | `minimumMonths` is the sustained-history requirement, which is what stops a newly listed name qualifying on a burst of IPO volume. |

## Returns

`{ results, passingIds, threshold }`

Per-candidate results with the realised median and the threshold applied.

## Errors

- When minimumMonths is less than 1 — throws

## Complexity

Time `O(n × months)`, 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
{
  "records": [
    {
      "id": "A",
      "monthlyTurnover": [0.18, 0.21, 0.2, 0.17, 0.23, 0.19]
    },
    {
      "id": "B",
      "monthlyTurnover": [0.04, 0.06, 0.05, 0.03, 0.05, 0.04]
    },
    {
      "id": "C",
      "monthlyTurnover": [0.12, 0.11, 0.14, 0.1, 0.13, 0.12]
    }
  ],
  "minimumMedianTurnover": 0.08,
  "minimumMonths": 6
}
```

### Call

```ts
calculate(data)
```

### Returns

object with 3 fields: results, passingIds, threshold

```json
{
  "results": [
    {
      "id": "A",
      "medianTurnover": 0.195,
      "passes": true
    },
    {
      "id": "B",
      "medianTurnover": 0.045,
      "passes": false
    },
    {
      "id": "C",
      "medianTurnover": 0.12,
      "passes": true
    }
  ],
  "passingIds": ["A", "C", "D"],
  "threshold": 0.08
}
```

## 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/governance-and-maintenance/liquidity-screen/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/index-and-benchmark-engineering/governance-and-maintenance/liquidity-screen/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
