以太坊黑暗森林的深度体验:DeFi套利机器人如何掠夺用户?

0 11
Avatar for abcddai1
3 years ago

I have read several articles about the Ethereum Dark Forest before, and I am deeply shocked by the darkness and distortion. So I spent a few days writing about my own robot, and deeply experienced the sinisterness in it.

Overview

What is the dark forest of Ethereum? It refers to an unfair and dark mechanism that is little-known but widespread on Ethereum - the privileged use of Mempool's packaging mechanism. Generally speaking, miners are sorted and packaged according to the gas price (GasPrice) given by the transaction. The order of these transactions has no effect on a single transfer transaction, and when it comes to DeFi transactions, the situation is different.

在DeFi中,交易打包的顺序会深刻影响其经济利益。例如,在Uniswap中,对于某个交易对的相同两个购买订单,首先执行的交易将收到更多代币。如果您总是在购买订单之前购买相同的代币,然后再出售,那么您将“无风险”获利。这也称为前端运行。

详情

为什么提前交易有利可图?以Uniswap为例,其价格模型为x * y =常数。例如,初始x = 100,y = 100,然后常数= 10000。

用户A用10 x买入y。此时,x = 110,y = 90.9,并且用户A获得9.1 y。(X * y仍等于常数10000)

用户B用10 x购买y。此时x = 120,y = 83.33,用户B得到7.57 y。(X * y仍等于常数10000)

User A sells all y. At this time x = 108.18, y = 92.43, and user A gets 11.82 x. (X * y is still equal to the constant 10000)

As can be seen from the above example, user A can make two transactions through advance transaction, and then wrap user B's transaction in one tandem, so that he can make profits "without risk". The double quotes here are because it is necessary to assume that no other user A with the same strategy appears. In a real market environment, user B is a real user, and user A is a robot.

Take Uniswap as an example, the current market is flooded with a large number of advance trading robots. These bots constantly monitor the user transactions that appear in the Ethereum mempool. If the user buys a certain coin in a large amount, they immediately send two transactions, one is to buy the coin before the user (higher than the user transaction GasPrice), and the other is after the user (you can use GasPrice Slightly lower or the same) sell the coin.

This kind of advance trading robot is different from the robot that moves bricks and arbitrage between two DEX. They are harmful to the interests of users. In the example above, user B could have obtained 9.1 y, but because of the existence of robot A, he only obtained 7.57 y, thus losing 1.53 y in vain.

example

这种机器人就像强盗站在高速公路上,在光天化日之下抢劫一样。让我们看一个例子:

用户在区块11331736上购买了100 ETH的YFL(用户GasPrice 700GWei):

以太坊黑暗森林的深入体验:DeFi套利机器人如何掠夺用户?https://cn.etherscan.com/tx/0x4b7e5c9e25d0e4b0a0f87b68bde10b7b988bc6d7f83f7dd1fa1dd1b044a931c8

劫持用户的前后有几对机器人,并列举了两个有代表性的机器人进行解释。机器人A在用户(和其他机器人)之前以超高的矿工费用(23,835 Gwei)购买了95 ETH:

以太坊黑暗森林的深入体验:DeFi套利机器人如何掠夺用户?

https://cn.etherscan.com/tx/0x97ab6f31785068a84c47a39e55b2ee391ee6cac2f4c82dbb0ab34f0c5b71c5b9

随后,机器人A在用户交易后出售与用户相同的GasPrice(700Gwei),并获得99.24 ETH。抢走矿工的费用后,抢劫使机器人A获得了超过2 ETH:

以太坊黑暗森林的深度体验:DeFi套利机器人如何掠夺用户?https ://cn.etherscan.com/tx/0x9e5d8a1a179867a4dbca23bd5c7fa6c8db6dd0817165ec3c3474493d69bf6a5c

在用户交易的背后,还有一个机器人B在DEX之间移动砖块和套利。它从Balancer购买了YFL,然后在Uniswap出售了YFL,获得了大约1 ETH:

以太坊黑暗森林的深度体验:DeFi套利机器人如何掠夺用户?https ://cn.etherscan.com/tx/0x81528f2b5d0cbb217c73e1f60bbd8edda6536a8efc85cd0a9466496d4aa999c0

尽管机器人B获利,但它并没有并且并没有和并给并造成并造成用户造成任何利润损失。但是机器人A并非如此。中,用户没有做任何事情就损失了4.2 ETH!

结果,以太坊的DeFi用户正严重损害他们的利益,而大多数人都不知道!

深入

从技术上讲,实现机器人A或B并不难。以太坊不是一个劫匪肆意抢劫的地方吗?有什么办法约束机器人?

答案是:是的,其他机器人。机器人和不同等级之间也存在不同的策略。如果您仔细分析当前的以太坊交易,其他普通用户会被机器人抢劫,而功能较弱的机器人也会被功能更强的机器人抢劫。

限制机器人的另一点是用户事务失败。所谓交易失败是指在执行用户的交易时由于用户设置的滑动而无法完成交易的情况。在上面的示例中,如果用户的交易失败,则机器人将无利可图。不仅如此,他们将会损失矿工费和交易费。

具有讽刺意味的是,机器人最担心的用户交易失败是由机器人本身引起的(太多的机器人争先恐后地在用户面前购买某种货币,导致用户购买时价格差异巨大)。当您在浏览器中的某个事务中看到此错误时,主要是由于机器人抢劫造成的:

以太坊黑暗森林的深度体验:DeFi套利机器人如何掠夺用户?https ://cn.etherscan.com/tx/0xbc236137de0d6a9f82c04039b1c534b9d76789a8a4bda0f3546c87f9e509f016

普通用户害怕机器人,而小型机器人则害怕大型机器人。但是,大型机器人不是终点。这里食物链的顶端不是别人,而是每个人都正式熟悉:矿工。

矿工

交易顺序决定了利润的分配,矿工有权确定交易顺序。矿工加入了这个收割游戏,彻底改变了机器人的模式。

遵循汽油价格订购规则,矿工可以任意分配相同汽油价格的交易顺序。矿工还可以将交易直接打包成一个区块,而无需广播交易。在此游戏中,普通用户是睁眼的玩家,套利机器人是睁眼的玩家,而矿工则是上帝的视角。

一旦有上帝眼光的矿工加入游戏,其结果就可以想象得到。矿工机器人将驱逐非非矿工机器人。这些矿工机器人将凭借其强大的能力大肆抢夺用户,从而成为以太坊上最大的黑暗力量!

解决

只要存在顺序关系,所有应用程序都将受到这种攻击。为了彻底解决这些问题,我们必须从以太坊打包机制和交易可以保护入手。从目前的发展来看,短期内并不容易。

多个选择的第2层解决方案具有转换的打包速度,可以有效地减少机器人劫持的可能性。

摘要

公开抢劫,自私自利的分类以及邪恶的矿工正在将以太坊变成一种权力游戏。这与区块链中的公平,开放和平等的概念背道而驰!

将来,如果以太坊的发展不能有效地阻止制矿工的力量并监督矿工的行动,变成烂品并被有人抛弃吗?水也载着船,水也使船翻倒。DeFi不能成为公平的游戏,那它还能走多远!

2
$ 0.00
Avatar for abcddai1
3 years ago

Comments