Lemma 2, p. 15 — the constant product invariant (X − x)(Y + y) = XY holds exactly when y = p^cmm(x, X, Y) = xY/(X − x)
ProvedCPAMMFlaws.Properties.lemma_2automated-market-makingconstant-productp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1
Let a constant product pool hold units of token and units of token , and let be the quantity of traded ( a buy, a sale). Then:
- for every real , the pool stays on its constant product curve,
- after the trade the pool holds
units of .
This is the bridge between the pricing rule of §II.C and the closed form (3) used in every later computation, together with the paper's description of the pool after the trade.
Formalization Note The page allows demand ; at no satisfies the invariant, so the lemma is stated for . , are the deposits of §II.C. Part 2 is the sentence after the lemma: "After the trade, the contract contains units of token , and units of ."
Preamble
import Mathlib import Definitions.Def_CPAMMFlaws_Properties_Setting
Formal statement
namespace CPAMMFlaws.Properties
theorem lemma_2 (X Y x : ℝ) (hX : 0 < X) (hY : 0 < Y) (hxX : x < X) :
(∀ y : ℝ, (X - x) * (Y + y) = X * Y ↔ y = pcmm x X Y) ∧
Y + pcmm x X Y = X * Y / (X - x) := by sorry
end CPAMMFlaws.Properties
Source
Park, The Conceptual Flaws of Constant Product Automated Market Making, working paper dated June 8, 2021, p. 15, Lemma 2, (3), and the sentence after it; invariant from §II.C, p. 14
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.