XRPL's Native AMM: How Automated Market Making Works On-Ledger
The XRP Ledger shipped a native automated market maker in 2024 — built directly into the protocol layer, not a smart contract layered on top. Here's what that distinction means for liquidity, token issuers, and traders.
This article is for informational purposes only and does not constitute financial, legal, or investment advice.
What Is an AMM, and Why Does It Matter?
An automated market maker is a protocol that replaces the traditional order book with a mathematical formula. Instead of buyers and sellers posting bids and asks, liquidity providers deposit paired assets into a pool. The pool's pricing algorithm — most commonly a constant product formula — sets the exchange rate automatically based on the ratio of assets in the pool.
The concept was popularized by Uniswap on Ethereum in 2018, but the XRP Ledger has had a native decentralized exchange with order books since its genesis in 2012. The AMM amendment, activated on the XRPL mainnet in 2024, adds a second liquidity mechanism to a ledger that already had one — and the combination creates something meaningfully different from anything in the DeFi ecosystem.
XRPL AMM vs Uniswap: Key Differences
Most people familiar with DeFi think of AMMs in terms of Uniswap's architecture. You deploy a smart contract, deposit token pairs, and the contract handles everything. The XRPL AMM works differently at nearly every level.
| Feature | Uniswap (Ethereum) | XRPL AMM |
|---|---|---|
| Implementation | Smart contract | Native ledger amendment |
| Gas/Fees | Variable, often high | ~$0.0002 flat per transaction |
| Settlement | ~12 seconds (post-merge) | 3–5 seconds |
| Fee capture | LP token holders | LP token holders (AMM account) |
| Order book coexistence | No (separate venues) | Yes — AMM and DEX unified |
| Impermanent loss | Yes | Yes, but auction slot mechanism mitigates |
The most significant architectural difference is that XRPL's AMM is not a smart contract — it is a first-class citizen of the protocol. This means it cannot be exploited via reentrancy attacks, flash loan manipulation of a single smart contract's state, or other EVM-specific attack vectors. The ledger's consensus mechanism validates AMM transactions with the same finality as any other transaction type.
The Continuous AMM Model
XRPL's AMM uses the geometric mean market maker (G3M) formula rather than the simpler constant product (x·y=k) used by Uniswap v2. The G3M is more capital efficient for assets that don't have a 50/50 natural weighting.
Every AMM pool on XRPL is associated with a special AMM account — an on-ledger account that holds the pooled assets. Liquidity providers receive LP tokens representing their proportional share of the pool. These LP tokens can themselves be traded, held, or used in other XRPL features like escrow.
The Auction Slot Mechanism
One of XRPL's innovations is the auction slot — a feature that allows arbitrageurs to bid for priority access to execute trades against the pool at a discounted fee for a 24-hour window. This mechanism accomplishes two things:
- It creates a competitive market for arbitrage rights, directing value back to LP token holders rather than to miners or validators
- It tends to keep the AMM pool more accurately priced because arbitrageurs have strong incentive to win and then use the slot
When a trader wins an auction slot, they pay a fee that goes into the pool itself, effectively boosting LP returns. This is a meaningful improvement over Ethereum's MEV (maximal extractable value) environment, where arbitrage profits accrue to block proposers rather than liquidity providers.
How Liquidity Pools Work on XRPL
Creating an AMM pool on XRPL requires an AMMCreate transaction. The creator specifies the two assets and an initial trading fee (between 0% and 1%). Once the pool is live, anyone can provide liquidity via AMMDeposit or withdraw via AMMWithdraw.
Single-Asset vs. Dual-Asset Deposits
XRPL's AMM supports both single-asset and dual-asset deposits, giving liquidity providers flexibility. A single-asset deposit is convenient but typically incurs a small price impact because the protocol internally swaps half the deposit to rebalance the pool. Dual-asset deposits at the current pool ratio are more capital efficient and incur no internal swap.
LP Token Accounting
LP tokens on XRPL are standard issued currencies — they live in the same trust line infrastructure as any other XRPL token. This means LP positions are native assets on the ledger, not some separate accounting ledger. An LP token holder can check their position with any XRPL wallet that reads trust lines.
The DEX + AMM Hybrid: Better Execution
Here is where XRPL's approach diverges most sharply from the Ethereum DeFi ecosystem. XRPL has had a native order-book DEX since 2012. The AMM does not replace it — the two coexist and are unified in the pathfinding engine.
When a trader submits a Payment or an OfferCreate transaction, the XRPL pathfinder evaluates both the order book and any relevant AMM pools simultaneously, routing through whichever combination gives the best execution. This means a trade might be partially filled from the order book and partially from the AMM pool — the ledger handles the split automatically.
"XRPL doesn't ask you to choose between an order book and an AMM. It uses both at once and routes your trade through whichever path gives better pricing. No other major ledger does this natively."
Token Issuer Implications
For issuers of XRPL tokens — whether fungible tokens representing real-world assets, stablecoins, or utility tokens — the AMM introduces both opportunities and responsibilities.
Bootstrapping Liquidity
Historically, the challenge for a new XRPL token issuer was that liquidity required market makers willing to post two-sided order book quotes. The AMM dramatically lowers this barrier. An issuer can seed an AMM pool with a relatively small amount of XRP and their issued token, and that pool will immediately begin quoting prices to anyone who interacts with it.
Fee Revenue and Treasury Management
If an issuer seeds their own AMM pool and retains LP tokens, they earn a proportional share of all trading fees generated by the pool. Depending on trading volume, this can constitute meaningful recurring revenue that does not require active market making. Some issuers treat this as a treasury management strategy — hold LP tokens, earn fees, and rebalance periodically.
Transfer Fee Interactions
XRPL allows token issuers to set a transfer fee on their issued currency — a percentage taken from every transfer. This fee applies to AMM swaps just as it applies to any other transfer of the issued token. Issuers considering AMM liquidity should carefully model how their transfer fee affects pool economics, because a high transfer fee can make the AMM pool uncompetitive relative to the order book or external venues.
Trust Line Requirements
Users must have trust lines established for any non-XRP token before they can hold it. This applies to LP tokens as well. Anyone wanting to provide liquidity to an XRP/TokenX pool must have an open trust line for TokenX. This is not a barrier for existing holders, but it is a consideration when designing onboarding flows for new users.
Impermanent Loss on XRPL
Impermanent loss — the opportunity cost of holding LP tokens versus holding the underlying assets directly — is a reality on XRPL just as on any AMM. If the price of an asset in the pool moves significantly in one direction, LP token holders will hold a less favorable ratio of assets than they would have if they had simply held their position.
The auction slot mechanism partially mitigates this by directing arbitrage profits back to the pool, effectively compensating LPs for some of the rebalancing that creates impermanent loss. But it does not eliminate it. Token issuers and liquidity providers should model expected impermanent loss at various price displacement scenarios before committing significant capital to a pool.
Practical Considerations for Getting Started
- Verify your token is issued correctly — AMM pools can only be created for tokens that already exist on the ledger with active trust lines
- Choose your initial fee carefully — the trading fee is set at pool creation. Higher fees protect LPs from impermanent loss but discourage volume
- Seed with sufficient depth — a pool with very little liquidity will have high price impact on even small trades, deterring users
- Monitor the auction slot — if the slot is consistently being won, it signals healthy arbitrage activity and should translate to reasonable LP returns
- Account for transfer fees — if your token has a non-zero issuer transfer fee, factor that into your pool fee modeling
The Bigger Picture
XRPL's AMM is not a copy of Uniswap transplanted to a faster chain. It is a new primitive that fits natively into a ledger that was already running a DEX, an escrow system, and a trust line–based token issuance framework before most people had heard the word "DeFi."
For token issuers, the AMM represents a genuine upgrade in how they can think about secondary market liquidity. For traders, it represents tighter spreads and better execution through unified routing. And for the XRP Ledger ecosystem broadly, it completes a financial infrastructure stack that no other blockchain has assembled at the protocol layer.
Issue Tokens on XRPL
OnrampDLT provides non-custodial token issuance infrastructure on the XRP Ledger.
Explore OnrampDLT →