How do miners and arbitrage robots carry out robbery in the Ethereum network?
V客柏渊
2021-04-14 10:03
本文约1964字,阅读全文需要约8分钟
The world of Ethereum is also a rivers and lakes, some people act chivalrously, and some people rob houses.

With the development of Ethereum to this day, the currency price has been rising all the way, the ecology is getting more and more prosperous, and the pace of running towards the grand goal of the world computer is getting faster and faster.

The development of Ethereum is good, not only for speculators, but also for miners. After all, mining does not need to worry too much about currency prices, it is nothing more than prolonging the time to pay back.

Fortunately, since the second half of last year, the market has been strong, and it can be regarded as the sweetest moment for miners. At that time, a mining machine only cost more than 10,000 points, and the daily output of coins was around 0.02.

Based on the current currency price, it can pay back in a month. Many miners who are preparing to enter the market this year will be very anxious. It has increased tenfold. From my point of view, I am still optimistic about Ethereum mining, and I think now is also a good opportunity to enter the market.

Because the real value of Ethereum was discovered this year, especially last year’s Defi, and this year’s layer 2, which established Ethereum’s status as the king in the blockchain application ecology, so the currency price still has a very large rise space.

This is because even though the computing power of the entire network is increasing, the production of coins is decreasing, and the price premium of mining machines is very high, there will still be a steady stream of miners coming in. They are optimistic about the future value of Ethereum.

Although everyone is a miner, we just bought a mining machine and hosted it in the mine, but those large mines in the dark forest of Ethereum can not only provide computing power services, but also play the role of robbing houses.

Today I would like to talk to you about this aspect. It is actually very interesting after understanding. The world of Ethereum is like a river and lake. Some people are chivalrous, and some people rob houses. As long as the smart contract allows it, no one can restrain you.

The economic model of Ethereum is actually understood as an auction. The auction product is the block space that can process transactions. The miner is the producer of the block space, the mining pool is the auction house, and the user is the bidder. Under normal circumstances, miners sort and pack according to the miner's fee given by the transaction. The order of these transactions has no effect on a single transfer transaction.

But the situation changed when Defi developed, because the sequence of transactions will generate huge profits, so the market began to be flooded with a large number of arbitrage robots, how arbitrage robots rob in the world of Ethereum.

Before talking about this, I want to talk about the trading rules of DEX. Taking UNISWAP as an example, we know that its price model is x y=k (constant)

Let's make an assumption:

x=100, y=100, then k=10000.

x and y are a trading pair, under the premise of this formula,

If user A buys y with 10 x,

At this time x=110, y=90.9 (divided by the constant k10000 by 110), then user A can get 100-90.9=9.1 y.

At this time, user B also uses 10 x to buy y, then x=120, and y=83.33. User B can only buy 90.9-83.33=7.568 y for 10 x at this time.

When B buys, A immediately sells all the y he got to exchange for x, then let's see what happens?

A has 9.1 ys and sells them all. At this time, y=83.33+9.1=92.43, x=108.19, and A can get 120-108.19=11.81 xs.

Back to the beginning, A paid 10 x, after this operation, A got 11.81 x, a net profit of 1.81 x.

This is how arbitrage bots work, front-running trades, which is virtually risk-free.

The arbitrage robot will constantly monitor the Ethereum network. When it finds that a large transaction is queuing up, it will immediately increase the gas fee to grab the transaction before the large transaction, and then sell it for arbitrage after the large transaction is completed. , the robot will calculate. As long as the given gas fee can be earned back from arbitrage in the end, this operation will be executed.

This is like robbing a large account once, and using two transactions to hold the transaction of the large account hostage. It is more difficult to carry out arbitrage in the same DEX. Arbitrage robots will also wander between different exchanges, always carrying out arbitrage.

The result of this is that these robots calculate through the program, as long as they can make money, they will desperately increase the gas fee to pre-empt the transaction, which has always congested the entire network and made ordinary users spend more gas fees to carry out their operations.

Because of the existence of arbitrage robots, some service providers have begun to provide "dark pool" services, that is, these transactions bypass Ethereum's public memory pool, so as to avoid being discovered by arbitrage robots.

So whether there are natural enemies for arbitrage robots, of course there are. Arbitrage robots are also divided into performance, and weak performance may be KO by strong performance. The robot pre-empted the transaction, and the gas fee was lost before the transaction was completed.

But in this game, the arbitrage robot seems to be very cool, but it also faces the resistance of the dark pool, and the crushing of the arbitrage robot that is more vicious than him, but there is one character, the miner, who is definitely the top of the food chain, because Under the rules of gas high and low ordering, miners can arrange the order of transactions of the same gas arbitrarily. Miners can also directly pack a transaction into a block without broadcasting the transaction.

Someone made a metaphor. In this game, ordinary users are players with closed eyes, arbitrage robots are players with open eyes, and miners are from the perspective of God.

A practical financial writer who went from having nothing to a real "get" will accompany you on the road to wealth and freedom

Author: V Ke Baiyuan, principal of [Blockchain Thinking]

A practical financial writer who went from having nothing to a real "get" will accompany you on the road to wealth and freedom

V客柏渊
作者文库