Skip to content

Constant-product AMM lab

A constant-product automated market maker quotes swaps from two token reserves constrained by x × y = k. Change a scenario to see how input size, fee retention, inventory, and price impact connect.

This educational model uses exact decimal arithmetic. It does not model concentrated liquidity, integer rounding, transfer taxes, hooks, or a named protocol implementation.