DEV Community

Cover image for Uniswap V3: When collect() Is More Than “Collect Fees”
decoder man
decoder man

Posted on

Uniswap V3: When collect() Is More Than “Collect Fees”

Uniswap V3 introduced concentrated liquidity, NFTs for positions, and a much more expressive — but also more subtle — event model.

One consequence of this design is that on-chain events can be perfectly correct, yet still semantically confusing for end-users.

A common example is the Collect action.

The Common Assumption

For many users (and even some dashboards):

collect() = collect earned fees

What Actually Happens in Uniswap V3 when user fully exits a position

A Uniswap V3 position is an NFT that tracks:

  • liquidity
  • fee growth inside the tick range
  • last fee checkpoints

When a user wants to exit a position, the flow usually looks like:

  • event: burn - emit with leftover liquidity amount
  • event: collect fee - emit with leftover liquidity amount + fees earned ( the magic thing is here )

From the protocol’s point of view, this is perfectly valid:

everything owed to the position is paid out

all values are emitted correctly in event logs

But semantically, fees and principal are very different concepts.

Why Explorers Look “Misleading” (But Aren’t Wrong)

Most explorers (Etherscan included) do the right thing at the log level:

  • Decode Collect events faithfully
  • Display the amounts emitted by the contract
  • Label the action according to the function/event name

The problem is not decoding accuracy.

The problem is that:

  • Log-level correctness ≠ user-level semantic clarity

For an end-user, seeing:

  • Collect: 21.12 USDT

raises a very different interpretation than:

  • Fees earned: 21.12 USDT
  • Liquidity returned: 201,762.98 USDT

Etherscan
Sample transaction:
https://etherscan.io/tx/0x77613b2370de015fdf904effea3da3671ead1284279be7b5e0138d3409c51069

Why This Is Harder Than It Looks

You cannot reliably separate fees vs liquidity by:

  • decode a single event

To do this correctly, you need to:

  • decode all event logs in the transaction
  • detect remove liquidity event, collect fee event
  • extract "Liquidity return" of collect fee earned amount

Remove Liquidity Event

Collect fee event

A Broader Takeaway for On-Chain Data

Events remain low-level and composable

Meaning emerges only when state is reconstructed

UX gaps grow between “what happened” and “what users think happened”

For data builders, this is a reminder:

Accurate decoding is the baseline.
Semantic decoding is where real understanding begins.


About txdecoder.xyz


Transaction decoding API — standardizing blockchain data into one unified, readable schema on Ethereum, Base, BSC, Solana

Website: https://txdecoder.xyz/
X: https://x.com/txdecoder_xyz
Telegram: https://t.me/txdecoder
Telegram channel: https://t.me/txdecoder_announcements
Blog: https://medium.com/@txdecoder

Top comments (0)