AI Fin Hub

Playground

Execution Simulator

Buying 50,000 shares at $100 (1.0% of daily volume) at 10% participation costs 12.4 bps, $6,199, over 39 minutes.

On the documented defaults, computed by this tool's engine · the same answer as JSON

Execution cost calculator using the Almgren et al. (2005) impact model: permanent and temporary impact, half-spread and latency risk for any order size.

01Playground

Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.

Education, not investment advice. Past performance does not predict future results. How we check our numbers.

Market-impact model and coefficients from Almgren, Thum, Hauptmann and Li (2005), fitted on Citigroup's US large-cap orders. Costs on small caps, other venues or stressed markets can be well above the fit; use this to size the order of magnitude of your slippage, not to approve a block trade.

1. Order & market inputs

Side

Costs are symmetric: a sell pays the same basis points as a buy.

100 to 1.00M on a log scale; type any value.

100.0k to 100.00M on a log scale; type any value.

Bid-ask spread

Full quoted spread; you pay half of it.

Daily volatility

Standard deviation of daily returns (2% ≈ 32% a year).

Participation rate

Trading faster raises temporary impact; trading slower leaves the order exposed longer (timing risk).

Latency
Latency jitter (1σ)

10 to 5000 on a log scale; type any value.

$

Mid price used to turn basis points into dollars.

Estimated slippage

−12.4bps

$6.20k on $5.00M notional, 50.0k buy, 1.00% of ADV, fills in 39.0 min

Impact paid 8.4 bps (half the 2.5 bps permanent move plus 7.1 bps temporary), half-spread 4.0 bps. Risk around that cost (1σ): timing ±63.2 bps over the fill, latency ±0.51 bps (±0.72 at latency + 2σ jitter).

2. Fill schedule (participation-weighted)

0%25%50%75%100%—9.8 min19.5 min29.3 min39.0 minCumulative bought

Linear participation model: the order tracks a constant fraction of market volume until filled. Real VWAP/TWAP engines shape the curve (U-shape for VWAP, flat for TWAP) to match intraday liquidity.

Formulas

permanent_bps     = γ · σ · (X / V) · (Θ / V)^(1/4)       γ = 0.314
temporary_bps     = η · σ · participation^(3/5)          η = 0.142
realized_impact   = permanent / 2 + temporary
half_spread       = spread_bps / 2
total_bps         = realized_impact + half_spread
duration_min      = X / (participation · V / 390)
timing_risk       = σ · √(duration_min / 390) · 10_000        (bps, 1σ)
latency_drift     = σ · √(latency_ms / ms_per_day) · 10_000   (bps, 1σ)

σ is daily volatility, X the order, V the average daily volume and Θ the shares outstanding. γ and η are the coefficients Almgren, Thum, Hauptmann and Li (2005) fitted on Citigroup US large-cap orders; the model reproduces their Table 3 (a 10%-of-ADV IBM buy: 20 bp permanent, 32, 25 and 18 bp realized over 0.1, 0.2 and 0.5 days). Trading faster raises the temporary term; trading slower raises timing risk.

02Receipt

What the answer above ran on, how it is computed, where the data comes from, and a link that reopens it.

Inputs

  • adv5000000
  • daily_vol_pct2
  • inverse_turnover263
  • latency_jitter_ms75
  • latency_ms150
  • order_size50000
  • participation_pct10
  • ref_price100
2 more inputs
  • sidebuy
  • spread_bps8

The documented defaults. Change any input above and the tool recomputes.

Method

How the hub's tools are built and checked

Engine /engines/execution-simulator.js, sha256 2fe0a19f8cff. The page, the API and MCP run the same file.

Source

Your inputs / BYO key

Page updated .

Permalink

aifinhub.io/execution-simulator/

The link carries the inputs you set, so it reopens this result.

03For agents

Any agent can run this calculator by URL or MCP and get the same answer as JSON: the inputs that used defaults, the result and a line to cite. The call below follows the inputs you set above. In code, import the same engine; it runs where you import it, with no request or key.

Requestthe documented defaults
GET https://aifinhub.io/api/run/execution-simulator
Response200 application/json · 1.6 KB
{
  "calculator": "execution-simulator",
  "title": "Execution Simulator",
  "site": "AI Fin Hub",
  "input": {},
  "defaults_used": {
    "adv": 5000000,
    "daily_vol_pct": 2,
    "inverse_turnover": 263,
    "latency_jitter_ms": 75,
    "latency_ms": 150,
    "order_size": 50000,
    "participation_pct": 10,
    "ref_price": 100,
    "side": "buy",
    "spread_bps": 8
  },
  "result": {
    "side": "buy",
    "permanentBps": 2.528998553014538,
    "temporaryBps": 7.133757465487207,
    "realizedImpactBps": 8.398256741994476,
    "halfSpreadBps": 4,
    "totalBps": 12.398256741994476,
    "totalDollars": 6199.128370997239,
    "notionalUsd": 5000000,
    "durationMinutes": 39,
    "latencyDriftBps": 0.5063696835418333,
    "latencyDriftWorstBps": 0.716114874039433,
    "durationTradingDays": 0.1,
    "timingRiskBps": 63.245553203367585
  },
  "provenance": {
    "run": "https://aifinhub.io/api/run/execution-simulator",
    "page": "https://aifinhub.io/execution-simulator/",
    "methodology": "https://aifinhub.io/execution-simulator/",
    "contract": "https://aifinhub.io/contracts/execution-simulator.json",
    "engine": "https://aifinhub.io/engines/execution-simulator.js",
    "engine_sha256": "2fe0a19f8cff36972649e9d210f8136f1266521113951be5f4f8065886f23843",
    "build": "1a772910d31ef1740892ed0e3a065ed71e8c7406"
  },
  "disclaimer": "Planning estimates only — not financial, tax, or investment advice.",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "cite": "AI Fin Hub, Execution Simulator (engine 2fe0a19f8cff), https://aifinhub.io/api/run/execution-simulator"
}
The response for the defaults, as the run URL returns it. Provenance carries the engine hash and build.

How to use it

  1. Set the order: side, order size in shares, and the stock's average daily volume — order size relative to ADV drives the impact.
  2. Set the market conditions: bid-ask spread (bps), daily volatility (%), and participation rate (% of volume).
  3. Set latency (ms) and latency jitter to see the drift band the delay adds, and enter a reference price to convert basis points into dollars.
  4. Set inverse turnover (shares outstanding divided by daily volume; 263 for IBM) to scale permanent impact to the stock. Then read the cost decomposition: half the permanent impact, the temporary impact of your trading rate and the half-spread, summed to total slippage in basis points and dollars, plus the trade duration and the 1σ timing risk over it. The output is closed-form and deterministic: same inputs, same result, no random paths.
  5. Increase order size to find the 'capacity ceiling' where slippage exceeds expected alpha. This is your strategy's practical capacity limit.

Questions people ask

What does the simulator model that backtests skip?

It decomposes the execution cost most backtests ignore into three parts: half of the permanent price impact your order causes, the temporary impact of trading at your chosen rate, and the half-spread you cross, plus 1σ timing risk over the fill and a latency-drift band. Most backtests assume instant, complete fills at the mid-quote, which overstates achievable returns. It does not model an order book, queue position, or partial fills — those are outside a closed-form impact estimate.

Where do the impact coefficients come from?

From Almgren, Thum, Hauptmann and Li (2005), who fitted them on Citigroup's US large-cap orders: permanent impact 0.314 × σ × (order/ADV) × (shares outstanding/ADV)^(1/4), temporary impact 0.142 × σ × participation^(3/5). The tool reproduces the paper's Table 3. The fit is for liquid US large caps; small caps, other venues and stressed markets can cost well more, so treat the output as an order-of-magnitude estimate, not a venue-accurate fill.

Does the simulator handle venues or dark pools?

No. There is no order book, no lit-versus-dark distinction, and no venue selection — the tool is a closed-form estimate of aggregate impact cost from your order size relative to daily volume. For venue-specific fill behavior you need order-book replay, not this.

What's the impact-cost output?

The cost your order pays, in basis points: half the permanent impact (which grows with order size relative to ADV) plus the temporary impact (which grows with how fast you trade) plus the half-spread, with σ the daily volatility. For a buy of 10% of a day's volume in IBM traded over half a day, the model gives about 18 bps of impact, as in the paper's Table 3; trading the same order in a tenth of a day costs about 32 bps. The formulas are printed under the tool.

Is the output deterministic?

Yes. The calculation is closed-form — identical inputs always produce identical output, with no Monte Carlo or random paths. What varies in real markets (arrival timing, book depth, adverse selection) is not simulated, so re-running the same inputs won't build a distribution; the tool gives a single point estimate of expected impact cost.

  • Playgrounds Agent Skill Tester for Markets

    Paste a SKILL.md definition + sample input + your Anthropic API key. See structured extraction, token cost, and latency — all in your browser. No signup, key never leaves the page.

  • Playgrounds Prompt Regression Tester

    Run the same prompt against current Claude, GPT and Gemini models with your own keys. Diff outputs, score drift, catch regressions.

  • Playgrounds Hallucination Detector

    Paste a source document + an LLM's extraction. Every numeric claim in the output is checked against the source. Client-side. Catches silent fabrication before it ends up in your pipeline.

All articles