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.
翻译:我们研究了基于自动做市商(AMM)的链上价格预言机在面对策略性操纵时的鲁棒性。攻击者通过对恒定乘积自动做市商(CPMM)进行交易来扭曲链上预言机,套利者则恢复跨池与跨平台的价格一致性,而预言机设计者需选择聚合池报价的方式。基于对链下"真实"价格的有效市场假说(EMH)视角,我们将"操纵成本"定义为攻击者为使预言机偏移给定乘法因子而必须承担的最小按市价计值损失。针对独立CPMM,我们推导了单池操纵的闭式公式,并求解了加权均值与加权中位数情形下攻击者与设计者的博弈模型。结果表明:对于加权中位数(任意扭曲水平),流动性权重能最大化该类聚合器的最小操纵成本;而对于加权均值,仅当扭曲趋近于零时该结论局部成立。当扭曲较大时,加权均值更易受损:最优权重可能依赖于目标扭曲水平,且不存在统一适用于所有扭曲水平的单一最优选择。在无摩擦的CPMM模型(含跨池套利)中,操纵成本仅取决于总报价深度,且对称聚合器下的结果一致。我们将该框架扩展至多资产星形架构,验证了流动性权重在此类体系中仍保持其最优性。最后,通过引入停留时间与速率限制,我们衔接了理论与实践,为基于明确攻击经济成本来度量预言机规模提供了定量标尺。