Liquidity Pools & AMMs

AMMs, Price Impact, Slippage, and Arbitrage

Spot the edge. Swoop in.

Automated market makers use formulas rather than order books to quote prices. Pool depth, trade size, and the pricing curve determine price impact. Arbitrageurs then close the gap to external markets, changing LP inventory in the process.

By Swoopr Editorial Team

Published · Updated

AI-assisted content · Swoopr is responsible for the final published article.

Direct Answer

An automated market maker quotes trades from pool state and a pricing rule rather than matching a buyer with a specific seller. Price impact is the change caused by the trade itself; slippage is the difference between expected and actual execution; slippage tolerance is a user-defined boundary that can cause a transaction to revert when conditions worsen.

Key Takeaways

What This Page Covers

This page explains how a swap moves from a quote to final execution and why an AMM's price cannot be evaluated without trade size, active liquidity, fees, route, and state changes.

AMM Pricing Intuition

In a constant-product pool, the simplified invariant is:

x × y = k

A trader adds one asset and removes the other while the product remains approximately constant after fees and rounding. Each additional unit becomes more expensive because the reserve being purchased shrinks. The quoted marginal price therefore changes across the trade.

Other AMMs use different curves, concentrated ranges, stableswap designs, hooks, dynamic fees, or hybrid models. The invariant determines how inventory and price respond to a transaction.

Price Impact Versus Slippage

Price impact is the difference caused by executing against finite liquidity. It can be estimated from the current pool state.

Slippage is the difference between the expected result at quote time and the actual result. It can arise from price impact, other transactions, market movement, routing changes, fee-on-transfer tokens, oracle conditions, or delays.

Slippage tolerance is a guardrail. A swap with an expected output of 1,000 and 0.5% tolerance may encode a minimum near 995, depending on interface calculations. If execution would produce less, the transaction should revert. The tolerance is not a fee and does not guarantee the displayed result.

Active Liquidity and Fee Tiers

Concentrated-liquidity pools can have substantial total value but limited active liquidity near the current price. Execution depends on the liquidity available across the price movement caused by the trade.

Different fee tiers compensate LPs for different asset behavior and competition. A lower fee may improve trader price while attracting or requiring more volume. A higher fee may compensate LPs for volatility but increase transaction cost. Routing engines compare pools and paths, but the chosen route can change before execution.

Arbitrage and Pool Repricing

If an AMM price differs from external markets enough to cover fees and costs, arbitrageurs can buy the cheaper asset and sell the more expensive one. Their trades change pool reserves and align prices.

This process is essential to AMM pricing, but it means LPs transact against informed flow during market moves. Arbitrage profits are related to the provider's relative loss versus continuously rebalancing at external prices. Fees may or may not offset that effect.

Execution Controls and MEV

A swap transaction can be observed before inclusion on public networks. Other participants may trade around it, back-run it, or exploit an overly wide tolerance where protocol and network conditions allow.

Useful controls include constrained slippage, reasonable deadlines, private transaction routes where trustworthy and appropriate, trade-size reduction, route review, and avoidance of illiquid tokens with unusual transfer behavior. No control eliminates all execution risk.

Practical Decision Framework

Use the QUOTE sequence:

Reject a quote that cannot be explained in units the user understands.

Worked Example

A pool holds 1,000 Token X and 1,000,000 stablecoin units, implying a rough spot ratio of 1,000 stablecoins per X before fees.

A trader wants 50 X. Under a constant-product model, removing 5% of X requires adding more than 5% of stablecoin reserves because price worsens throughout the trade. The average execution price will be above the initial ratio. A fee further increases cost.

If another transaction buys X first, the trader's output worsens. A minimum-output condition may protect the trader by reverting. Increasing slippage tolerance to force success accepts a lower output; it does not create liquidity.

Common Mistakes

Risks and Limitations

AMM examples are simplified. Real pools can use custom curves, concentrated ranges, dynamic fees, hooks, transfer-tax tokens, rebasing assets, or external oracles. Aggregators add routing contracts and dependencies. Public ordering can expose trades to MEV. Reverted swaps can still consume gas.

Execution quality is context-specific. A small trade can be material in a thin pool, while a larger trade may execute efficiently in deep active liquidity.

Practical Checklist

Frequently Asked Questions

Is slippage always bad?

Some difference between quote and execution is normal in changing markets. The objective is to constrain it to an acceptable amount, not assume zero.

Why did my trade revert?

The minimum output, deadline, balance, allowance, gas, contract condition, or another requirement may have failed.

Does a high fee tier mean better LP returns?

Not automatically. Returns depend on volume, active share, price movement, competition, and adverse selection.

Can arbitrage harm traders?

Arbitrage generally aligns prices, but transaction ordering and MEV can worsen specific executions. Guardrails matter.

Why does an aggregator use multiple pools?

Splitting or routing through intermediate assets can reduce total execution cost, though it adds complexity and contracts.

Summary

AMM execution is a function of the pricing rule, active liquidity, trade size, route, fees, state changes, and user guardrails. Distinguishing price impact from slippage is essential for interpreting quotes and protecting execution.

Sources and Further Reading

Educational disclaimer: Educational information only; not investment, tax, legal, or personalized financial advice. DeFi positions can lose some or all committed assets through market movement, liquidation, smart-contract failure, governance action, oracle failure, bridge failure, stablecoin instability, operational mistakes, fraud, or other causes.

Continue Learning