# Turnover-Constrained Optimization

`D14-F04-A01` · Portfolio Construction → Practical Constraints · archetype `record-transform` · difficulty 4/5 · verification **contract**

Full page: https://docs.thefintechbuilder.com/portfolio-construction/practical-constraints/turnover-constrained-optimization/
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 { solveTurnoverConstrainedMarkowitz } from "fintech-algorithms/portfolio-construction/practical-constraints/turnover-constrained-optimization";
```

## Signature

```ts
solveTurnoverConstrainedMarkowitz(mu, covariance, lambdaRisk, w0, tau, options)
```

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `mu` | `finite real vector, length `N`` | yes | decimal simple return for the declared period; asset order is canonical |
| `covariance` | `finite `N×N` matrix` | yes | squared-return units; symmetric PSD within scale-aware tolerance |
| `lambdaRisk` | `finite real scalar` | yes | nonnegative objective coefficient |
| `w0` | `finite real vector, length `N`` | yes | nonnegative current normalized holdings; sum must already be one within `1e-12`; no silent normalization |
| `tau` | `finite real scalar` | yes | nonnegative one-way turnover cap in normalized portfolio units |
| `options` | `TurnoverSolverOptions` | no | default: "{}" |

## 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

`mu`:

```json
[0.1, 0.04]
```

`covariance`:

```json
[
  [0.04, 0],
  [0, 0.01]
]
```

`lambdaRisk`:

```json
1
```

`w0`:

```json
[0.6, 0.4]
```

`tau`:

```json
0.1
```

### Call

```ts
solveTurnoverConstrainedMarkowitz(mu, covariance, lambdaRisk, w0, tau, options)
```

### Returns

object with 10 fields: status, weights, objective, directTurnover, inputCurrentSum, simplexResidual, minWeight, iterations, …

```json
{
  "status": "optimal",
  "weights": [0.7, 0.3],
  "objective": 0.06149999999999999,
  "directTurnover": 0.1,
  "inputCurrentSum": 1,
  "simplexResidual": 0,
  "minWeight": 0.3,
  "iterations": 2,
  "frankWolfeGap": 1.8873791418627663e-18,
  "certificate": {
    "kind": "projected-gradient-kkt-plus-frank-wolfe-gap",
    "stationarityResidual": 1.1102230246251566e-17,
    "frankWolfeGap": 1.8873791418627663e-18,
    "objectiveGapUpperBound": 1.8873791418627663e-18,
    "normalizedStationarityResidual": 1.1102230246251565e-16,
    "normalizedFrankWolfeGap": 1.8873791418627663e-17,
    "normalizedObjectiveGapUpperBound": 1.8873791418627663e-17,
    "objectiveScale": 0.1,
    "stationarityTolerance": 1e-8,
    "toleranceUnits": "normalized by objectiveScale; original-unit gap is retained above",
    "lipschitzUpperBound": 0.08,
    "stepDenominator": 0.1,
    "stepSize": 10,
    "turnoverRadius": 0.2
  }
}
```

## Verification and provenance

Tier: **contract**.

The module loads, the entry point is callable and its declared signature matches the compiled code. The example below is real captured output, but no independently published figure asserts the numbers.

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.2.
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/portfolio-construction/practical-constraints/turnover-constrained-optimization/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/portfolio-construction/practical-constraints/turnover-constrained-optimization/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/portfolio-construction/llms.txt
