HomeComputer ScienceAMM Bonding Curve & Slippage Function — 2D Reserve-Space View

AMM Bonding Curve & Slippage Function — 2D Reserve-Space View

2D constant-product AMM (x·y=k): watch the trade point move along the hyperbolic bonding curve in reserve space, compare the tangent (spot price) against the secant (executed price), and read the slippage function against trade size.

Computer Science2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-cryptocurrency-technology ↗ Open standalone

This 2D companion renders the exact constant-product invariant x·y = k as a live hyperbola in reserve space rather than as two 3D tanks: the current reserve pair is a point that slides along the curve on every swap, a trail marks recent trades, and tangent/secant lines make spot price versus executed price a geometric comparison instead of just two numbers. A second panel plots the slippage function itself — executed slippage against trade size, for both directions, computed analytically from the live reserves and fee — which the 3D version never visualizes directly.

⚙ Under the hood

2D constant-product AMM (x·y=k): watch the trade point slide along the hyperbolic bonding curve plotted directly in reserve space, compare the tangent (spot price) against the secant (executed price) geometrically, and read the analytic slippage-vs-trade-size function for both swap directions.

blockchaindefiammliquidity-poolcryptocurrencyeconomicsbonding-curveslippage

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)