Skip to the article
Blockheight

Crypto markets, protocols, policy

What Is an Automated Market Maker in Crypto, and How It Works?

What is an automated market maker in crypto? It is a smart contract that swaps tokens from pools, prices trades by formula, and lets you start with a wallet and gas.

The Blockheight Editors··3 min read

What Is an Automated Market Maker in Crypto, and How It Works?

Crypto beginners with a funded wallet can swap through an automated market maker (AMM), a smart contract that trades against a token pool and sets prices by formula. Connect to a decentralized exchange, choose tokens and an amount, approve the token, set slippage and confirm; the swap worked when the received tokens appear in your wallet.

Take Fraxswap: it is a decentralized exchange built around pooled token swaps, with a time-weighted feature for spreading large trades over time. For the project-specific details, fraxswap.co is where you can go further on Fraxswap’s swaps and time-spread trades.

Pool reserves set the trade price

A pool holds reserves of two tokens, supplied by liquidity providers (LPs). In a Uniswap V2-style pool, the reserves follow x*y=k: as a trade takes one token out and puts the other in, the product stays roughly constant before fees.

Say a pool starts with 10 ETH and 20,000 USDC. Its reserve ratio gives a spot price of 2,000 USDC per ETH, but buying 1 ETH leaves 9 ETH in the pool; to keep k at 200,000, the pool needs about 22,222 USDC afterward. The buyer pays about 2,222 USDC before fees, more than the starting spot price, because the purchase makes ETH scarcer in the pool. Uniswap’s explanation of pool pricing describes this constant-product mechanism.

The pool price changes as trades alter its reserves. The outside market price can move while the pool sits unchanged; arbitrageurs then trade against the pool until its price moves closer to the market. They capture the difference, which comes out of the value LPs hold in the pool. LPs earn trading fees, but arbitrage can reduce their returns.

AMMs use different formulas and fees

Constant product is one design. Curve’s StableSwap formula is designed for assets expected to trade near the same value, while Balancer supports weighted pools with token proportions that can differ from an even split. The formula affects how the pool price responds to a trade.

Fraxswap combines constant-product pricing with Fraxswap TWAMM, which breaks a large order into trades executed over time. Frax’s overview of the AMM and TWAMM describes the design. Pool fees vary, so review the displayed fee and estimated output before confirming.

To make a first swap, have a wallet, the token you want to trade, and the network’s gas token for transaction costs. Connect your wallet to the DEX, select the token pair and amount, approve token access when prompted, set slippage, then confirm. Once the received amount appears in your wallet, you can decide whether the pool’s price and fee suit your next trade.

Related stories