Lesson 6 of 11 · Tokens and NFTs · about 6 minutes

Swap and trade

The XRP Ledger has a marketplace built right in. Post an offer, or swap with a shared pool.

  • The marketplace
  • Shared pools
  • Swaps
Astro Bear at a trading board with buy and sell offers.
1 · Built in

A marketplace inside the ledger

The XRP Ledger has its own trading board, called the DEX. People post offers like "I will trade 10 of this for 20 of that". When two offers match, the ledger swaps them.

No company runs it. The ledger does.

An order board with buy offers on the left and sell offers on the right. Two matching offers meet in the middle and swap coins.Want to buyWant to sell10 for 410 for 610 for 510 for 510 for 610 for 4ABMatching offers trade with each other
Buy and sell offers sit on a board. Matching ones trade.
2 · Your offer

Post an offer and wait

An offer can wait on the board until someone takes it. You can cancel it anytime before it fills.

When it fills, both sides swap at the same moment. Nobody can take one half and run.

You post an offer on the board, a trader's coin arrives while yours leaves, and the row turns green and says filled.YouGive 10 TESTWant 5 PUSDPTFILLEDTraderPost one offer. Someone matches it. It fills.
Post one offer and watch it fill.
3 · Shared pools

Swap with a pot of two tokens

An AMM pool is a shared pot of two tokens. You put one in and take the other out. The price comes from how much of each is in the pot.

Big swaps move the price more. That change is called slippage.

A coin A goes into the AMM pool and a different coin B comes out the other side, which is a swap.AMM poolAABBAyou add AByou get BSwap against a shared pot of coinsPrices move as the pot changes, and a small fee applies
Coins go into the pool and a different coin comes out.
4 · Adding to a pool

Get a receipt for your share

People can add both tokens to a pool. They get a receipt token for their share and earn a small part of each trade.

Prices can move, so you could get back a different mix than you put in. This is education, not financial advice.

Two coins go from your wallet into the pool and a gold LP token receipt comes back as proof of your share.YouPoolABLP tokenmy shareAdd two coins, get a receipt for your share
Add coins and get an LP token, a receipt for your share.

Try it: post an offer, then use a pool

Two short practices. First, post one offer on the marketplace and watch it fill. Then make a shared pool and swap with it. Free test coins, no real money. It makes throwaway test wallets in this page and never shows or asks for a secret.

Mini game: Board or pool?

Eight cards. Is it the order board or a shared pool?

Quick check: 3 questions

Get all 3 right to finish Lesson 6. Try as many times as you like.

Optional: the 4-panel comic for this lesson

Who is who: ☽︎ Luna, the Moon☉︎ Sol, the Sun♁︎ Gaia, the Earth

1
I want to swap my test XRP for practice tokens.
2
Post an offer on the board and wait.
3
Or swap with the shared pool right now.
4
Swapped in seconds. Both sides at once!

Just for fun. You do not need it to finish. Download the comic