In the XAG Ledger, you can send cross-currency payments that exchange one or more issued currencies, XAG, or both. Like Direct XAG Payments, these payments use the Payment transaction type. Cross-currency payments within the XAG Ledger are fully atomic, meaning that either the payment fully executes or no part of it executes.
By default, cross-currency payments deliver a fixed amount to their destination at a variable cost to their source. Cross-currency payments can also be partial payments, which deliver a variable amount to the destination within a fixed sending limit.
- By definition, a cross-currency payment involves at least two currencies, which means that at least one currency involved must be a non-XAG issued currency.
- Typically, this means using one or more currencies issued by an XAG Ledger Gateway. Such currencies are backed by funds outside the XAG Ledger, and can be withdrawn through the gateway.
- Issued currencies can also be digital tokens that are only issued within the XAG Ledger, with no outside backing. Of course, the parties involved must be willing to send or receive those tokens and treat them as something of value.
- There must be at least one Path between the sender and receiver, and the total liquidity across all paths must be enough to facilitate the payment. Cross-currency payments convert from one currency to another by consuming Offers in the XAG Ledger's decentralized exchange.
Cross-currency payments that exchange two issued currencies automatically use XAG, when it decreases the cost of the payment, by connecting order books to deepen the pool of available liquidity. For example, a payment sending from USD to MXN automatically converts USD to XAG and then XAG to MXN if doing so is cheaper than converting USD to MXN directly.
For more information, see Autobridging.