The XRP Ledger added native AMM pools in 2024 (amendment XLS-30d). Unlike Uniswap pools on Ethereum, these are part of the protocol itself — no smart contract, no separate DEX router. The order book and the AMM compete on every trade, and the ledger routes to whichever gives the better price.
This guide shows how to find pools, read their reserves, check LP positions and get swap quotes — all from one free API.
1. List AMM pools by TVL
Request
curl "https://api.xrpl.to/v1/amm/pools?sortBy=tvl&sortType=desc&limit=5" Response (trimmed)
{ "success": true, "pools": [ { "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "asset1": { "currency": "XRP" }, "asset2": { "currency": "USD", "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq" }, "tvl": 285000.42, "lpTokenBalance": "1523456.789", "tradingFee": 500, "auctionSlot": { ... } } ] } tvl is the pool's total value locked in USD. tradingFee is in basis points (500 = 0.5%).
2. Get a pool's reserves
Request
curl "https://api.xrpl.to/v1/amm/pool/XRP/USD+rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq" The response includes both sides of the pool, the current LP token supply and the pool's trading fee.
You can also query the XRPL node directly:
curl -X POST https://s1.xrpl.stream \ -H "Content-Type: application/json" \ -d '{ "method": "amm_info", "params": [{ "asset": {"currency": "XRP"}, "asset2": {"currency": "USD", "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"} }] }' Important: amm_info returns the pool's assets in its own order. Identify the XRP side by its shape: XRP amounts are plain strings in drops (like "285000000"), token amounts are objects with currency, issuer and value.
3. Get a swap quote
The xrpl.to API includes a quote endpoint that finds the best route across the order book and AMM:
Request
curl "https://api.xrpl.to/v1/dex/quote?from=XRP&to=USD+rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq&amount=100" Response
{ "success": true, "from": "XRP", "to": "USD+rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", "amount": 100, "rate": 1.09, "output": "109.19", "paths": [...], "source": "amm+orderbook" } The ledger finds the cheapest path itself. source tells you whether it used the AMM, the order book or both.
4. Track LP positions
Each LP position is an XRP Ledger trust line to the pool's LP token. The token list includes LP tokens:
curl -X POST https://api.xrpl.to/v1/search \ -H "Content-Type: application/json" \ -d '{"search": "LP XRP/USD"}' 5. OHLC candles for LP tokens
LP tokens have their own price history:
curl "https://api.xrpl.to/v1/ohlc/{lp_token_md5}?interval=1d&limit=30" This shows whether the LP token appreciated or depreciated over time — useful for tracking impermanent loss.
How XRPL AMMs differ from Ethereum
| Feature | XRPL AMM | Uniswap v3 |
|---|---|---|
| Deployment | Native protocol amendment | Solidity contract |
| Fee | Set at pool creation (0–1%) | 0.01%, 0.05%, 0.3%, 1% |
| Concentrated liquidity | No | Yes |
| Routing | Automatic (AMM + order book) | External router |
| Settlement | 3–5 seconds | 12 seconds |
| Transaction cost | 12 drops (~$0.00003) | Variable gas |
| Auction slot | Yes (continuous auction) | No |
The continuous auction slot lets arbitrageurs bid for the right to trade at a reduced fee for 24 hours. The bid goes to LP holders, adding yield.
Resources
- API docs: xrpl.to/docs
- AMM pool rankings: xrpl.to/pools
- AMM protocol spec: xrpl.build/docs/concepts/tokens/decentralized-exchange/automated-market-makers
- Full-history node: xrpl.stream
Data by xrpl.to — the free XRP Ledger data API.