
The mathematics of every AMM family, compared
Constant product, concentrated liquidity and the stable invariants are three different geometries, not three implementations of one idea. Each has a distinct output function, a distinct depth measure and a distinct failure mode — and quoting them with one formula is where integrations break.
Known formally as The AMM Families in the BlazePhoenix whitepaper.
BlazePhoenix Engineering · updated 2026-07-29 · 12 min · written from the deployed bytecode
By Mitra (@Sigmacrit) — anonymous developer of the BlazePhoenix protocol. The code is the résumé.
Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص
English — Constant product, concentrated liquidity and the stable invariants are three geometries, not three implementations of one idea: closed-form and honest, closed-form only inside a band and able to over-promise beyond it, and no closed form at all. Their depth figures are not even the same unit.
Português — Produto constante, liquidez concentrada e as invariantes estáveis são três geometrias, não três implementações da mesma ideia: forma fechada e honesta, forma fechada só dentro da banda e capaz de prometer a mais fora dela, e sem forma fechada nenhuma. As suas medidas de profundidade nem sequer têm a mesma unidade.
Español — Producto constante, liquidez concentrada e invariantes estables son tres geometrías, no tres implementaciones de una idea: forma cerrada y honesta, forma cerrada solo dentro de la banda y capaz de prometer de más fuera, y sin forma cerrada. Sus medidas de profundidad ni siquiera comparten unidad.
Français — Produit constant, liquidité concentrée et invariants stables sont trois géométries, pas trois implémentations d'une idée : forme close et honnête, forme close seulement dans la bande et capable de sur-promettre au-delà, et aucune forme close. Leurs mesures de profondeur n'ont même pas la même unité.
Deutsch — Konstantes Produkt, konzentrierte Liquidität und die stabilen Invarianten sind drei Geometrien, nicht drei Umsetzungen einer Idee: geschlossen und ehrlich, geschlossen nur innerhalb des Bandes und darüber hinaus überversprechend, und gar nicht geschlossen. Ihre Tiefenmaße teilen nicht einmal die Einheit.
Русский — Постоянное произведение, концентрированная ликвидность и стабильные инварианты — три геометрии, а не три реализации одной идеи: замкнутая и честная, замкнутая лишь внутри диапазона и переобещающая за его пределами, и вовсе без замкнутой формы. Их меры глубины даже не в одних единицах.
Türkçe — Sabit çarpım, yoğunlaştırılmış likidite ve stabil değişmezler üç geometridir, tek fikrin üç uygulaması değil: kapalı ve dürüst, yalnızca bant içinde kapalı ve dışında fazla vaat edebilen, ve hiç kapalı formu olmayan. Derinlik ölçüleri aynı birimde bile değildir.
العربية — الناتج الثابت والسيولة المركّزة والثوابت المستقرة ثلاث هندسات لا ثلاث تطبيقات لفكرة واحدة: صيغة مغلقة وصادقة، ومغلقة داخل النطاق فقط وقادرة على الوعد الزائد خارجه، وبلا صيغة مغلقة إطلاقًا. ومقاييس عمقها ليست حتى بالوحدة نفسها.
हिन्दी — स्थिर गुणनफल, संकेंद्रित तरलता और स्थिर इनवेरिएंट तीन ज्यामितियाँ हैं, एक विचार के तीन कार्यान्वयन नहीं: बंद-रूप और ईमानदार; बंद-रूप केवल बैंड के भीतर और उसके बाहर अधिक वादा करने वाली; और बिल्कुल बंद-रूप रहित। उनकी गहराई की माप एक ही इकाई में भी नहीं है।
日本語 — 定数積、集中流動性、安定インバリアントは三つの幾何であり、一つの考えの三実装ではありません。閉形式で正直なもの、バンド内のみ閉形式で外では過大約束しうるもの、閉形式が存在しないもの。深さの指標は単位すら同じではありません。
中文 — 恒定乘积、集中流动性与稳定不变量是三种几何,而非同一想法的三种实现:闭式且诚实;仅在区间内闭式、越界即可能超额承诺;以及根本没有闭式解。它们的深度指标甚至不是同一单位。
한국어 — 상수곱, 집중 유동성, 안정 불변식은 하나의 아이디어에 대한 세 구현이 아니라 세 기하학입니다: 닫힌 형태이며 정직한 것, 밴드 안에서만 닫혀 있고 밖에서는 과잉 약속할 수 있는 것, 그리고 닫힌 형태가 아예 없는 것. 깊이 지표는 단위조차 다릅니다.
Bahasa Indonesia — Produk konstan, likuiditas terkonsentrasi dan invarian stabil adalah tiga geometri, bukan tiga implementasi satu gagasan: bentuk tertutup dan jujur, tertutup hanya di dalam pita dan bisa menjanjikan berlebih di luarnya, serta tanpa bentuk tertutup sama sekali. Ukuran kedalamannya bahkan beda satuan.
বাংলা — ধ্রুব গুণফল, ঘনীভূত তারল্য ও স্থিতিশীল ইনভেরিয়েন্ট — এগুলো তিনটি জ্যামিতি, এক ধারণার তিন বাস্তবায়ন নয়: বদ্ধরূপ ও সৎ; কেবল ব্যান্ডের ভিতরে বদ্ধরূপ এবং বাইরে অতিরিক্ত প্রতিশ্রুতি দিতে সক্ষম; এবং একেবারেই বদ্ধরূপহীন। এদের গভীরতার একক পর্যন্ত এক নয়।
Filipino — Ang constant product, concentrated liquidity at ang stable invariants ay tatlong heometriya, hindi tatlong implementasyon ng isang ideya: closed-form at tapat, closed-form lamang sa loob ng banda at kayang mangako nang labis sa labas, at walang closed form talaga. Hindi man lang pareho ang yunit ng kanilang lalim.
An automated market maker replaces the order book with a curve. Every design in production is a choice of curve, and that choice determines three things at once: the output you receive for a given input, how depth should be measured, and where the design fails. Treating the families as interchangeable is the most common source of integration error, because the arithmetic genuinely differs.
Family one: constant product
The oldest and simplest: the product of the two reserves is held constant across a swap. Its output function is closed-form and needs only the two reserve balances, which makes it cheap to quote and impossible to get subtly wrong. Fee is applied to the input before the curve is walked.
Its properties follow directly. Liquidity is spread over every price from zero to infinity, so it never runs out but is thin everywhere; depth is naturally measured by the smaller reserve; and price impact is a smooth, convex function of size with no discontinuities. Nothing about it can lie to you — the reserves are the state, and the state is the price.
Family two: concentrated liquidity
Providers place liquidity inside a chosen price band rather than across the whole curve. Within a band, the pool behaves like a constant-product pool with a much larger virtual reserve — the same capital, deeper where it matters. State is a square-root price and an active liquidity figure, and the swap walks the price along that curve.
This is where the arithmetic becomes dangerous, and the danger is specific. The single-band formula models the CURRENT liquidity as though it extended across every price. It does not. When the swap is large enough to leave the band, real execution crosses into ranges where liquidity may be far thinner or absent, while the single-band formula happily quotes a number that assumes the deep band continues forever.
The consequence is that a concentrated pool can quote an output larger than the entire balance it holds — a promise it is physically unable to keep. The correct treatment is therefore twofold: bound any single-band quote by what the pool actually holds, and, when precision matters, obtain the number from the pool's own execution path rather than from a re-implementation of its tick mathematics.
Family three: the stable invariants
For assets that should trade near parity, the constant-product curve wastes capital: it charges meaningful impact for a trade between two things worth the same. The stable families replace it with a curve that is nearly flat near the balance point and steepens sharply away from it, concentrating depth exactly where the assets are supposed to sit.
Two shapes dominate. One blends a constant-sum and a constant-product term with an amplification coefficient controlling the flatness. The other uses a quartic invariant. Both share a defining property: neither has a clean closed-form solution for the output, so the answer must be found by iteration — and the iteration is where implementations diverge from each other and from the pool itself.
A naive iteration seeded at the wrong starting point converges to a subtly wrong answer on lopsided pools, silently. There are two defensible responses: solve properly, seeding the iteration where convergence is provable and clamping the step so it cannot overshoot; or do not solve at all and ask the pool for its own number, since the code that computes it is the code that will settle the trade.
Depth is not one quantity
This is the practical trap that survives every correct output formula. Each family reports "depth" in a unit that is not comparable with the others: constant-product reports reserve balances, concentrated liquidity reports a liquidity constant that is not denominated in tokens at all, and pool-quoted families report an output figure. These are different dimensions.
Any allocator that ranks candidates by comparing these numbers directly is comparing apples with square roots of oranges — and it will systematically over-allocate to whichever family happens to produce the largest raw figure. The only measure comparable across all families is the one that requires capital to fake: the real token balance the pool holds, read from the chain.
Why one formula cannot serve them all
Summarised as a table you can act on: constant product is closed-form and honest; concentrated liquidity is closed-form only inside a band and can over-promise beyond it; stable invariants have no closed form and must be iterated or asked. The fee model differs too — some charge a fixed fraction, some read a dynamic fee that changes with conditions, and using a stale fee produces a quote the pool will reject outright.
The engineering conclusion is not that one family is better. It is that a system quoting across all of them needs a dispatcher: closed-form mathematics where the formula IS the truth, bounded by real holdings where the formula can over-promise, and ask-the-pool where re-implementing the curve would risk diverging from the code that settles. Anything simpler is a bug waiting for the right pool.
Do not trust this page — reproduce it
Every claim above is checkable against the chain. Start here:
Take one pool from each family, quote the same size against all three with a single generic formula, then compare each answer against the pool's own quoting function — the divergence is not noise, it is the family difference this article describesCite this article
Licensed CC BY 4.0 — quote, translate and reuse freely, including commercially, with attribution and a link. Copy a ready-made citation:
BlazePhoenix (2026). The mathematics of every AMM family, compared. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/amm-math-taxonomy@misc{blazephoenix_amm_math_taxonomy,
title = {The mathematics of every AMM family, compared},
author = {BlazePhoenix},
year = {2026},
url = {https://blazephoenix.xyz/learn/amm-math-taxonomy},
note = {Accessed: reproduce the claim with the command above}
}Writing an answer, a wiki entry or a paper? The claim above is reproducible against the chain before you quote it — which is the only sound basis for citing a technical source at all.
Contracts are verified on every chain we deploy to — addresses in the protocol manifest. Deeper formal treatment: the whitepaper (PDF). Standards cited: EIP-20
Share this article · join the discussion