What does LVR, Sandwich Bounds and Vault Risk conclude, in numbers, about “Closing the Loop: a Monthly On-Chain Position Check-up, the Distilled Tool and a Pre-registered Refutation”?
Answer: Chapter 8 gives a monthly on-chain position check-up, the distilled Market-Making Loss and Slippage Check-up and a pre-registered refutation plan whose main test needs 56 position-months. The book is defensive only and describes no building or running of front-running or sandwich bots. Marked boxes separate published evidence, runnable Python calculations (20 programs), classical sources and the author's hypotheses.
Scope of the numbers: Parameters are illustrative and all calculations are generated by the book's programs. This is general investment risk analysis, not investment advice; it recommends no token, protocol or trade, and crypto-assets are high risk and can be lost in full.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 56
| Test 1: mean ln(coverage) < 0, sd 0.6, alpha 0.05, power 0.80 | |
| delta n (indep.) design effect (m | 3) n positions x 3 |
| 0.1 | 223 1.6 119 |
| 0.2 | 56 1.6 30 |
| 0.3 | 25 1.6 14 |
| Test 2: sign test on coverage < 1 | |
| p1 0.60: n | 158, reject if at least 90 below 1 |
| p1 0.65: n | 69, reject if at least 42 below 1 |
| p1 0.70: n | 37, reject if at least 24 below 1 |
| Test 3: simulated power of test 1 at delta 0.2 | |
| n | 56, power 0.790 |
Show the full program
# Chapter 8. p82: sample sizes for the pre-registered refutation test.
# Test 1 (core claim): over registered position-months, the mean of
# ln(coverage ratio) is below 0. One-sided test at alpha = 0.05 with
# power 0.80 against a true mean of -delta, monthly sd 0.6 (assumed):
# n = ((z_a + z_b) sd / delta)^2, inflated by the design effect
# 1 + (m - 1) rho for m months per position, rho = 0.3.
# Test 2 (sign test): share of position-months with coverage below 1;
# null 0.5, alternative p1; smallest n with exact binomial size <= 0.05
# and power >= 0.80. Test 3: a fixed-seed simulation checks the power
# of test 1 at the computed n. All inputs illustrative.
import math
import random
import statistics
ZA, ZB = 1.6449, 0.8416
def n_mean(delta, sd):
return math.ceil(((ZA + ZB) * sd / delta) ** 2)
def binom_tail(n, k, p):
terms = [math.comb(n, i) * p ** i * (1 - p) ** (n - i)
for i in range(k, n + 1)]
return math.fsum(terms)
def n_sign(p1):
for n in range(10, 2000):
k = next(k for k in range(n + 1) if binom_tail(n, k, 0.5) <= 0.05)
if binom_tail(n, k, p1) >= 0.80:
return n, k
return None, None
def sim_power(rng, n, delta, sd, reps=4000):
hits = 0
for _ in range(reps):
xs = [rng.gauss(-delta, sd) for _ in range(n)]
t = statistics.fmean(xs) / (statistics.stdev(xs) / math.sqrt(n))
if t < -ZA:
hits += 1
return hits / reps
if __name__ == "__main__":
rng = random.Random(20261120)
print("Test 1: mean ln(coverage) < 0, sd 0.6, alpha 0.05, power 0.80")
print(" delta n (indep.) design effect (m=3) n positions x 3")
for delta in (0.1, 0.2, 0.3):
n = n_mean(delta, 0.6)
deff = 1 + (3 - 1) * 0.3
npos = math.ceil(n * deff / 3)
print(" {:.1f} {:>11,} {:>20.1f} {:>17,}".format(
delta, n, deff, npos))
print("Test 2: sign test on coverage < 1")
for p1 in (0.60, 0.65, 0.70):
n, k = n_sign(p1)
print(" p1 {:.2f}: n = {:>4,}, reject if at least {:>4,} below 1"
.format(p1, n, k))
print("Test 3: simulated power of test 1 at delta 0.2")
n = n_mean(0.2, 0.6)
print(" n = {}, power {:.3f}".format(n, sim_power(rng, n, 0.2, 0.6)))Single source and citation
Fan, Y. (2026). Concentrated-Liquidity Loss-Versus-Rebalancing, On-Chain Sandwich Bounds and Decentralised Vault Risk Control (Version 1.0.0), Chapter 8: Closing the Loop: a Monthly On-Chain Position Check-up, the Distilled Tool and a Pre-registered Refutation. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-344 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026344,
author = {Fan, Yafu},
title = {Concentrated-Liquidity Loss-Versus-Rebalancing, On-Chain Sandwich Bounds and Decentralised Vault Risk Control},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Concavity of Constant Product: Market Making Is Selling Gamma
- Chapter 2 · The σ²/8 Rate of Loss-Versus-Rebalancing, Discounted by Fees and Block Times
- Chapter 3 · Concentrated Liquidity: the Amplification Factor, the Range Value Function and the Odds of Leaving the Range
- Chapter 4 · Fees Against LVR: Break-Even Volatility, Measurement Noise and the Crowded Range
- Chapter 5 · Bounding the Sandwich: Your Slippage Tolerance Is the Largest Loss You Offer
- Chapter 6 · Pricing Smart-Contract Tail Risk with Poisson Jumps, Kelly Position Caps and Vault Rebalancing Bands
- Chapter 7 · Classical Sources: the Guanzi on Light-and-Heavy Price Levelling and Bagehot's Lombard Street