Historical-simulation VaR revalues a Uniswap v3 concentrated-liquidity position (liquidity L >= 0 on square-root price range [a, b], 0 < a <= b, marked today at square-root price s0) under n >= 1 historical square-root-price scenarios, each equally likely (weight 1/n), and reports the empirical alpha-quantile of the resulting loss distribution (alpha in (0, 1)). This VaR never exceeds the position's current mark-to-market value, since the position's value is always nonnegative, and scales linearly with the deployed liquidity: doubling L (same range and scenarios) doubles the VaR. Fees, re-ranging and multi-day return compounding (the horizon-scaling convention a genuine 99%/10-day VaR needs) are not modelled; the n historical scenarios are taken as given data, not derived from a price process. The historical VaR is also the library's valueAtRisk of the scenario-loss random variable under the equal-weight law Measure.ofWeights (weights 1/n), so the general VaR theory applies to it. VaR is not evaluated as the loss at an empirical price quantile: the loss is antitone in the square-root price, and that revaluation result is not proved. The scenario revaluation is also stated through the contract language: the position is the contract Contract.pay T (lpPayoff L a b T), each scenario revalues it by Contract.value under the Dirac law at that scenario with deflator 1 and the scenario price (square-root price)^2 (a full revaluation at the scenario prices, no discounting; scenario square-root prices nonnegative), and the historical VaR is the valueAtRisk of mark minus revaluation under the equal-weight law.
ℝ → ℝ → ℝ → ℝ → {n : ℕ} → (Fin n → ℝ) → Fin n → ℝHistorical-simulation loss: the loss of a v3 position with liquidity L on range [a, b], marked today at square-root price s0, under historical scenario i's square-root price scenarios i. Positive when the scenario's price move decreases the position's value.