The XRP Ledger has a decentralized exchange built directly into the protocol, so you can trade XRP and other tokens on-ledger without any separate app or smart contract. It has run continuously since the network launched in 2012. Since 2024 it also has an automated market maker, or AMM, that works alongside the order book.
That combination is unusual. Most decentralized exchanges are built on either an order book or an AMM; the XRP Ledger has both, and they cooperate on every trade. This guide explains how each one works and how they fit together. It stays on the XRP Ledger's own exchange, not the general theory of automated market makers, which is covered separately in AMMs explained, and the wider network picture is in the parent, how the XRP Ledger works.
The built-in order book
The heart of the exchange is a central limit order book, the same style of matching a traditional exchange uses. You trade by sending a transaction called an Offer, essentially a limit order to buy a set amount of one asset for a set amount of another (source: XRP Ledger, decentralized exchange).
Matching Offers are filled best-rate-first, and anything left over rests on the book as a passive Offer that later trades can consume. So a single Offer can fill immediately, fill part way and leave the rest waiting, or sit on the book untouched until the market moves to its price. It behaves like a familiar limit order, just recorded directly on the ledger instead of inside an exchange's private database.
There is no limit to the currency pairs that can trade. A pair can be XRP against a token, or one token against another, where each token is identified by its issuer plus its currency code. That last detail matters: two tokens with the same ticker but different issuers are treated as completely different assets, so you always trade a specific issuer's token, not a generic symbol.
One clever feature is auto-bridging. When you trade one token directly for another, the ledger checks whether routing through XRP first, token to XRP to token, would give a better rate, and uses that path if it does. XRP acts as a shared bridge currency across the whole order book, which deepens liquidity for pairs that might otherwise be thin.
How placing a trade actually works
Walk through a simple order. You place an Offer to buy 100 of a token, willing to spend up to a set amount of XRP. The network scans the matching order book, consumes the best-priced Offers first, and delivers whatever it could buy at your price or better.
It keeps consuming until either your order is filled or no resting Offer meets your price. Whatever is left over becomes your own passive Offer on the book, waiting for a future trade to match it. If a matching seller had already been sitting on the book at a better rate, you can even end up paying less than your limit.
Two quirks are worth knowing. Trades only settle when a new ledger closes, roughly every three to five seconds, so the XRP Ledger is not built for high-frequency trading. And the order in which transactions execute within a ledger is deliberately unpredictable, which discourages front-running. It is a fair, batch-style market rather than a millisecond race.
The exchange also does not natively offer market orders, stop orders, or margin trading. Everything is built from limit-style Offers, so features common on a centralized venue either have to be approximated with custom token settings or simply are not available here.
Adding the AMM: liquidity pools since 2024
In March 2024, an amendment added automated market makers to the ledger (source: XRP Ledger, get ready for AMM). An AMM is a pool of two assets that quotes a price from a formula based on how much of each it holds, rather than matching buyers with sellers.
Anyone can create the pool for a pair that does not have one yet, or add funds to a pool that already exists. There can be at most one AMM per asset pair, and at most one of its two assets can be XRP. When you deposit into a pool you become a liquidity provider and receive LP tokens representing your share. Those tokens can be redeemed later for your slice of the pool plus a cut of the fees it earned. Each AMM charges a trading fee between 0 percent and 1 percent, and the liquidity providers themselves vote on that fee in proportion to the LP tokens they hold (source: XRP Ledger, automated market makers).
The pricing is the standard pooled model used across decentralized finance: as a trade draws down one asset, that asset gets more expensive, so bigger pools give better rates because each trade moves the balance less (source: Coinbase, what is an automated market maker). The deep mechanics of that formula belong to the general guide on AMMs; here the point is simply that the XRP Ledger has one built in.
How the order book and the AMM work together
This is where the XRP Ledger differs from most exchanges. When you place an Offer or send a cross-currency payment, the ledger checks both the order book and the relevant AMM pool, then routes your trade to whichever gives the better price, or splits it. You do not choose; the protocol optimizes each trade.
Crucially, the AMM is optional, not the engine. Many decentralized exchanges rely entirely on AMM pools to function. On the XRP Ledger the order book works on its own, and the AMM is extra liquidity layered on top. If a pool offers a worse rate than resting Offers, your trade simply uses the order book instead, and the reverse is also true.
You can confirm this after the fact: a transaction's metadata records exactly what liquidity it consumed, whether resting Offers, an AMM pool, or a mix of the two. For a trader the practical upshot is that you get the best available price across both sources without having to watch two venues yourself, which is the main reason the two systems were designed to run together rather than compete.
What makes XRPL's exchange distinctive
Beyond having both systems at once, the AMM has a feature most other designs do not: a fee auction slot. A liquidity provider can bid LP tokens to win a 24-hour slot that cuts its own trading fee to one tenth of the normal rate, which rewards active arbitrage traders.
The point of that slot is to hand more of the value from arbitrage back to liquidity providers and to help keep the pool's prices in line with the wider market. It is a mechanism you will not find on most automated market makers, and it is unique to the XRP Ledger's design.
Two other traits stand out. Because the exchange is part of the protocol, there is no separate smart contract to trust and no gas token to buy; trades pay only the ledger's tiny burned fee. And fee-setting is genuinely in the hands of the people providing the liquidity, through the LP vote, rather than being fixed by a platform.
The risks and limits to know
None of this removes ordinary market risk. If you provide liquidity to an AMM, you take on impermanent loss: when the two pooled assets drift apart in price, you can end up worse off than simply holding them (source: Gemini, automated market makers). The trading fees are meant to offset that, but they do not guarantee it.
There is token risk too. Anyone can issue a token and list it on the exchange, so a ticker alone means nothing; always check the issuer before you trade. If you want to provide liquidity as a way to earn, weigh it against the plainer options in XRP staking and earn explained, and remember that the on-ledger exchange, for all its features, is still a market where you can lose value.
Frequently asked questions
Do I have to use the AMM to trade on the XRP Ledger?
No. The XRP Ledger's order book works on its own and predates the AMM by over a decade. When you trade, the protocol automatically compares the order book and the relevant AMM pool and uses whichever gives the better price, or a mix of both. The AMM is extra liquidity, not a requirement for trading.
What are LP tokens and the AMM trading fee?
LP tokens represent your share of a liquidity pool. When you deposit two assets into an AMM, you receive LP tokens, and you can later redeem them for your share of the pool plus a portion of the fees it earned. Each pool charges a trading fee between 0 percent and 1 percent, which its liquidity providers set by vote.
Is trading on the XRP Ledger's DEX safe?
The exchange itself is part of the protocol and does not hold your funds, but trading still carries risk. Anyone can issue a token, so a familiar ticker can be worthless; check the issuer first. Providing liquidity exposes you to impermanent loss, and there are no native stop or market orders to limit downside automatically.
Researched and written for the BloFin Academy. This article is educational and is not financial, investment, or legal advice. Always do your own research.
