{
  "schema_version": "1.0.0",
  "record_id": "dn-next42-20261205-q32",
  "record_version": "1.0.0",
  "title": "An AMM's average price may not be an arithmetic average",
  "canonical_url": "https://decentralised.news/uniswap-twap-geometric-price-time-weighting",
  "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-twap-geometric-price-time-weighting",
  "methodology_version": "1.0.0",
  "input_schema": {
    "columns": [
      "scenario",
      "price_low_quote_per_base",
      "price_high_quote_per_base",
      "seconds_low",
      "seconds_high",
      "arithmetic_quote_per_base",
      "geometric_quote_per_base"
    ],
    "rows_file": "https://decentralised.news/data/dn-next42-20261205/v1/q32.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 price oracles",
      "url": "https://developers.uniswap.org/docs/protocols/v3/concepts/price-oracles",
      "reviewDate": "2026-12-05",
      "supports": "Tick accumulation yields geometric time-average price; observations and liquidity accumulator have distinct scope.",
      "evidenceType": "Official documentation"
    },
    {
      "id": 2,
      "title": "Uniswap v3 Core whitepaper",
      "url": "https://app.uniswap.org/whitepaper-v3.pdf",
      "reviewDate": "2026-12-05",
      "supports": "Section 5.2 explains logarithmic accumulation, geometric means and reciprocal consistency.",
      "evidenceType": "Research paper"
    },
    {
      "id": 3,
      "title": "Uniswap v3 OracleLibrary",
      "url": "https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/OracleLibrary.sol",
      "reviewDate": "2026-12-05",
      "supports": "Mean-tick negative rounding and quote direction use integer contract arithmetic.",
      "evidenceType": "Primary implementation"
    }
  ],
  "calculations": [
    {
      "label": "Equal-time arithmetic",
      "expression": "(100*900+400*900)/1800",
      "expected": 250
    },
    {
      "label": "Equal-time geometric",
      "expression": "(100*400)**0.5",
      "expected": 200
    },
    {
      "label": "Arithmetic premium over geometric",
      "expression": "(250/200-1)*100",
      "expected": 25
    },
    {
      "label": "Reverse arithmetic reciprocal",
      "expression": "1/((1/100+1/400)/2)",
      "expected": 160
    }
  ],
  "example": {
    "synthetic": true,
    "description": "Original DN synthetic worked example. All scenario inputs are hypothetical; no live transaction, return, quote or account is represented. Compare arithmetic and geometric AMM average prices with synthetic time weights, reciprocal quotes and v3 tick-rounding boundaries.",
    "rows": [
      [
        "equal_time",
        100,
        400,
        900,
        900,
        250,
        200
      ],
      [
        "low_weight_75pct",
        100,
        400,
        1800,
        600,
        175,
        141.4213562373095
      ],
      [
        "constant_control",
        100,
        400,
        1800,
        0,
        100,
        100
      ]
    ]
  },
  "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": []
}
