# Adaptive VWAP Execution

`D13-F01-A03` · Execution and Transaction Cost Analysis → Schedule-Based Execution · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/execution-and-transaction-cost-analysis/schedule-based-execution/adaptive-vwap-execution/
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 { adaptiveVwapExecution } from "fintech-algorithms/execution-and-transaction-cost-analysis/schedule-based-execution/adaptive-vwap-execution";
```

## Signature

```ts
adaptiveVwapExecution(total_quantity, realized_market_volumes, remaining_forecast_volumes, executed_quantity, lot_size, forecast_version)
```

Re-plans the remaining schedule from realised volume so far plus a forecast of what is left. Catches up when the market is busier than expected, and slows when it is not.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `total_quantity` | `number` | yes | Total quantity. · min: 1, integer: true |
| `realized_market_volumes` | `number[]` | yes | Volume actually observed in elapsed buckets. |
| `remaining_forecast_volumes` | `number[]` | yes | Forecast volume for the remaining buckets. |
| `executed_quantity` | `number` | yes | Quantity already executed. · min: 0, integer: true |
| `lot_size` | `number` | yes | Lot size. · min: 1, integer: true |
| `forecast_version` | `string` | yes | Which forecast produced the remaining profile, recorded for attribution. |

## Returns

`{ schedule, catch_up_quantity, participation, forecast_version, … }`

The revised schedule with the catch-up implied by the shortfall so far.

## Errors

- When executed_quantity exceeds total_quantity — throws

## Complexity

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

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

`total_quantity`:

```json
24000
```

`realized_market_volumes`:

```json
[2600, 2100, 1800, 1600, 1450, 1300]
```

Showing 6 of 8 elements.

`remaining_forecast_volumes`:

```json
[950, 900, 900, 950, 1000, 1050]
```

Showing 6 of 16 elements.

`executed_quantity`:

```json
5200
```

`lot_size`:

```json
100
```

`forecast_version`:

```json
"SYN-LIVE-2026-07-30T14:00Z"
```

### Call

```ts
adaptiveVwapExecution(total_quantity, realized_market_volumes, remaining_forecast_volumes, executed_quantity, lot_size, forecast_version)
```

### Returns

object with 14 fields: forecast_version, total_quantity, executed_quantity, remaining_quantity_before_schedule, realized_market_volume, remaining_forecast_market_volume, projected_market_volume, target_completed_quantity, …

```json
{
  "forecast_version": "SYN-LIVE-2026-07-30T14:00Z",
  "total_quantity": 24000,
  "executed_quantity": 5200,
  "remaining_quantity_before_schedule": 18800,
  "realized_market_volume": 13250,
  "remaining_forecast_market_volume": 26050,
  "projected_market_volume": 39300,
  "target_completed_quantity": 8000,
  "pacing_error_quantity": -2800,
  "pacing_state": "behind",
  "immediate_catch_up_quantity": 2800,
  "scheduled_future_quantity": 18800,
  "schedule": [
    {
      "future_bucket": 1,
      "forecast_market_volume": 950,
      "target_quantity": 3400,
      "target_cumulative_quantity": 8600,
      "includes_catch_up_quantity": 2800
    },
    {
      "future_bucket": 2,
      "forecast_market_volume": 900,
      "target_quantity": 600,
      "target_cumulative_quantity": 9200,
      "includes_catch_up_quantity": 0
    },
    {
      "future_bucket": 3,
      "forecast_market_volume": 900,
      "target_quantity": 600,
      "target_cumulative_quantity": 9800,
      "includes_catch_up_quantity": 0
    }
  ],
  "state": "adaptive-schedule"
}
```

## Other exports

`twapExecution`, `historicalVwapExecution`, `percentageOfVolumeExecution`, `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/execution-and-transaction-cost-analysis/schedule-based-execution/adaptive-vwap-execution/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/execution-and-transaction-cost-analysis/schedule-based-execution/adaptive-vwap-execution/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/execution-and-transaction-cost-analysis/llms.txt
