Skip to main content
Skip to content
DN Research

An AMM’s average price may not be an arithmetic average

Compare arithmetic and geometric AMM average prices with synthetic time weights, reciprocal quotes and v3 tick-rounding boundaries.

Two paths through a price archive lead to different abstract average-price markers. Editorial illustration.
Reading options: audio, text size & sections

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.

Ask what the oracle averaged

Two reports can use the same price path and time window yet publish different average prices without either containing an arithmetic mistake. One may average prices directly; another may average their logarithms and convert back into a price. Uniswap v3's oracle uses accumulated ticks, which produces a time-weighted geometric price rather than the ordinary arithmetic average many readers expect. [1][2]

The distinction matters when an application compares a pool oracle with a dashboard average, a trade's execution price or a risk threshold. A discrepancy between those numbers is not automatically evidence that a source is stale or manipulated. First establish whether they measure the same quantity.

This investigation isolates that definition. It provides continuous synthetic price examples, then explains the additional integer-tick and token-unit boundaries involved in reproducing the real contract. No live pool history, profitable trade or resistance to manipulation was measured.

From cumulative ticks to a price

Uniswap v3 records a cumulative tick quantity over time. Subtracting the cumulative values at two endpoints and dividing by the elapsed seconds gives a mean tick. Since a tick is tied to the logarithm of the price, converting that mean tick back into a price gives a geometric time average. [1][2]

For a simple two-level path, let prices P1 and P2 remain in force for fractions a and 1 − a of the window. The continuous geometric result is P1^a × P2^(1 − a). The arithmetic result is a × P1 + (1 − a) × P2. The formulas weight the same time shares but combine the prices differently.

This explanation does not imply that an application can average two displayed endpoint prices and recover the oracle. The accumulated path between those endpoints matters. A price that briefly touches a level has a different time weight from one that remains there for most of the interval.

Equal time, different answers

Assume a fictional asset trades at 100 quote units for 900 seconds and 400 quote units for another 900 seconds. The total window is 1,800 seconds, with equal weights. The arithmetic average is 250. The continuous geometric average is the square root of 100 × 400, or 200.

Synthetic path Seconds at 100 Seconds at 400 Arithmetic price Geometric price
Equal time 900 900 250.0000 200.0000
More time at low price 1,800 600 175.0000 141.4214
Constant price control 1,800 0 100.0000 100.0000

In the equal-time example, the arithmetic number is 25% above the geometric number. That gap is generated entirely by the averaging definition. It is not a measured spread available to a trader. Both statistics summarize the same invented path.

The second row changes the total window to 2,400 seconds. The low-price state receives 75% of the time weight. Its geometric result is 100^0.75 × 400^0.25, approximately 141.4214. Weighting the two observations equally merely because there are two rows would answer the wrong question.

Reversing the pair exposes another difference

In the first scenario, the reverse prices are 0.01 and 0.0025 base units per quote unit. Their geometric average is 0.005, the reciprocal of 200. Their arithmetic average is 0.00625, whose reciprocal is 160. That is not the forward arithmetic average of 250.

The v3 whitepaper explicitly identifies this reciprocal property as a reason a logarithmic accumulator is useful. Arithmetic forward and reverse averages cannot generally be obtained by taking one average and inverting it. [2]

A research collector should therefore store the pair orientation with the number. A label such as ETH price is incomplete unless it states the quote asset and token units. Token ordering in the pool is determined by addresses, and human-readable decimals require their own conversion. A reciprocal mistake can be much larger than the rounding difference a reviewer is trying to investigate.

The contract adds discrete ticks and rounding

The real oracle operates on integer ticks, not the exact continuous logarithms used in the teaching table. Uniswap's OracleLibrary consult function divides cumulative tick differences by elapsed time and adjusts negative fractional results downward. Its quotation helper also handles token ordering and integer arithmetic. [3]

Consequently, the four-decimal values in this article are conceptual demonstrations, not bit-for-bit predictions of an arbitrary pool query. Reproducing the contract requires its actual observations, window, tick rounding, token decimals and quote direction. Substituting floating-point logarithms into a spreadsheet can be useful for explanation while remaining insufficient for an exact settlement calculation.

There is another average in the same ecosystem: the liquidity accumulator supports a harmonic mean of liquidity. It is a different statistic with a different denominator. Do not label it an arithmetic liquidity average or substitute it for the geometric price merely because both are returned by related tooling. [1]

A longer window changes the question

The selected window must fit the historical observations actually available. The v3 documentation explains the role of the observation history and its capacity. Asking for a long interval does not create missing history. A valid collector should record the requested interval and whether the query supplied the intended observations. [1]

A longer average can smooth a short-lived price move while reacting more slowly to a sustained change. That is a consequence of the time weighting, not a universal recommendation to choose the longest possible window. The appropriate choice depends on the decision being made and on other risks such as liquidity, concentrated activity and external reference prices.

Neither average is an executable quote for a trade of arbitrary size. An oracle statistic describes a path. An execution quote also depends on current liquidity, fees, trade size and the route. Treating the historical average as guaranteed proceeds would turn a definition into a trading promise.

Reconcile disagreements before escalating them

When two sources disagree, compare the pair, decimals, observation endpoints, time weights and averaging rule first. Then compare the rounding and source state. Only after those align is a remaining difference evidence of a substantive data or implementation problem.

For a lender or treasury tool, write the accepted statistic into the decision policy. A threshold designed for an arithmetic reference should not silently consume a geometric reference. For a retail reader, ask what an average-price badge means before using it to judge whether a quote is unusually cheap or expensive.

DN's existing oracle guide examines freshness, heartbeat and fallback policy. The new contribution here is the statistic itself: a reproducible path can produce different valid averages, and inversion behaves differently across them. The CSV preserves durations and both results. Sources were reviewed on 5 December 2026, and every price in the example is fictional.

Use the worked example

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.

To check the arithmetic and CSV/JSON agreement locally, save both files beside the Python verification script and run python3 verify.py q32.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 a Uniswap v3 TWAP an arithmetic mean of displayed prices?

The tick-based v3 oracle produces a geometric time-average price, subject to integer tick calculation. Averaging displayed prices arithmetically generally gives another statistic.

Can I invert an arithmetic average to get the reverse-pair average?

Not generally. In the synthetic equal-time example, the forward arithmetic average is 250 while the reciprocal of the reverse arithmetic average is 160.

Does the worked table reproduce a live oracle call?

No. It uses fictional continuous price levels. Exact contract reconstruction needs observations, integer tick rounding, token ordering and decimals.

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.

  1. Uniswap v3 price oracles. Tick accumulation yields geometric time-average price; observations and liquidity accumulator have distinct scope. Evidence: Official documentation.
  2. Uniswap v3 Core whitepaper. Section 5.2 explains logarithmic accumulation, geometric means and reciprocal consistency. Evidence: Research paper.
  3. Uniswap v3 OracleLibrary. Mean-tick negative rounding and quote direction use integer contract arithmetic. Evidence: Primary implementation.

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.

The DN briefing: what changed and why it matters

Follow documented changes in AI, crypto and financial technology, with practical analysis and source context. Unsubscribe anytime.