fintech-algorithms

Percentage-of-Volume Execution

Install and import

bash
npm install fintech-algorithms
ts
import { percentageOfVolumeExecution } from "fintech-algorithms/execution-and-transaction-cost-analysis/schedule-based-execution/percentage-of-volume-execution";

Signature

percentageOfVolumeExecution(total_quantity, participation_rate_bps, market_volume_buckets, lot_size, max_child_quantity)

Trades a fixed share of whatever volume occurs. The schedule is unknown in advance by design, which limits impact — and means the order may not complete at all if volume never arrives.

Parameters

NameTypeNotes
total_quantitynumberTotal quantity.
min: 1 · integer: true
participation_rate_bpsnumberTarget participation in basis points of market volume.
min: 0
market_volume_bucketsnumber[]Observed or forecast market volume per bucket.
lot_sizenumberLot size.
min: 1 · integer: true
max_child_quantitynumberCap on any single child order, which stops a volume spike producing an outsized print.
min: 1 · integer: true

Returns

{ schedule, projected_completion, unfilled_quantity, … }

The schedule with projected completion and any quantity the volume path cannot absorb.

Errors

  • When the participation rate is not positive — throws

Complexity: time O(buckets), space O(buckets).

Worked example

executed 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
10000
participation_rate_bps
1000
market_volume_buckets
[5200, 4600, 4100, 3800, 3500, 3300]

Showing 6 of 24 elements.

lot_size
100
max_child_quantity
700

Call

percentageOfVolumeExecution(total_quantity, participation_rate_bps, market_volume_buckets, lot_size, max_child_quantity)

Returns

object with 10 fields: total_quantity, participation_rate_bps, lot_size, max_child_quantity, observed_market_volume, released_quantity, remaining_quantity, achieved_participation_bps, …

{
  "total_quantity": 10000,
  "participation_rate_bps": 1000,
  "lot_size": 100,
  "max_child_quantity": 700,
  "observed_market_volume": 120900,
  "released_quantity": 10000,
  "remaining_quantity": 0,
  "achieved_participation_bps": 827.129859,
  "schedule": [
    {
      "bucket": 1,
      "market_volume": 5200,
      "cumulative_market_volume": 5200,
      "target_cumulative_quantity": 500,
      "child_quantity": 500,
      "released_cumulative_quantity": 500,
      "remaining_quantity": 9500,
      "achieved_participation_bps": 961.538462
    },
    {
      "bucket": 2,
      "market_volume": 4600,
      "cumulative_market_volume": 9800,
      "target_cumulative_quantity": 900,
      "child_quantity": 400,
      "released_cumulative_quantity": 900,
      "remaining_quantity": 9100,
      "achieved_participation_bps": 918.367347
    },
    {
      "bucket": 3,
      "market_volume": 4100,
      "cumulative_market_volume": 13900,
      "target_cumulative_quantity": 1300,
      "child_quantity": 400,
      "released_cumulative_quantity": 1300,
      "remaining_quantity": 8700,
      "achieved_participation_bps": 935.251799
    }
  ],
  "state": "parent-complete"
}

Other exports

This module also exports twapExecution, historicalVwapExecution, adaptiveVwapExecution, 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.

Diagrams

Percentage-of-Volume Execution — system map

How it works

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References