Capstone: XRPL liquidity and trade console
Combine market discovery, protected quoting, transaction execution, validation, and reconciliation in one reviewable TypeScript console.
Prerequisites
Complete these before starting this module:
What you'll learn
- Load and compare order-book and AMM liquidity.
- Build a quote with explicit size, freshness, and slippage constraints.
- Execute and verify a controlled Testnet trade.
- Reconnect and display each validated event once.
How the provided code works
The read-only helper gives you sample order-book and AMM liquidity, plus (for the live checkpoint) functions that load real liquidity, submit a protected trade, and reconcile after a reconnect. When you press Run in the default mode, it works entirely from the sample data so you can build and demo the whole console without the network.
Your job is to bring the pieces together: produce a protected quote from the available liquidity, and make sure each validated transaction is shown only once. The console prints the quote and the result as JSON.
Build the complete loop
Your console must accept trade side, size, and maximum slippage. It loads funded order-book depth and AMM state, identifies the source or combination used for the indication, and displays unit price, spread or impact, quote ledger, and age. It refuses stale, unavailable, underfunded, or over-slippage quotes with an explicit reason.
For execution, construct the appropriate protected Payment or Offer transaction, retain its hash, submit it, and wait for a validated outcome. Print requested, quoted, and delivered values; fee; balance changes; engine result; hash; and a Testnet Explorer URL. On reconnect, reconcile with account_tx and suppress a transaction already displayed.
The starter defaults to fixture mode so the full application can be demonstrated during an outage. Live mode must preserve the same quote and result interfaces. Submit the multi-file project for mentor review and prepare a two-minute demonstration: one success, one intentional rejection, and one design limitation you would address before production.
Resources
XRPL decentralized exchange
reading· xrpl.org
Offers
reading· xrpl.org
book_offers API
reference· xrpl.org
OfferCreate transaction
reference· xrpl.org
OfferCancel transaction
reference· xrpl.org
Automated market makers
reading· xrpl.org
amm_info API
reference· xrpl.org
AMMDeposit transaction
reference· xrpl.org
AMMWithdraw transaction
reference· xrpl.org
Transaction results
reference· xrpl.org
Finality of results
reading· xrpl.org
Secure signing
reading· xrpl.org
account_tx API
reference· xrpl.org
Get started with xrpl.js
tutorial· xrpl.org
xrpl.js API reference
reference· js.xrpl.org
XRP Testnet faucet
tool· xrpl.org
Testnet Explorer
tool· testnet.xrpl.org
Public XRPL servers
reference· xrpl.org
Assignments
0 of 1 complete