Cohort ended · self-paced
advanced 60 min

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.
Complete this module by mentor review. Jump to assessment

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.

Assignments

0 of 1 complete