# Arrival-Price Execution

`D13-F02-A03` · Execution and Transaction Cost Analysis → Cost/Risk Optimization · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/execution-and-transaction-cost-analysis/cost-risk-optimization/arrival-price-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 { arrivalPriceExecution } from "fintech-algorithms/execution-and-transaction-cost-analysis/cost-risk-optimization/arrival-price-execution";
```

## Signature

```ts
arrivalPriceExecution(input)
```

Benchmarks against the price at the moment the decision was made, which front-loads execution. The most demanding common benchmark, because every second of delay is measured against it.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | `ArrivalPriceInput` | yes | Arrival price, quantity, horizon, and the aggression parameter controlling how quickly the order is worked. |

## Returns

`{ schedule, front_loading, expected_slippage_bps, … }`

The schedule with its front-loading and expected slippage against arrival.

## Errors

- When aggression falls outside its permitted range — throws

## Complexity

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

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

`input`:

```json
{
  "remaining_quantity": 8000,
  "side": "buy",
  "arrival_price_atoms": 1000000,
  "current_price_atoms": 1000500,
  "tolerance_bps": 8,
  "observed_market_volume": 50000,
  "base_participation_bps": 1000,
  "defensive_participation_bps": 300,
  "max_participation_bps": 2000,
  "intervals_remaining": 10,
  "deadline_threshold_intervals": 2,
  "max_child_quantity": 1500,
  "lot_size": 100
}
```

### Call

```ts
arrivalPriceExecution(input)
```

### Returns

object with 12 fields: side, arrival_price_atoms, current_price_atoms, signed_move_bps, tolerance_bps, price_state, chosen_participation_bps, observed_market_volume, …

```json
{
  "side": "buy",
  "arrival_price_atoms": 1000000,
  "current_price_atoms": 1000500,
  "signed_move_bps": 5,
  "tolerance_bps": 8,
  "price_state": "inside-band",
  "chosen_participation_bps": 1000,
  "observed_market_volume": 50000,
  "target_from_volume_quantity": 5000,
  "child_quantity": 1500,
  "remaining_quantity": 6500,
  "state": "inside-band"
}
```

## Other exports

`almgrenChrissOptimalExecution`, `implementationShortfallExecution`, `liquiditySeekingExecution`, `opportunisticDarkPoolExecution`, `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/cost-risk-optimization/arrival-price-execution/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/execution-and-transaction-cost-analysis/cost-risk-optimization/arrival-price-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
