DEV Community

Jerome Barton
Jerome Barton

Posted on

How Liquidity Providers Earn Fees on a DEX: Swap to Exit

In a V2-style AMM pool, swap fees stay in the reserves and increase LPs’ proportional claim, which they realize by burning LP tokens.

The swap fee stays in the pool

Take a swap of 1 ETH into a pool charging 0.30%: 0.003 ETH is the fee component, and it remains in the pool’s reserves. The swapper receives fewer tokens out than they would without the fee; LPs do not receive an immediate ETH payment to their wallets.

Fraxswap pair contracts follow the V2 design, so fees compound automatically into the reserves. To see how the reserve claim begins, read adding liquidity to a Fraxswap pool step by step.

Think of LP tokens as a receipt for a proportional share of a joint account. The fee increases the account balance, so the receipt can represent a larger claim; unlike a bank receipt, its value also changes with the pool’s token balances and prices.

Burning LP tokens realizes the accumulated fees

In a V2-style pool, fees are realized when LP tokens are burned: the pair returns each underlying token in proportion to the holder’s share of the reserves at that moment. A practitioner tracks the LP token balance and current reserves, because the withdrawal is paid in the pool’s tokens, not as a separate fee ledger.

  • Swap input: The pool receives the input, including its fee component.
  • Reserves: The fee stays in the pool and compounds with later swaps.
  • LP token: It represents a share of the pool, whose reserves have grown.
  • Burn: The pair redeems the token for the holder’s proportional share of both reserves.

Uniswap v3 handles fees differently: it tracks them separately from the position’s liquidity, and the position owner must collect them. That distinction matters when comparing a displayed position value with withdrawable tokens.

The V2 protocol fee switch mints a share later

When Uniswap V2’s protocol fee switch is on, the protocol receives 1/6 of fee growth through newly minted LP tokens. The pair calculates that growth when liquidity is next added or removed, then mints tokens to the protocol fee recipient; it does not divert that share from each swap into a separate wallet at swap time.

The new tokens give the protocol a share of the pool and slightly dilute existing LPs’ ownership percentages. The pool reserves still hold the swap fees, but each existing LP token represents a slightly smaller fraction after the mint. With the switch off, this protocol mint does not occur.

Three LP questions follow the fee flow

Fees can offset impermanent loss, app APR is an estimate, and tax timing depends on jurisdiction and circumstances.

Do fees offset impermanent loss?

They can: accumulated fees increase the pool assets available to LPs and may compensate for losses caused by changing token prices. Whether they fully offset impermanent loss depends on trading volume, fee rates, pool prices, and how long liquidity stays deposited.

How is the fee APR shown in an app calculated?

An app generally annualizes recent fee revenue against a measure of liquidity or position value. The displayed APR depends on its time window and assumptions; past volume and fees can change, so the figure is not a fixed return.

Are LP fees taxable when earned or when withdrawn?

Tax treatment varies by jurisdiction and by the rules applied to the specific position. Keep records of deposits, collections, burns, and token values, and check the applicable local rules with a qualified tax professional.

Top comments (0)