# Amihud Illiquidity Ratio

`D11-F02-A05` · Market Microstructure → Liquidity and Spreads · archetype `record-transform` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/amihud-illiquidity-ratio/
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 { amihudIlliquidity } from "fintech-algorithms/market-microstructure/liquidity-and-spreads/amihud-illiquidity-ratio";
```

## Signature

```ts
amihudIlliquidity(closes, dollarVolumes, scale)
```

Average absolute return per unit of dollar volume — how much price moves per dollar traded. The most widely used low-frequency illiquidity proxy precisely because it needs only daily data.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `closes` | `number[]` | yes | Daily closing prices. |
| `dollarVolumes` | `number[]` | yes | Daily traded value, aligned index-for-index with the closes. |
| `scale` | `number` | yes | Scaling applied to the raw ratio. The unscaled value is tiny, so published figures are almost always scaled — and papers differ on by how much. · min: 0 |

## Returns

`{ ratio, daily_ratios, observations, scale }`

The averaged ratio with the daily series and the scale applied, since a figure quoted without its scale is not comparable.

## Errors

- When a dollar volume is zero, making the daily ratio undefined — excluded from the average and reported

## Complexity

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

## Worked example

Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

### Input

`closes`:

```json
[100, 101, 100.5, 102, 101.5, 103]
```

`dollarVolumes`:

```json
[1000000, 1200000, 900000, 1500000, 1100000, 1400000]
```

`scale`:

```json
1000000
```

### Call

```ts
amihudIlliquidity(closes, dollarVolumes, scale)
```

### Returns

object with 9 fields: model, observation_count, return_count, returns, daily_illiquidity, illiquidity_per_currency_unit, scale, illiquidity_per_scaled_volume, …

```json
{
  "model": "amihud-illiquidity",
  "observation_count": 6,
  "return_count": 5,
  "returns": [
    0.010000000000000009,
    -0.004950495049504955,
    0.014925373134328401,
    -0.004901960784313708,
    0.014778325123152802
  ],
  "daily_illiquidity": [
    8.33333333333334e-9,
    5.500550055005505e-9,
    9.950248756218935e-9,
    4.4563279857397345e-9,
    1.0555946516537716e-8
  ],
  "illiquidity_per_currency_unit": 7.759281329367046e-9,
  "scale": 1000000,
  "illiquidity_per_scaled_volume": 0.0077592813293670465,
  "state": "estimated"
}
```

## Other exports

`quotedSpread`, `effectiveSpread`, `realizedSpread`, `rollSpread`, `corwinSchultzSpread`, `calculate`. Every module additionally exports `run` as an alias of its primary
function, and a `meta` object carrying its catalog id, domain, family, shape and article URL.

## Verification and provenance

Tier: **verified** (via D).

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/market-microstructure/liquidity-and-spreads/amihud-illiquidity-ratio/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/market-microstructure/liquidity-and-spreads/amihud-illiquidity-ratio/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/market-microstructure/llms.txt
