DeFi Protocol Simulator
Visually and interactively explore the mathematical invariants governing decentralized financial protocols: constant product liquidity pools, impermanent loss, and overcollateralized liquidations.
Pool Liquidity Reserves
Swap Order Configuration
Constant Product Curve (x · y = k) & State Displacement
Observe how larger trade sizes push the equilibrium point further along the hyperbola.
Caused strictly by your order size relative to pool liquidity. Total execution cost including fee: -0.79%
Executable Order: Unfavorable deviation stays within your configured tolerance.
Price Impact is deterministic and depends on pool reserve depth versus your order size. Slippage is the variation between the quoted price when broadcasting your transaction and the actual execution price when mined due to competing mempool transactions (or MEV bots).
In swaps with a fee tier (e.g. 0.3%), the fee collected is retained within the pool, increasing the product k = x · y with every trade and rewarding liquidity providers.
As your trade consumes a larger fraction of pool reserves, the x · y = k curve turns asymptotic, causing the marginal execution price to spike quadratically.