Predatory trading bots lurking in Ethereum's mempool present invisible taxation of traders on automated market makers (AMMs). AMM traders specify a slippage tolerance to indicate the maximum price movement they are willing to accept. This way, traders avoid automatic transaction failure in case of small price movements before their trade request executes. However, while a too-small slippage tolerance may lead to trade failures, a too-large tolerance allows predatory trading bots to profit from sandwich attacks. These bots can extract the difference between the slippage tolerance and the actual price movement as profit. In this work, we introduce the sandwich game to analyze sandwich attacks analytically from both the attacker and victim perspectives. Moreover, we provide a simple and highly effective algorithm that traders can use to set the slippage. We unveil that the vast majority of broadcast transactions can avoid sandwich attacks while simultaneously only experiencing a low risk of transaction failure. Thereby, we demonstrate that a constant auto-slippage cannot adjust to varying trade sizes and pool characteristics. Our algorithm outperforms the constant auto-slippage suggested by the biggest AMM, Uniswap, in all performed tests. Specifically, our algorithm repeatedly demonstrates a cost reduction exceeding a factor of 100.
翻译:在Etheum的网球中潜伏的掠夺性贸易博物在Eceenum的网球中展示了贸易商对自动市场制造者(AMMS)的无形税收。AMM贸易商指定了一个缓冲游戏,以显示他们愿意接受的最高价格移动量。这样,贸易商在贸易请求执行之前避免了交易自动失败。然而,虽然一个过小的缓冲容忍可能会导致贸易失败,但一个过大容忍让掠夺性贸易博物从三明治袭击中获利。这些软盘可以将延缓容忍度与实际价格流动作为利润来区别开来。在这项工作中,我们引入了三明治游戏,从攻击者和受害者的角度分析三明治袭击。此外,我们提供了一种简单而高效的算法,交易商家可以用来设置缓冲。我们公开说,绝大多数广播交易可以避免连锁袭击,同时只能经历低额的交易失败风险。因此,我们证明一个不变的自动翻转页无法适应不同的贸易规模和集合特性。我们的算法超越了我们从最大AMM、Uniwap所有测试中反复提出的不断减少的自动滑动成本。