(4), p. 23 — the front-runner's profit on a constant product pool is 2x²Y/((X − x)(X − 2x)) > 0
ProvedCPAMMFlaws.Properties.eq_4automated-market-makingfront-runningp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1
Let a constant product pool hold units of token and units of token , and let . A front-runner buys units, the trader she front-runs buys units, and the pool is then with . She sells her units back into that pool. Then:
- her sale proceeds are
- her profit, the proceeds minus her purchase cost , is
- this profit is strictly positive.
This is the computation behind Proposition 3(2): front-running a constant product pool is profitable for every order size.
Formalization Note The paper writes the proceeds as , the amount received; in the sign of (3) a sale has negative cost, so the proceeds are (p. 16: "Negative values of signify a sale and the cost, therefore, indicates revenue earned"). The bound is the paper's standing restriction for front-running (p. 19); , are the deposits of §II.C.
Preamble
import Mathlib import Definitions.Def_CPAMMFlaws_Properties_Setting
Formal statement
namespace CPAMMFlaws.Properties
theorem eq_4 (X Y x : ℝ) (hX : 0 < X) (hY : 0 < Y) (hx : 0 < x) (hx2 : x < X / 2) :
-pcmm (-x) (X - 2 * x) (Y + pcmm (2 * x) X Y) = x * X * Y / ((X - x) * (X - 2 * x)) ∧
-pcmm (-x) (X - 2 * x) (Y + pcmm (2 * x) X Y) - pcmm x X Y =
2 * x ^ 2 * Y / ((X - x) * (X - 2 * x)) ∧
0 < 2 * x ^ 2 * Y / ((X - x) * (X - 2 * x)) := by sorry
end CPAMMFlaws.Properties
Source
Park, The Conceptual Flaws of Constant Product Automated Market Making, working paper dated June 8, 2021, p. 23, proof of Proposition 3(2), (4)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.