fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Cost/Risk Optimization

5 algorithms in Execution and Transaction Cost Analysis.

In this family#

  1. Almgren-Chriss Optimal Execution contract

    The canonical optimal execution trajectory: trades off market impact against the risk of holding the position longer. Risk aversion is the single parameter that shapes the answer — at zero it degenerates to TWAP.

    almgrenChrissOptimalExecution(input)
  2. Implementation-Shortfall Execution contract

    Minimises total shortfall against the arrival price, including the opportunity cost of quantity that never executes. Unexecuted quantity is a real cost, and a strategy measured only on filled shares hides it.

    implementationShortfallExecution(input)
  3. Arrival-Price Execution contract

    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.

    arrivalPriceExecution(input)
  4. Liquidity-Seeking Execution contract

    Trades opportunistically when liquidity appears rather than on a schedule. Completion time is uncertain by construction — the strategy trades schedule certainty for better prices.

    liquiditySeekingExecution(input)
  5. Opportunistic Dark-Pool Execution contract

    Routes to non-displayed venues to avoid signalling. The counter-risk is adverse selection: filling in the dark exactly when the lit market is about to move against you, which the fill-rate and reversion outputs are there to expose.

    opportunisticDarkPoolExecution(input)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { almgrenChrissOptimalExecution } from "fintech-algorithms/execution-and-transaction-cost-analysis/cost-risk-optimization/almgren-chriss-optimal-execution";
import { implementationShortfallExecution } from "fintech-algorithms/execution-and-transaction-cost-analysis/cost-risk-optimization/implementation-shortfall-execution";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Execution and Transaction Cost Analysis collects 9 algorithms across 2 families. For the concept behind this family rather than the call signatures, see the concept guides.