Cohort ended · self-paced
advanced 30 min

Advanced XRPL payment mechanics

Control what a sender may spend, what a recipient must receive, which paths may be used, and how the delivered result is verified.

What you'll learn

  • Model XRP and issued-currency amounts correctly.
  • Explain SendMax, DeliverMin, Paths, and partial-payment behavior.
  • Recognize how trust lines, rippling, transfer rates, and liquidity affect a path.
  • Verify delivered_amount from validated metadata.
Complete this module by a quiz. Jump to assessment

A payment is a conversion with limits

Amounts come in two shapes. An XRP amount is a plain string of drops, like "3000000" for 3 XRP (1 XRP is 1,000,000 drops). An issued-currency amount is an object with a currency, an issuer, and a value, like { currency: "USD", issuer: "rIssuer...", value: "10" }. Identify a token by both currency and issuer, since two issuers can each mint their own USD.

A cross-currency payment carries two limits:

  • Amount — what should arrive. Say, 5 TST to the recipient.
  • SendMax — the most it may cost you. Say, 3 XRP.

The route between those two assets is a path: a chain through trust lines, order-book offers, and AMM pools. When you ask the network for a path you get a quote, and the market can move before your payment lands, so treat it as an estimate rather than a booking.

Protecting the payment

Suppose you want 5 TST delivered, are willing to spend up to 3 XRP, and would take a slightly smaller fill over an outright failure if the price drifts:

  • Set the partial-payment flag (tfPartialPayment) so the payment can deliver less than 5 TST rather than fail.
  • Set DeliverMin to your floor, say 4.9 TST. Skip it and a partial payment could legally deliver almost nothing.
  • Once it validates, read delivered_amount from the metadata to see what truly arrived. The requested Amount is what you asked for; with partial payments the two can diverge, so report the delivered value.

LastLedgerSequence puts a deadline on the payment: past that ledger it can no longer succeed, which stops a stale quote from executing much later at a surprising price. Trust-line limits, frozen lines, transfer fees, and shifting liquidity can each throttle or block a path, so before every submission, ask which limit is most likely to bite.

Assignments

0 of 1 complete

Unlocks

Finishing this module opens up: