Skip to main content
AI Fin Hub

Playground

Execution Simulator

Square-root market impact + linear temporary impact + latency jitter. See the realistic slippage of any trade size before you route it.

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.

Simplified square-root + linear impact model from Almgren-Chriss (2000) and Kissell (2006). Real execution costs depend on regime, venue, HFT counter-trading, news, and microstructure quirks not captured here. Use this to size the order of magnitudeof 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

Sets how long the order takes, and so its timing risk.

Latency
Latency jitter (1σ)
$

Mid price used to turn basis points into dollars.

Estimated slippage

−6.1bps

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

Square-root impact 2.0 bps, linear impact 0.1 bps, 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

sqrt_impact_bps   = η · σ · √(X / V)        η = 0.10
linear_impact_bps = ε · σ · (X / V)         ε = 0.05
half_spread       = spread_bps / 2
total_bps         = sqrt_impact + linear_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 and V the average daily volume. The coefficients are round illustrative values, not calibrated to a venue. The square-root term follows the empirical square-root law of impact; participation changes how long you are exposed (timing risk), not the expected impact terms.

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. Read the cost decomposition: a square-root impact term, a linear impact term 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: a square-root market-impact term, a linear impact term 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?

The square-root coefficient is fixed at 0.1 and the linear coefficient at 0.05, both multiplying daily volatility. They are round illustrative values, not calibrated to any venue, day or regime, and you cannot change them in the tool, so treat the output as an order-of-magnitude estimate of impact cost, 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?

Estimated price displacement caused by your order, in basis points, split into a square-root term (0.1 × σ × √(order/ADV)), a linear term (0.05 × σ × order/ADV) and the half-spread, with σ the daily volatility in bps. At 1% of ADV and 2% daily volatility the impact terms add about 2 bps; at 10% of ADV about 7 bps, so for large orders impact overtakes the spread. The square-root shape follows the empirical square-root law of market impact; 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.

  • Playgrounds Prompt Regression Tester

    Run the same prompt against multiple models (Claude 4.5/4.6/4.7, GPT-5, Gemini 2.5) 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.

All articles

Use it from code

The same calculation as a JavaScript module you can import. It runs where you import it, with no request, key or rate limit.

import { compute } from "https://aifinhub.io/engines/execution-simulator.js";

Input and output contract and the guide for agents.