Research scope: Documentary analysis with a hypothetical worked example. Sources reviewed 5 December 2026; this is a planning and interpretation guide, not a report of 2027 observations.
A stored counter can be an incomplete snapshot
A Uniswap v3 position can have fees accrued since its last accounting update even when a stored tokensOwed field has not changed. Reading that field alone can therefore understate the amount attributable to the position at a later block. The missing component is the increase in fee growth inside the position's range since its checkpoint, multiplied by the position's liquidity.
The core Position library stores liquidity, prior inside-fee-growth values and tokens owed. Its update function computes the new fee component from the difference between current and checkpointed growth, using Q128 fixed-point scaling. That calculation is visible in the implementation rather than inferred from a dashboard label. [1]
This is an accounting article about Uniswap v3. It does not forecast an LP return, evaluate a trading range or apply the same storage layout to v4. DN's existing liquidity-benchmark article covers range activity and inventory exposure; this investigation explains how an accrued fee becomes a checkpointed amount and then a collection.
Three records that should stay separate
First is the position's liquidity and checkpoint. Second is fee growth accumulated inside its lower and upper ticks. Third is the amount already recorded as owed. The current uncollected amount can require both the stored owed amount and fees earned since the checkpoint. [1]
The inside qualifier matters. A pool-wide fee-growth counter is not automatically the counter relevant to a particular range. An accountant who multiplies a global change by every position's liquidity can assign fees to periods or price regions that the position did not earn from. Identify the pool, token pair, fee tier, range and position owner before interpreting the values.
For positions managed through the standard NonfungiblePositionManager, there is also an NFT-level record. The manager maintains its position's own checkpoint and amounts. Do not silently combine a pool position belonging to the manager with a different NFT's liquidity or an unrelated block snapshot. [2]
A synthetic Q128 example
Q128 means the fee-growth value is scaled by 2 to the power of 128. In the simplified arithmetic, newly accrued raw tokens equal liquidity multiplied by the fee-growth difference, divided by 2^128, with the implementation's integer rounding. [1]
Assume a fictional position has 2,000,000 liquidity units, 250,000 raw token units already recorded as owed, and a token with six decimals. Ignore liquidity changes and principal withdrawals during the interval. The growth differences below are chosen as exact fractions of Q128 so the integer example has no rounding ambiguity.
| Growth difference divided by Q128 | New fee, raw token units | Previously owed, raw units | Total, raw units | Total token amount |
|---|---|---|---|---|
| 0.25 | 500,000 | 250,000 | 750,000 | 0.75 |
| 0.50 | 1,000,000 | 250,000 | 1,250,000 | 1.25 |
| 1.00 | 2,000,000 | 250,000 | 2,250,000 | 2.25 |
In the middle row, looking only at the stored 250,000 reports 0.25 tokens. Including the fictional growth since the checkpoint gives 1.25 tokens. Updating the accounting does not manufacture the additional token; it recognizes the modeled accrual that the stale counter did not yet include.
The table intentionally stores the normalized growth fraction instead of exporting a gigantic integer through an ordinary floating-point JSON number. Real implementation work requires integer-safe arithmetic, correct subtraction semantics and the contract's rounding. A spreadsheet that loses low-order bits can produce an authoritative-looking but incorrect fee result.
Collection can refresh the checkpoint
The reviewed NonfungiblePositionManager collect path checks whether the position still has liquidity. When it does, it invokes a zero-liquidity burn on the pool to update position accounting, reads the current inside-fee-growth checkpoints, and adds newly calculated fees to the amount available for collection. [2]
That is why a prior read of the manager's tokensOwed value is not necessarily the amount a later collect operation can return. The relevant state may be refreshed during the operation, and the chain can also advance between a read and inclusion. The requested collection maxima can limit what is transferred as well.
For reconciliation, retain a before snapshot, the included collection transaction and an after snapshot. Record both token amounts and the recipient. A transaction returning a number is easier to interpret when the corresponding position state and transfer evidence agree. A failed simulation, unsigned estimate or unsubmitted call is not a collected fee receipt.
Tokens owed are not always pure income
There is a second trap in the manager's accounting. Its decreaseLiquidity path adds the amounts released from the reduced position to tokensOwed alongside newly checkpointed fees. The owed fields can therefore include withdrawn principal, not solely swap-fee income. [2]
Suppose a report labels every collection as trading revenue. A user who reduces liquidity and collects the released assets could appear to earn a large return even though much of the transfer is their own invested inventory coming back. The error survives even if every on-chain amount was copied accurately; the classification is wrong.
The worked table excludes principal withdrawals to isolate the fee checkpoint mechanism. A production ledger should reconcile liquidity increases and decreases, the principal amounts those operations release, fee accrual and collections separately. Token price changes then belong in the valuation record, not in a rewritten count of raw fee units.
Accrual does not mean compounding
Uniswap's fee documentation distinguishes claimable v3 fees from automatic reinvestment. A fee balance does not itself increase the position's active liquidity merely because the wallet interface displays it beside the position. Liquidity outside the active range also has different fee-earning behavior from liquidity currently in range. [3]
A strategy that reinvests needs an additional operation, with its own amounts, range and costs. To compare that strategy with leaving fees uncollected, account for those changes explicitly. Counting accrual, collection and reinvestment as three independent gains would count the same assets more than once.
This distinction is especially useful when a bot reports daily yield. Ask whether its number measures an estimated accrual at a block, an actual token collection, or a change in the combined market value of inventory and fees. Those are different quantities even when they appear on one screen.
A practical review boundary
Use one coherent block context for the initial reconstruction. Verify the exact contracts and NFT, the applicable range, token decimals, liquidity and last checkpoints. Preserve the method used to derive current inside growth. If liquidity changed between observations, divide the analysis at those changes rather than multiplying one final liquidity value across the whole period.
Then classify collections using the operation history. The question is not simply whether the counter rose, but which assets moved from accrued to recorded to transferred, and which movements returned principal. A small investor can ask a position interface for that distinction; an institutional ledger should be able to reproduce it.
All numbers here are synthetic and were checked separately from the source interpretation. The documents were reviewed on 5 December 2026; no live NFT or pool was queried. The result is a method for reading v3 accounting, not a claimed fee opportunity or a forecast of what any position will earn.
Use the worked example
Original DN synthetic worked example. All scenario inputs are hypothetical; no live transaction, return, quote or account is represented. Reconstruct Uniswap v3 fees from inside growth and checkpoints, and separate accrued fees from collected principal.
- Download the synthetic worked example (CSV)
- Download the source and method record (JSON, version 1.0.0)
To check the arithmetic and CSV/JSON agreement locally, save both files beside the Python verification script and run python3 verify.py q31.json. Python 3 is required; no third-party packages are needed. The check does not verify source claims or provider performance.
These are downloadable research records. They do not connect to an account, execute a trade or provide live market data.
Frequently asked questions
Is tokensOwed always the full current fee estimate?
No. A position may have accrued fees since its last checkpoint. A reconstruction can require current inside fee growth, the previous checkpoint and liquidity as well as stored owed amounts.
Does collecting a large amount prove a large fee return?
No. The position manager can also record principal released by decreasing liquidity in tokensOwed. Classify the collection using the position’s operation history.
Can ordinary floating-point arithmetic reproduce the contract exactly?
Not reliably for large fixed-point integers. Production accounting needs integer-safe arithmetic, the correct rounding and subtraction semantics, and coherent contract state.
Continue the research
Optional research services and tools
The free example above can be used without buying a product. For a defined team question, the DN Research Desk offers separately agreed documentary briefs, source registers and worked examples. Scope, fee, delivery date and usage terms are agreed before work begins; an enquiry creates no payment obligation.
Commercial disclosure: DN’s own service and any referral relationship are separate from the research method. No provider paid for a favourable finding in this article.
Sources and review scope
Sources reviewed on 5 December 2026. Review dates are distinct from each source’s observation, publication and effective dates.
- Uniswap v3 Position library. Position checkpoint fields and Q128 fee-growth-difference calculation using previous liquidity. Evidence: Primary implementation.
- Uniswap v3 NonfungiblePositionManager. Collect refreshes accounting for positions with liquidity; decreaseLiquidity adds released principal and fees to tokens owed. Evidence: Primary implementation.
- Uniswap protocol fees. V3 fees are claimable and not automatically reinvested; range activity affects fee earning. Evidence: Official documentation.
Corrections and limitations
To flag a possible error, use the DN contact route with this article’s URL, the disputed claim and the supporting source. The analysis is educational, not personalised investment, legal or tax advice. Documentation and synthetic examples do not establish realised returns or individual eligibility.




