Learn · Fundamentals
What is an automated market maker (AMM)?
An automated market maker, or AMM, is the engine behind most decentralized exchanges. Instead of matching buyers to sellers through an order book, it lets you trade against a pool of tokens using a mathematical formula that sets the price automatically. That single design choice is what makes permissionless, always-on, on-chain trading possible. This article explains how AMMs work, the constant-product math at their core, why prices move with every trade, and what the people who supply the pools actually earn.
No order book, just a pool
The constant-product formula
Why prices move on every trade
What liquidity providers earn
Variations on the theme
Legal
Risk disclosure
XAUConnect is a non-custodial swap aggregator. Digital assets are volatile and may lose value rapidly. Content on this page is educational and not investment advice. Verify every contract address on the official block explorer before approving a transaction.
Frequently asked questions
How does an AMM set prices without an order book?
A formula based on the ratio of tokens in the pool sets the price. Trading shifts the ratio, which moves the price automatically — no buyers and sellers need to be matched.
What is the constant-product formula?
It keeps the product of the two token quantities fixed. Buying one token raises its price so the product stays constant, producing a smooth curve that always quotes a price.
Why do AMM prices change with every trade?
Because price depends on reserve ratios. Each trade changes the ratio, so it moves the price for the next trader — the source of price impact and why quotes expire.
What do liquidity providers earn?
A share of trading fees proportional to their stake, offset by impermanent loss when token prices diverge. High-volume, low-volatility pools favor providers.
Trade on XAUConnect
Open the swap page to compare live routes, set slippage, and sign from your own wallet — fully non-custodial.
Continue exploring
Related markets, guides & networks
Curated next steps based on this topic — deepen your research before you trade.
How to set slippage tolerance
How to choose a slippage tolerance that protects you from sandwich attacks without causing failed transactions, with con
How to avoid swap scams and honeypots
The common ways traders lose funds on DEXs — fake tokens, honeypots, malicious approvals, and phishing front-ends — and
What is impermanent loss?
Why providing liquidity can underperform simply holding the tokens. Impermanent loss explained with a concrete example a
How do limit orders work on a DEX?
On-chain limit orders defer execution until price crosses your target. How they differ from spot swaps and the mechanics
How order routing finds the best price
Single-hop, multi-hop, and split routes. How an aggregator searches the graph of pools to maximize your output, and when
Build programmatically
Swap via API for bots and AI agents — quotes, builds, and cross-chain routes.