DeFi Insights on the XRP Ledger
The building blocks of decentralized finance native to the XRP Ledger: XRP & Issued Tokens (IOUs), Trustlines, the protocol-level Decentralized Exchange (DEX), with the Central Limit Order Book (CLOB), Automated Market Maker (AMM), and Pathfinding.
What you'll learn
- What separates native XRP from issued tokens (IOUs), and why every token has an issuer and a currency code.
- How a trust line lets you opt in to holding a token and caps your exposure to its issuer.
- How the protocol-native decentralized exchange works, and why a single shared on-chain order book matters.
- How auto-bridging and pathfinding route a trade across currencies and issuers to find a price.
- How the automated market maker complements the order book, and how the protocol picks the better price.
Overview
You've seen how a transaction changes the ledger, and you've moved value with a payment. This final module turns to what the XRPL was built for: a whole financial system, decentralized finance (DeFi), running natively inside the protocol. There are no smart contracts to deploy and no exchange to integrate. The pieces are already there.
By the end you'll know how the ledger carries assets beyond XRP, how trust lines let you choose which ones you hold, and how the built-in exchange, its routing, and its automated market maker fit together into an on-chain marketplace.
Native XRP versus issued tokens
XRP is the one asset native to the ledger, tracked directly in every account's balance and holdable without anyone's permission. But the XRPL is also built to carry issued tokens (often called IOUs, from “I owe you”: each token is a promise from its issuer): currencies, stablecoins, reward points, any asset an account chooses to issue. A token always has an issuer (the account that created it) and a currency code (such as USD or EUR). The same code from two different issuers is two different assets: USD from one issuer is not automatically interchangeable with USD from another.

A simple mental model separates the two:
- XRP is cash in your own pocket. Universally accepted, it owes nothing to anyone.
- An issued token is a balance with a specific counterparty you have chosen to trust, up to a limit you set.
Native XRP is held directly in every account, while issued tokens (IOUs) are balances tied to an issuer and a currency code.
Trust lines: opting in to a token
Because an issued token is a claim against its issuer, you can't receive one from just anyone. That would let strangers spam your account with worthless tokens. Instead you opt in by creating a trust line: a ledger object that says "I am willing to hold up to this much of this currency from this issuer." It records your balance with that issuer and caps your exposure to it.
A trust line is an object your account owns, so it counts toward the owner reserve you met earlier: choosing to hold a token is a deliberate, on-ledger act, not something that can happen to you by surprise. This is what lets one ledger move both its native asset and a whole economy of issued currencies, the foundation for the exchange you'll meet next.

A trust line is an opt-in ledger object that lets an account hold a chosen currency from a chosen issuer up to a set limit.
Rippling: how token balances move
Because an issued token is just a balance on a trust line between the issuer and a holder, tokens never really leave the issuer's books. When one holder pays another holder of the same token, the value moves indirectly: the issuer's balance with the sender decreases and its balance with the receiver increases by the same amount. That indirect movement across connected trust lines is called rippling, and it happens for any payment of a fungible token, with one exception: an issuer exchanging tokens directly with another account.
Nothing is created or destroyed along the way. In the example below, an issuer owes 60 USD in total, held as 50 by Holder A and 10 by Holder B. When A pays B 20 USD, A's balance falls to 30 and B's rises to 30. The issuer still owes the same 60 USD; only which holder owns the claim has changed.

Rippling settles a token payment between two holders by adjusting their balances with the shared issuer, leaving the issuer's total obligation unchanged.
The built-in decentralized exchange
Here's where the payments focus really shows. On most chains, trading one asset for another means deploying or calling a separate exchange contract. On the XRPL the decentralized exchange (DEX) is part of the protocol itself, the first on-chain DEX in the world, live since the ledger's early days. Any account can place an offer to trade one currency for another, and those offers rest in a single shared order book the whole network can see.

Because liquidity is consolidated in this one exchange rather than scattered across competing contracts, prices tend to be tighter. And because validators set transaction ordering rather than miners bidding for block space, the XRPL has no MEV (miner-extractable value: profit made on other chains by reordering the transactions inside a block) and front-running is extremely hard.
The protocol-native DEX: an on-chain order book with aggregated liquidity and no MEV or front-running, plus auto-bridging, pathfinding, and a native AMM.
Auto-bridging and pathfinding
Two features turn that order book into something more than a basic exchange:
- Auto-bridging: when two tokens have thin direct liquidity, the ledger can route through XRP as an intermediary (A to XRP to B) to find a better price, one of XRP's core jobs as a neutral bridge currency.
- Pathfinding: when no direct trade exists, the ledger assembles a path, a chain of hops across currencies and issuers, so the sender can pay in one asset and the receiver be paid in another.
Together they mean a payment and a trade are often the same operation. You specify what you want to send and what the receiver should get, and the ledger finds the route between them.
Auto-bridging routes a trade through XRP as a neutral bridge, while pathfinding chains hops across currencies and issuers to connect sender and receiver.
The automated market maker
The order book has one weakness: it needs someone on the other side. A brand new token starts with an empty book: no resting offers, nobody to trade against. The ledger's answer is a native Automated Market Maker (AMM): instead of waiting for a matching offer, you trade against a shared pool of two assets, and a formula prices every trade automatically.

An AMM has two roles. Liquidity providers deposit both assets into the pool and earn a share of the trading fees. Users swap one asset for the other and pay those fees. Anyone can take either role, and every deposit deepens the liquidity available to everyone.

With no offers to match, what sets the price? One simple rule: the pool's two balances, multiplied together, must stay constant (written x × y = k). When you swap, you put some of one asset in, and the rule decides how much of the other comes out. You can read it straight off the curve above: spending A tokens slides the pool to a new position where each extra A buys a little less B. Every trade moves the price, and a large trade in a small pool moves it a lot. That price impact is called slippage, and it is why deeper pools quote better prices.
One trade-off to know before providing liquidity with real value: if the two assets' prices drift apart after you deposit, your share of the pool can end up worth slightly less than if you had simply held both assets. This is called impermanent loss. The trading fees you earn are what offset it, and it fades if prices return to where they started.
The two systems are not rivals. They live in the same protocol, and when you trade, the ledger compares the order book against the matching AMM pool and executes against whichever gives the better price. The order book excels at precise limit orders, while the AMM guarantees there is always a counterparty, even for a pair no one is actively quoting.
The native automated market maker prices every trade with a constant product formula against a shared pool, and the protocol executes against whichever of the order book or the AMM offers the better price.
A quick wrap-up
In short, this module covered:
- XRP is the ledger's native asset; issued tokens (IOUs) are balances tied to an issuer and a currency code.
- You hold only the tokens you opt in to, by opening a trust line that caps your exposure to a chosen issuer.
- Token payments settle by rippling: balances shift across trust lines with the shared issuer, whose total obligation never changes.
- The decentralized exchange is part of the protocol: offers rest in one shared order book, with auto-bridging through XRP and pathfinding to route any payment.
- The native AMM prices trades from pooled liquidity with the constant product rule, and the ledger executes against whichever of the order book or the pool gives the better price.
Conclusion
That completes the picture: from your first funded account, through the transactions that change the ledger, to the payments and markets built on top of them. The XRPL gives you a working financial system out of the box, decentralized finance without a single smart contract, and it is the foundation the rest of the ecosystem builds on.
Resources
Assignments
0 of 2 complete