
Pools and LP tokens
4 minDifficulty Checked 2026-11-10- An AMM is a pool of two assets. Each asset pair has at most one.
- The rate comes from the pool's balance. Every trade moves it.
- LP tokens redeem for a share of whatever the pool holds at that time.
An order book needs two people who want opposite things at the same time. An Automated Market Maker, or AMM, takes away the waiting. It is a pot that holds two assets, such as XRP and FOO. Anyone can trade with the pot at any time.
The pot has no price list. It uses a rule: the scarcer an asset gets in the pot, the more it costs.
- You take FOO out and put XRP in. Now the pot has less FOO. FOO costs more for the next person.
- Someone does the reverse. FOO gets cheaper again.
A big pot barely moves when you trade. A small pot moves a lot. So large pools give better rates on the same trade.
The assets in the pot come from liquidity providers. They deposit and get LP tokens back. LP tokens are a receipt for a slice of the pot. Hand them back and you get your slice of both assets.
Your slice is a share of whatever is in the pot on that day, and the mix changes with every trade. Say you start a pool with 5 ETH and 5 USD. Someone swaps 1.26 USD for 1 ETH. The pool now holds 4 ETH and 6.26 USD. Half the LP tokens now redeem for 2 ETH and 3.13 USD.
The pool charges a small trading fee on each swap. The fee stays in the pot, so it grows every provider's slice.
The AMM amendment (XLS-30) was enabled on mainnet on 2024-03-22.
Design. The XRP Ledger uses a geometric mean market maker with a weight of 0.5, which behaves like a constant product market maker. A percentage trading fee applies on top of the formula's rate.
Assets. A pool holds two different assets. At most one is XRP. The other, or both, are trust line tokens. Tokens are identified by issuer and currency code, so FOO from two issuers can form a pool. Direction does not matter: XRP/FOO and FOO/XRP are the same AMM. MPT support in AMMs is part of the MPTokensV2 amendment, which is in development.
One pool, shared with the DEX. OfferCreate and cross-currency Payment transactions use AMMs automatically. A single transaction can consume offers, AMM liquidity or both, whichever is cheaper. Transaction metadata shows what was used.
In the ledger an AMM is:
- An
AMMentry that describes the pool. - A special
AccountRoot, the AMM account. It issues the LP tokens and holds the pool's XRP. Its address differs each time a pool is created. - Trust lines from the AMM account for the pool's tokens.
No account owns these entries, so no reserve applies to them.
LP tokens are trust line tokens issued by the AMM account. Their currency code is a 160-bit hex code that starts with 0x03, followed by a hash of the two assets. You can send them or trade them on the DEX. You cannot send them straight to the AMM account. They are issued by AMMDeposit and redeemed by AMMWithdraw.
Reading a pool. amm_info takes asset and asset2, or amm_account. It returns:
account: the AMM account's address.amount,amount2: the pool's balances.lp_token: total LP tokens outstanding.trading_fee: in units of 1/100,000.vote_slots,auction_slot: fee votes and the current slot holder.
Your share of each asset is your LP tokens divided by lp_token.value, times amount.value and amount2.value.
Related: The DEX, Deposits and withdrawals.
- Automated Market MakersRead 2026-11-10
- amm_infoRead 2026-11-10
- Known AmendmentsRead 2026-11-10
- XLS-30 Automated Market MakerRead 2026-11-10
