π§²Core strategy
Last updated
Last updated
No matter how efficient public chain transactions are, most on-chain transactions will have a waiting time of several seconds to hours. Whether it is proof of equity or proof of work, the transactions to be processed on the chain will first be saved in a publicly visible waiting area called "mempool". Then miners or verifiers select the transactions, package and sort them and generate block information. and add the block to the chain.
To put it simply, when miners select transactions from the mempool and package them, they can decide which transactions should be placed at the front of the block for execution first, and which transactions can be placed at the back of the block for execution. Under market-oriented operation, as long as traders pay additional transaction fees to miners when making transactions, miners will place the transaction in a higher position. Therefore, transactions that actually occurred later in the block may jump in line and be processed first. These additional transaction fee income often exceed the standard transaction fee income and become the main source of the maximum extractable value.
The CoinMetrics robot uses a front-running trading strategy to perform automatic trading arbitrage. Specifically, when a user issues a buy transaction, the CoinMetrics robot will immediately detect it and buy before the user by increasing the gas fee, waiting for the price to rise before selling. Achieve arbitrage.
The sniffing process of the CoinMetrics robot mainly involves the following steps:οΌ
Obtain the latest blockchain transaction information by monitoring the blockchain network.
Filter the obtained transaction information and select only the transaction information that meets the conditions.
Determine whether a front-running transaction is necessary by comparing the gas cost of the transaction.
If you need to pre-empt the transaction, send your own transaction information and increase the gas fee to ensure confirmation before the user.
Wait for the transaction to be successful, and then decide whether to sell based on market conditions to achieve arbitrage.
When a user purchases $1 million in ETH tokens through Uniswap, the transaction will enter Mempool after clicking the exchange button. At this time, the robot detected this transaction, so it automatically generated a transaction to buy ETH tokens before the block was packaged, and the transaction fee was higher than ours, so the robot's transaction was executed first.
After the CoinMetrics robot's transaction is executed, due to Uniswap's automatic market-making mechanism, the unit price of the ETH token will increase, and the price increase will directly affect subsequent transactions. Therefore, by the time it is our turn to trade, the ETH token has already risen. The actual amount of ETH received was not as much as when the order was first placed. This difference is also known as the slippage amount.
After our trade is executed, the ETH token price will continue to increase. At this time, the CoinMetrics robot generates another transaction and sells the ETH bought at a lower price in the previous transaction, just making the difference. The two transactions generated by the CoinMetrics robot just sandwiched the user's transaction and looked like a sandwich.
The trading pool depth and token demand will vary between different exchanges, so the price of the same token may not be the same. If the price difference between exchanges is large, there will be profit margins.
Letβs say you can buy 100 tokens $ABC for 1.01 Ethereum on Uniswap.
Meanwhile, you can sell 100 $ABC tokens on Sushiswap for 1.05 Ethereum.
You can go to uniswap to buy these tokens and then go to sushiswap to sell these tokens and keep the profit taking into account all gas costs.
The user configures the CoinMetrics robot arbitrage strategy to query the price of the token between different exchanges based on the token selected by the user, and looks for arbitrage opportunities. It will first purchase the token at a lower price, and then purchase the token at a higher price on another exchange. Sell. This process can also be repeated using a more complex strategy, where you can buy other coins, buy them once, sell them in another place to get the intermediate coins, and then sell the intermediate coins for Ether. While the robot is making profits, the token prices between exchanges will also become consistent, indirectly maintaining the stability of the DeFi market.
With the creation of lending platforms such as aave Finance and Compound Finance, a new way of making money has become possible.
Collateral is simply some money set aside as security for the loan.
For example, when you borrow 1,000 USDT, you must provide approximately $2,000 worth of Ethereum as collateral. The $2000 in ETH will be locked up and kept safe while you use the 1000 USDT for whatever purpose you want. When you are finished and ready to repay the loan, you contribute 1000 USDT and get back 2000 ETH.
What happens if those $2,000 worth of Ethereum loses value?
1 Ethereum worth $2000 was locked when taking out the loan. Letβs say you need 30 days to repay the loan. During this period, the value of Ethereum dropped from $2,000 to $800.
Now your collateral is only worth $800 because you locked 1 ether. But you get a loan of 1000 USDT and at this point you get more money than you used as security.
Until then, lending platforms would detect this and see "Ethereum value is falling, this 1000 Tether loan is at risk and we must close it to protect our lenders".
That's when the liquidator stepped in. The loan becomes ineffective because it is risky and the platform does not want to lose money.
The liquidator simply executes a function, sells 1 Ethereum used as collateral, and repays the loan provider the 1000 ETH while providing part of the collateral to the liquidator who executed the function.
Simply put, liquidation occurs when a trader cannot meet the leverage position configuration and does not have enough funds to maintain the trading operation.
Most lending agreements involve overcollateralization. The user's collateral must be higher than the value of their loan. When the value of collateral falls below a certain level, users may repay their debt and redeem devalued collateral. Exchanges will close leveraged positions due to partial or total losses of users.
At this point the CoinMetrics botβs liquidation strategy is able to profit from closed loans, find expired or risky loans that can be closed for profit and perform these functions.
There are many lending protocols, and the CoinMertics bot makes money by helping protect its ecosystem from non-repayment of loans or a drop in collateral.