{
  "schema_version": "1.0.0",
  "record_id": "dn-next42-20261205-q31",
  "record_version": "1.0.0",
  "title": "Your Uniswap fee counter can lag the fees already earned",
  "canonical_url": "https://decentralised.news/uniswap-v3-fee-growth-checkpoint-tokens-owed",
  "evidence_type": "documentary_analysis_with_synthetic_worked_example",
  "source_review_date": "2026-12-05",
  "last_verified_utc": null,
  "observation_window": null,
  "methodology_url": "https://decentralised.news/uniswap-v3-fee-growth-checkpoint-tokens-owed",
  "methodology_version": "1.0.0",
  "input_schema": {
    "columns": [
      "scenario",
      "liquidity_units",
      "delta_fee_growth_divided_by_Q128",
      "previous_owed_raw",
      "new_fee_raw",
      "total_raw",
      "token_decimals",
      "total_tokens"
    ],
    "rows_file": "https://decentralised.news/data/dn-next42-20261205/v1/q31.csv"
  },
  "units": {
    "definition": "Units are named in the CSV columns, manuscript and calculation labels. Do not combine quantities without resolving their dimensions."
  },
  "sources": [
    {
      "id": 1,
      "title": "Uniswap v3 Position library",
      "url": "https://github.com/Uniswap/v3-core/blob/main/contracts/libraries/Position.sol",
      "reviewDate": "2026-12-05",
      "supports": "Position checkpoint fields and Q128 fee-growth-difference calculation using previous liquidity.",
      "evidenceType": "Primary implementation"
    },
    {
      "id": 2,
      "title": "Uniswap v3 NonfungiblePositionManager",
      "url": "https://github.com/Uniswap/v3-periphery/blob/main/contracts/NonfungiblePositionManager.sol",
      "reviewDate": "2026-12-05",
      "supports": "Collect refreshes accounting for positions with liquidity; decreaseLiquidity adds released principal and fees to tokens owed.",
      "evidenceType": "Primary implementation"
    },
    {
      "id": 3,
      "title": "Uniswap protocol fees",
      "url": "https://developers.uniswap.org/docs/get-started/concepts/fees",
      "reviewDate": "2026-12-05",
      "supports": "V3 fees are claimable and not automatically reinvested; range activity affects fee earning.",
      "evidenceType": "Official documentation"
    }
  ],
  "calculations": [
    {
      "label": "Quarter-Q128 fee",
      "expression": "int((2**126)*2000000/(2**128))",
      "expected": 500000
    },
    {
      "label": "Half-Q128 fee",
      "expression": "int((2**127)*2000000/(2**128))",
      "expected": 1000000
    },
    {
      "label": "Raw-to-token total",
      "expression": "(250000+1000000)/10**6",
      "expected": 1.25
    },
    {
      "label": "Stored-counter understatement",
      "expression": "1.25-0.25",
      "expected": 1
    }
  ],
  "example": {
    "synthetic": true,
    "description": "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.",
    "rows": [
      [
        "growth_0.25",
        2000000,
        0.25,
        250000,
        500000,
        750000,
        6,
        0.75
      ],
      [
        "growth_0.5",
        2000000,
        0.5,
        250000,
        1000000,
        1250000,
        6,
        1.25
      ],
      [
        "growth_1",
        2000000,
        1,
        250000,
        2000000,
        2250000,
        6,
        2.25
      ]
    ]
  },
  "limitations": [
    "Examples use declared invented inputs, not observed fills, customer outcomes, provider rankings or predictive backtests.",
    "Source-review date is not a measurement time, publication date of the source or assurance that terms will remain current.",
    "Documentation does not establish individual access, legal eligibility, service reliability or investment suitability."
  ],
  "falsification_or_recheck_triggers": [
    "Changed governing document or applicable software version.",
    "Evidence of different account, product, timing, unit or legal-entity scope.",
    "An arithmetic error or reproducible counterexample to the stated mechanism."
  ],
  "rights": {
    "original_DN_analysis": "Cite Decentralised News, the canonical URL and record version when reusing this worked example.",
    "third_party_sources": "Third-party material remains subject to its original terms. Linking does not grant redistribution rights."
  },
  "commercial_disclosure": "This article includes a link to DN’s own separately scoped research service. No provider purchase is required to use the example.",
  "corrections": []
}
