Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify trading fees #2902

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ Liquidity providers can vote to set the fee from 0% to 1%, in increments of 0.00

Each AMM gives its liquidity providers the power to vote on its fees, in proportion to the number of LP tokens they hold. To vote, a liquidity provider sends an [AMMVote][] transaction. Whenever anyone places a new vote, the AMM recalculates its fee to be an average of the latest votes, weighted by how many LP tokens those voters hold. Up to 8 liquidity providers' votes can be counted this way; if more liquidity providers try to vote, then only the top 8 votes (by most LP tokens held) are counted. Even though liquidity providers' share of LP tokens can shift rapidly for many reasons (such as trading those tokens using [Offers](offers.md)), the trading fees are only recalculated whenever someone places a new vote (even if that vote is not one of the top 8).

{% admonition type="info" name="Note" %}
oeggert marked this conversation as resolved.
Show resolved Hide resolved

_Trading fees_ differ from _transfer fees_.

| Differences | AMM Trading Fees | Token Transfer Fees |
|-------------|------------------|---------------------|
| Who sets the fee? | AMM liquidity providers. | Token issuer. |
| When does the fee apply? | When swapping against the AMM. | Any time the token transfers accounts, except when sending or receiving _directly_ to and from the token issuer. |
| Can fees be redeemed? | Yes, by liquidity providers when they turn in their LP tokens. | No, fees are burned. |

{% /admonition %}

### Auction Slot

The XRP Ledger's AMM design includes an _auction slot_. A liquidity provider can bid LP Tokens to claim the auction slot to receive a discount on the trading fee for a 24-hour period. The LP tokens that were bid are returned to the AMM.
Expand Down