Reading Uniswap V3 Liquidity Positions and Estimating Uncollected Fees
Summary
This guide explains how a Uniswap V3 liquidity position is represented by an NFT and how to retrieve its details. It outlines a sequence of contract reads: obtain the position manager, enumerate the wallet’s position tokens, and query the position data associated with each token identifier.
The main calculation estimates fees earned but not yet collected. It combines global fee growth with fee growth outside the position’s lower and upper ticks, using the current tick to determine growth accrued below and above the position range. The resulting inside-range growth is compared with the position’s last recorded value and scaled by liquidity, then converted using each token’s decimals. The document supplies implementation-oriented contract and calculation examples, but offers no independent validation or error analysis. Results depend on correct contract data, tick state, fixed-width arithmetic, and token metadata; the method estimates accrued fees rather than demonstrating realized returns.
Key ideas
- Uniswap V3 liquidity positions are represented by NFTs managed through the NonfungiblePositionManager contract.
- A wallet’s position token identifiers can be enumerated and queried for their range, liquidity, and fee-growth state.
- Fee growth attributable to a position is derived by subtracting growth outside its lower and upper ticks from global growth.
- The current tick determines whether fee growth outside each boundary is measured directly or as a difference from global growth.
- Uncollected token amounts are estimated by multiplying the change in inside-range fee growth by position liquidity and applying the Q128 scaling and token decimals.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.