Pith. sign in

REVIEW 2 major objections 1 minor 29 references

Cost of Manipulation in AMM-Based Oracles

T0 review · 2 major / 1 minor · reviewed 2026-06-28 · grok-4.3

Pith's one-line read Liquidity weights maximize the minimum cost of manipulation for weighted-median AMM oracles at any distortion level.

desk verdict The paper gives closed-form manipulation costs for AMM oracles and shows liquidity weights are optimal for medians under an EMH loss definition. read the letter →

arxiv 2606.03548 v1 pith:Y3LW6FKN submitted 2026-06-02 cs.CE econ.THq-fin.TR

classification cs.CEecon.THq-fin.TR
keywords automatedmarketmakerspriceoraclesmanipulationcostweightedmedianconstantproductdecentralizedfinancearbitrageliquidityweights
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

The paper examines how attackers trade against constant-product automated market makers to shift on-chain price oracles and how an oracle designer can choose aggregation rules to raise the economic barrier to such attacks. It defines the cost of manipulation as the smallest mark-to-market loss an attacker must accept to move the reported price by a chosen multiplicative factor. Under an efficient-market view of the true off-chain price, the authors derive closed-form expressions for single-pool attacks and solve the resulting attacker-designer game, showing that weighting each pool by its liquidity depth maximizes the guaranteed cost inside the class of weighted medians for every distortion size and inside the class of weighted means when the distortion is small. In a frictionless model with instantaneous cross-pool arbitrage the cost collapses to a function of total quote depth alone and becomes identical for all symmetric aggregators; the same optimality result holds in multi-asset star topologies.

What carries the argument

Cost of manipulation, defined as the minimal mark-to-market loss an attacker must incur to move the oracle output by a given multiplicative factor, with liquidity depth serving as the weight that maximizes this cost for median and small-distortion mean aggregators.

What would settle it

Observe, in a controlled CPMM environment with known external price, whether an attacker using liquidity weights can achieve a target oracle distortion at a lower realized loss than an attacker using any other fixed weights.

Watch

Extended reading notes

Core claim

Liquidity weights maximize the minimum cost of manipulation within the classes of weighted medians for any distortion level and within the classes of weighted means locally as the distortion tends to zero. For larger distortions optimal weights for means can depend on the target distortion and no single choice is uniformly best. In a frictionless CPMM model with cross-pool arbitrage the manipulation cost depends only on total quote depth and coincides across symmetric aggregators. The same liquidity-weight optimality carries over to multi-asset star architectures.

Load-bearing premise

The off-chain true price is such that any on-chain distortion forces the attacker to realize a mark-to-market loss.

Editorial extensions

If this is right

  • Liquidity weights are optimal for weighted medians at every distortion level.
  • For weighted means the same weights are optimal only in the small-distortion limit; larger distortions require distortion-dependent weights.
  • With perfect cross-pool arbitrage the cost equals a function of aggregate depth alone and is independent of the aggregator.
  • The optimality result extends unchanged to multi-asset star architectures.
  • Dwell times and rate limits supply a concrete metric for sizing oracles against explicit attack budgets.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • Designers facing uncertain distortion targets may therefore prefer median aggregators over means.
  • The independence result suggests that, once arbitrage is frictionless, further improvements must come from increasing total depth rather than from finer aggregation rules.
  • Empirical measurement of dwell-time parameters in live deployments could turn the theoretical yardstick into an operational sizing rule.
  • The single-pool closed forms could be used to benchmark manipulation resistance of oracles built on other constant-product variants.
Share X Bluesky LinkedIn Reddit HN

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit.

Referee Report

2 major / 1 minor

Summary. The manuscript studies robustness of AMM-based oracles to manipulation by modeling attacker trades against CPMMs, arbitrageur restoration of consistency, and designer aggregation choices. Under an EMH view of the fixed off-chain true price, it defines manipulation cost as the minimal mark-to-market loss to achieve a given multiplicative oracle distortion. It derives closed-form single-pool formulas, solves the attacker-designer game for weighted means and medians (showing liquidity weights maximize min cost for medians at any distortion and for means locally as distortion tends to zero), shows that in frictionless cross-pool arbitrage the cost depends only on total quote depth and is identical across symmetric aggregators, extends the framework to multi-asset star architectures, and incorporates dwell times and rate limits for practical sizing.

Significance. If the closed-form derivations and game solutions hold, the work supplies an explicit economic yardstick for oracle robustness, with parameter-free optimality results inside the weighted-median and (local) weighted-mean classes and a clean reduction to total depth under arbitrage. These are concrete strengths that could inform oracle parameter choices.

major comments (2)
  1. [Abstract] Abstract and § on weighted medians/means: the optimality claim that liquidity weights maximize the minimum cost of manipulation (for medians at any distortion level; for means locally as distortion → 0) is derived after defining cost via the EMH assumption of an unchanged off-chain true price. If the true price can co-move with on-chain trades or the attacker can hedge, the loss function changes and the claimed optimality within the aggregator classes need not hold; the manuscript should state the result as conditional on this modeling choice and provide a concrete test or counter-scenario.
  2. [Section on weighted means] Section on larger distortions for weighted means: the text notes that for finite distortions optimal weights can depend on the target distortion level and no single choice is uniformly optimal. This directly limits the practical scope of the local optimality result; the manuscript should supply the explicit dependence (e.g., the functional form or numerical example) showing when liquidity weights cease to be optimal.
minor comments (1)
  1. [Abstract] Abstract: the phrase 'for any distortion level' for medians and 'locally as the distortion tends to zero' for means should be repeated verbatim in the introduction and conclusion for consistency.

Simulated Author's Rebuttal

2 responses · 0 unresolved

We thank the referee for the constructive comments. We address each major point below and indicate the revisions we will make to strengthen the manuscript.

read point-by-point responses
  1. Referee: [Abstract] Abstract and § on weighted medians/means: the optimality claim that liquidity weights maximize the minimum cost of manipulation (for medians at any distortion level; for means locally as distortion → 0) is derived after defining cost via the EMH assumption of an unchanged off-chain true price. If the true price can co-move with on-chain trades or the attacker can hedge, the loss function changes and the claimed optimality within the aggregator classes need not hold; the manuscript should state the result as conditional on this modeling choice and provide a concrete test or counter-scenario.

    Authors: We agree that the optimality results are derived under the fixed off-chain price assumption of the EMH framework. In the revision we will explicitly condition the claims in the abstract and the weighted-median/mean sections on this modeling choice. For a concrete counter-scenario we will add a short discussion noting that if the off-chain price co-moves perfectly with the on-chain trade (e.g., via instantaneous cross-venue arbitrage that eliminates any mark-to-market loss), the effective manipulation cost drops to zero; this case requires a joint price-impact model outside the current scope and is flagged as a limitation for future work. revision: partial

  2. Referee: [Section on weighted means] Section on larger distortions for weighted means: the text notes that for finite distortions optimal weights can depend on the target distortion level and no single choice is uniformly optimal. This directly limits the practical scope of the local optimality result; the manuscript should supply the explicit dependence (e.g., the functional form or numerical example) showing when liquidity weights cease to be optimal.

    Authors: We will strengthen the section by adding a numerical example that tabulates optimal weights for target distortions of 5 %, 10 %, and 20 % under representative liquidity profiles. The example will show the distortion threshold at which liquidity weights cease to be optimal and will illustrate how the deviation grows with the target distortion, thereby clarifying the practical range of the local optimality result. revision: yes

Circularity Check

0 steps flagged · score 0.0 of 10

No circularity; derivations follow directly from CPMM mechanics and EMH definition without reduction to inputs

full rationale

The paper starts from explicit CPMM trading mechanics and defines manipulation cost as mark-to-market loss under a fixed off-chain EMH price, then solves the attacker-designer game to obtain closed-form single-pool formulas and optimality statements for liquidity weights in weighted means/medians. These are conditional theorems within the stated model, not tautological reductions where a result equals its input by construction, fitted parameters renamed as predictions, or load-bearing self-citations. No steps match the enumerated circularity patterns; the framework remains self-contained against its own equations and assumptions.

Assumptions & free parameters 0 free parameters · 2 assumptions · 0 invented entities

Framework rests on standard CPMM price-impact mechanics and an EMH assumption for the external price; no free parameters, new entities, or ad-hoc axioms are introduced in the abstract.

assumptions (2)
  • domain assumption Efficient market hypothesis view of the off-chain true price
    Defines cost of manipulation as mark-to-market loss (abstract, paragraph 1).
  • standard math Constant-product AMM trading mechanics
    Underpins all price-impact and arbitrage calculations (abstract, paragraph 1).

how reviews work

0 comments
Cite this review

Pith. "Pith review of Cost of Manipulation in AMM-Based Oracles." pith.science (2026). https://pith.science/paper/Y3LW6FKN

@misc{pith2026260603548,
  author       = {Pith},
  title        = {Pith review of: Cost of Manipulation in AMM-Based Oracles},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/Y3LW6FKN}},
  note         = {Machine review of arXiv:2606.03548}
}
read the original abstract

We study the robustness of AMM-based on-chain price oracles to strategic manipulation. An attacker trades against constant product automated market makers (CPMMs) to distort an on-chain oracle, arbitrageurs restore cross-pool and cross-venue consistency, and an oracle designer chooses how to aggregate pool quotes. Taking an efficient-market-hypothesis (EMH) view of the off-chain "true" price, we define the \emph{cost of manipulation} as the minimal mark-to-market loss that an attacker must incur to move the oracle by a given multiplicative factor. For independent CPMMs, we derive closed-form single-pool manipulation formulas and solve the attacker-designer game for weighted means and weighted medians, showing that liquidity weights maximize the minimum cost of manipulation within these classes for weighted medians (for any distortion level) and, for weighted means, locally as the distortion tends to zero. For larger distortions, weighted means become more fragile: optimal weights can depend on the target distortion and no single choice is uniformly optimal across distortion levels. In a frictionless CPMM model with cross-pool arbitrage, the manipulation cost depends only on the total quote depth and coincides across symmetric aggregators. We extend this framework to multi-asset star architectures, confirming that liquidity weights remain optimal in the same sense. Finally, we bridge theory and practice by incorporating dwell times and rate limits, providing a quantitative yardstick to size oracles against the explicit economic costs of attack.

Figures

Figures reproduced from arXiv: 2606.03548 by the authors.

Figure 1
Figure 1. The CPMM bonding curve xy = k and a Y → X trade that increases the marginal price p = y/x. so any trade moves (x, y) along the curve xy = k. The marginal price of X in units of Y is the rate at which the reserves trade locally: marginal price of X in Y = − dy dx = y x . Thus the reserve ratio p := y x (Y per X) is exactly the marginal price on the CPMM curve. This is why on-chain “spot prices” for CPMMs are typicall… view at source ↗
Figure 2
Figure 2. Marginal manipulation cost f ′ (t) = (t − 1)/(2t 3/2 ) for a single CPMM pool. Marginal cost peaks at t = 3 and declines thereafter, which makes concentrated mean attacks attractive once some pools are pushed beyond 3× their initial price. Weighted Mean Let weights w1, w2 > 0 with w1 + w2 = 1 (e.g., by liquidity depth wi ∝ √ ki , equivalently wi ∝ y (0) i when pre-trade prices match). The aggregated post-trade price… view at source ↗

Discussion (0). Continue with ORCID to comment.

Reference graph

Works this paper leans on

29 extracted references · 5 canonical work pages

  1. [1]

    A. Adams. Uniswap v3 TWAP oracles in proof of stake.SSRN Working Paper 4384409, 2022

  2. [2]

    Adams et al

    H. Adams et al. Uniswap v2 core. Whitepaper, 2020

  3. [3]

    Adams et al

    H. Adams et al. Uniswap v3 core. Whitepaper, 2021

  4. [4]

    Theimpactofmarketconditionsandfeealgorithms on the design of a competitive AMM

    AlgebraFinanceResearchTeam. Theimpactofmarketconditionsandfeealgorithms on the design of a competitive AMM. Whitepaper, 2022

  5. [5]

    Allouche, M

    M. Allouche, M. Echenim, E. Gobet, and A.-C. Maurice. Statistical error bounds for weighted mean and median, with application to robust aggregation of cryptocurrency data. Preprint, 2024

  6. [6]

    Angeris and T

    G. Angeris and T. Chitra. Improved price oracles: Constant function market makers. InProceedings of the 2nd ACM Conference on Advances in Financial Technologies, pages 80–91. ACM, 2020

  7. [7]

    Angeris, T

    G. Angeris, T. Diamandis, M. Resnick, and T. Chitra. Optimal routing for constant function market makers. InProceedings of the 23rd ACM Conference on Economics and Computation. ACM, 2022

  8. [8]

    A. T. Aspembitova et al. Oracles in decentralized finance: Attack costs, profits and mitigation.Applied Sciences, 12(24), 2022

Show all 29 references
  1. [9]

    Bergault et al

    P. Bergault et al. Automated market makers: Mean-variance analysis of LPs.arXiv preprint arXiv:2212.00336, 2022

  2. [10]

    Boe et al

    J. Boe et al. Safeguarding DeFi smart contracts against oracle deviations.Proceed- ings of the ACM on Programming Languages, 2024

  3. [11]

    Cartea, F

    Á. Cartea, F. Drissi, and M. Monga. Decentralised finance and automated market making.Journal of Economic Dynamics and Control, 2025

  4. [12]

    Cartea, F

    Á. Cartea, F. Drissi, and M. Monga. Decentralised finance and automated market making: Predictable loss and optimal liquidity provision.Journal of Economic Dynamics and Control, 2025. Forthcoming; see also arXiv:2309.08431

  5. [13]

    Blockmanipulation:Marketriskofuniswapv3TWAPoracles

    ChaosLabs. Blockmanipulation:Marketriskofuniswapv3TWAPoracles. Research report, 2023

  6. [14]

    X. Deng, S. M. Beillahi, H. Du, P. Tiwari, and A. Veneris. Analysis of defi oracles. Staff Discussion Paper 2024-10, Bank of Canada, 2024

  7. [15]

    Gansäuer et al

    R. Gansäuer et al. Price oracle accuracy across blockchains. InProceedings of CAA W 2025, 2025

  8. [16]

    F. R. Hampel. Robust statistics: A brief introduction and overview.Allgemeines Statistisches Archiv, 85(1):1–18, 2001

  9. [17]

    P. J. Huber.Robust Statistics. John Wiley & Sons, New York, 1981

  10. [18]

    Luu et al

    Q. Luu et al. OVer: A framework for safeguarding DeFi smart contracts against oracle deviations. InProceedings of the Web Conference, 2024

  11. [19]

    R. A. Maronna, R. D. Martin, and V. J. Yohai.Robust Statistics: Theory and Methods. John Wiley & Sons, Chichester, 2006

  12. [20]

    M. Nadler. Blockchain price oracles: Accuracy and violation recovery.Finance Research Letters, 2025

  13. [21]

    K. Qin, L. Zhou, B. Livshits, and A. Gervais. Attacking the DeFi ecosystem with flash loans for fun and profit. InProceedings of the 3rd ACM Conference on Advances in Financial Technologies, 2021

  14. [22]

    SIXGroup.SIX Crypto Indices: Real-Time Median and Real-Time Volume-Weighted Median Methodology, 2020

  15. [23]

    Sterrett and A

    A. Sterrett and A. Adams. A microstructure analysis of coupling in CFMMs.arXiv preprint arXiv:2510.06095, 2025. Cost of Manipulation in AMM-Based Oracles 17

  16. [24]

    Yang et al

    W. Yang et al. Flash loan attack is more than just price oracle manipulation.arXiv preprint arXiv:2105.XXX, 2021

  17. [25]

    Yang et al

    X. Yang et al. Closed-form solutions for genericn-token AMM arbitrage.arXiv preprint arXiv:2402.06731, 2024

  18. [26]

    Zhang, E

    F. Zhang, E. Cecchetti, K. Croman, A. Juels, and E. Shi. A first look into DeFi oracles. InProceedings of the IEEE Security and Privacy Workshops, 2020

  19. [27]

    Y. Zhao, X. Kang, T. Li, C.-K. Chu, and H. Wang. Towards trustworthy defi oracles: Past, present and future.arXiv preprint arXiv:2201.02358, 2022. A Sustained Manipulation and Protocol Constraints The one-step cost of manipulation considered above abstracts away from timing an...

  20. [28]

    for each asset a, liquidity weights w⋆ a,i ∝y (0) a,i maximize the leading-order (second-order inεa) term ofCosta(1 + εa; wa,·)when Aa is a weighted mean, and

  21. [29]

    maximizeCost a(ra;w a,·)for anyr a ≥1whenA a is a weighted median Moreover, the star architecture decouples assets, so the minimal total cost to distort the vector(ˆpa)a̸=0 by factorsr a equalsPM a=1 Costa(ra;w ⋆ a,·). Proof. Throughout, assets are indexed by a∈ { 1, . . . , M...

Pith tools

Reviewed June 28, 2026 · model on record in the stance chip above.