Master the financial mechanics of Web3 with animated step-by-step explainers: AMMs, Liquidity Pools, Impermanent Loss, Lending, Health Factors, Liquidations, Staking, Bridges, and Stablecoins.
Trading crypto without order books or middlemen using math algorithms.
Traditional stock exchanges rely on order books where buyers and sellers match bids and asks through market makers. Decentralized exchanges (DEXs) like Uniswap use Automated Market Makers (AMMs) โ autonomous smart contracts holding pooled reserves where trades are priced deterministically using mathematical invariant curves like x * y = k.
Where 'x' is token A reserve, 'y' is token B reserve, and 'k' is a constant value that must remain invariant after each swap (excluding transaction fees).
LPs deposit equal value of two tokens (e.g. $10,000 ETH + $10,000 USDC) into a smart contract vault.
Pioneered constant product & concentrated liquidity
High-speed hybrid AMMs on Solana
Stableswap invariant optimized for pegged assets
Notice how swapping larger amounts shifts the pool ratio, increasing price impact. Constant product formula (xยทy=k) automatically prices liquidity.
Explore our DeFi Developer Learning Path or test sample AMM contracts in the Solidity Editor.