Term · Trading and DeFi

Constant product

In plain words

Constant product is the name of a formula that automated market makers, or AMMs, often use to set prices. The AMM on the XRP Ledger functions like a constant product market maker.

Written by zerps in plain words, from the source linked below.

In plain words

In an AMM, a mathematical formula sets the price at which currencies are exchanged. The price is based on the supply and demand of the currencies involved. Constant product is an algorithm that AMMs often use for this.

How it works

The XRP Ledger implements a geometric mean AMM with a weight parameter of 0.5. With that weight it functions like a constant product market maker. The weights of the two assets are currently always 1 to 1, so they cancel out in the calculation.

The swap calculation

The AMM swap formula takes the amounts of both assets in the pool before the swap and the trading fee. From these it gives the amount of one asset that must be swapped in to receive a target amount of the other.

Source: xrpl.org, xrpl.org, xrpl.org. Read 6 December 2026.

Zerpedia states what the source says, in plain words, and gives no opinion. How Zerpedia is made

zerps Trading tokens on the XRP Ledger carries risk, including total loss. zerps is a self-custodial interface; it does not hold funds, give advice, or execute trades on your behalf.