arrow-left Course Hub
Lesson 2: Trading value on the XRPL’s decentralized exchange (DEX)
Estimated reading time:

15 minutes

Difficulty:

Beginner

Key takeaway:

  • The XRPL was the first blockchain to feature a built-in decentralized exchange (DEX).
  • You can make offers to trade any type of token without a middleman.
  • Autobridging and pathfinding help users optimize trades by identifying the best exchange rates and the most efficient path for a trade.
Lesson 2

Trading value on the XRPL’s decentralized exchange (DEX)

Swap what you have for what you want

Having tokens isn’t very useful unless you can trade them. Luckily, the XRP Ledger (XRPL) was the first blockchain to feature a built-in decentralized exchange (DEX). This means you can trade XRP or tokens without having to send them to a centralized exchange.

The XRPL DEX is trustless—you don’t have to worry about losing assets to hacks or thefts. The DEX is also non-custodial, meaning that you retain full control of your assets at all times.

So, what can you trade on the XRPL DEX?

You can trade any asset that is held inside your XRP wallet, including, but not limited to:

Example trade on the XRPL DEX

Imagine you run a learning club and decide to tokenize memberships.

You exchange a one hour session for 1 LEARN token. You only want to trade LEARN tokens for USD but you receive an offer to purchase the membership with tokenized gold. The XRPL is able to facilitate this transaction using ‘auto bridging’ or ‘pathfinding’.

What is auto bridging?

Auto bridging uses XRP as an intermediary asset to find the best exchange rate. This is most helpful when an asset does not have enough liquidity to transact at competitive rates.

What is pathfinding?

Pathfinding uses a series of assets to “hop” from one currency or form of value to another, finding the most cost-effective path to convert tokens from one cryptocurrency to another. For example, if a seller wanted to trade their XRP for tokenized gold, pathfinding may find that the optimal path for this conversion is to first trade XRP for USD, and then trade that USD for tokenized gold.

‘Bids’ and ‘asks’ on the XRPL DEX

XRPL DEX exchange ‘bid’ and ‘ask’ system

Just like with a centralized exchange, the XRP DEX uses a ‘bid’ and ‘ask’ system.

What is a bid (buy offer)?

A bid, also known as a buy offer, is the designated price a buyer specifies they want to buy an asset at or below.

What is an ask (sell offer)?

An ask, or sell offer, is the designated price a seller wants to sell an asset at or above.

Example bid and ask order on the XRPL DEX

Assume the current price of XRP is $0.50. If a seller wants to sell their XRP for $0.60, they would place an ask order at $0.60 on the DEX. If a buyer wanted to buy XRP for $0.40, they would place a bid order at $0.40 on the DEX.

All bids and asks for each asset are tracked in an order book on the ledger. This feature improves market transparency and allows you to quickly see the best prices available for each asset.

Additional decentralized exchange (DEX) resources

END OF LESSON

Now that you know the basics of how to trade on the XRPL DEX, see if you can answer these questions.

What is an ask?
What is the order book?
How does pathfinding work?
How does auto-bridging work?
What is a DEX?