MEV Outlook 2023: Walking Through the Dark Forest
And A Thorough Review of the Breathtaking 2022 on MEV's Top Protocols, Best Bots, and much more that you can't afford to miss.
1. A new perspective on MEV
Currently, most reports and articles on the topic of MEV revolve around the introduction of the concept and how to introduce order into the MEV market [1-5]. The concerns include but are not limited to the following list.
The fairness of the MEV market.
The negative externalities brought by MEV, especially the attack vectors that MEV may bring to Ethereum as an essential source of incentives after switching to PoS.
The centralization risk or censorship problem related to mechanism design.
These are the directions that many blockchain protocols and application layer builders are working to address.
In addition, Amber Group presents a wealth of interesting long-tail MEV cases in their more comprehensive overview article. This article in Forbes's FinTech section gives an insider's account of the gold-digging strategies of renowned MEV searcher Nathan Worsley. It also mentions two quant agencies running MEV strategies, Wintermute and Alameda Research (which crashed a month after this article was published). Incidentally, both articles mention the concept of Payment for Order Flow, which seems to be a big trend that builders are working on, including Cowswap, 1inch's Fusion Mode, and Flashbots' MEV-share. The Nasdaq News & Insights section also reposted an article from CoinDesk about JIT bots and how MEV can boost DeFi, which shows that mainstream financial institutions are starting to pay attention to this area as well.
Of course, there is also a minor focus on the regulation of the MEV market, with the Forbes article mentioning at the end that the MEV market lacks regulation and will be unsustainable with a lack of fairness. The BIS Bulletin #58 explicitly asks whether the extraction of MEV by miners through rent-seeking or censoring transactions is insider trading and calls for regulation.
MEV can be a new blue ocean for individuals and institutions in financial engineering and quantification. And DeFi builders are increasingly concerned about the negative externalities that MEV may bring at the financial system level to protect the benefits of LPs and users. So, in addition to the general concern about the functioning of the MEV macro market mechanism, we call on you to join EigenPhi in focusing on another micro-level issue: MEV trading, as a representative, implies that liquidity data offers unprecedented opportunities and challenges.
1.1 The value of liquidity data
Twitter is one of the most eye-catching places for news about the movements of giant whales, and various address tagging services have emerged to meet investors' needs to follow the smart money. In a series of risk contagion events triggered by the UST-LUNA meltdown back in May 2022, we witnessed how financial institutions in the crypto business were sniped at by the masses and had their balance situations publicly exposed. This situation is not often seen in traditional finance because the transparency and openness of the blockchain ledger provide free access to transaction data for all. From on-chain transactions, we can get historical price information and liquidity data that is generated and updated in real-time.
The transparency of liquidity data brings risks as well as advantages. The accurate liquidity information in DeFi systems is complete and more easily accessible than in traditional finance, which facilitates the establishment of real-time liquidity-based risk control mechanisms and early insight into crises. Unfortunately, only intelligent and diligent MEV searchers and hackers are the first to discover this and gain fortune. The counterparties and protocols, which are in a weak information-gap position, have repeatedly suffered from value extraction. The spate of attacks on lending protocols through liquidity manipulation in 2022 illustrates this well. Interested readers are encouraged to read several of our previously published reports in detail, as mentioned in Section 3.
This report aims to bring attention to the value and risks of available liquidity data so that you can better protect your wealth or design better protocols to protect your users.
1.2 What we found
After nearly two years of exploration, we have many discoveries worth taking sharing.
1.2.1 Liquidity is a scarce resource that requires more proactive management.
The TVL metric was once sought after by DeFi protocol designers and users because liquidity is scarce. A protocol with a higher TVL signals capital favor and potentially more sustainable protocol revenue. As a result, various mechanisms attracting liquidity providers emerged during the development of DeFi. From the one-pool/two-pool design to Curve V2's introduction of incentive governance by splitting the dividend right and governance right of its governance token, they all triggered a battle for liquidity between different protocols and blockchain platforms.
Eventually, it becomes clear that LPs still trust the original protocols with a higher degree of consensus. DeFi's development entered the phase of improving the capital efficiency for these loyal LPs. Uniswap V3 and Aave V3 are both built around this goal. The new feature introduced in the third update of Uniswap, concentrated liquidity, attracts more liquidity into a narrow range to improve capital utilization and reduce user slippage. But as a result, passive liquidity providers are more susceptible to impermanent loss and need to be more proactive in tracking market volatility and adjusting liquidity ranges.
Some strategies adjust positions by anchoring quantitative indicators. There is a trade-off between the sensitivity associated with frequent position adjustments and the cost of the gas fee, and market makers with a more intelligent understanding of future price information have a better chance of winning.
On the other hand, a February 2022 article introduced JIT. This new active market-making strategy collects fee revenue by instantaneously adding and removing liquidity before and after one or more swap transactions. We will discuss it in Section 2.
1.2.2 One can create information differences in liquidity evaluation.
Many DeFi protocols rely on hard-coded smart contracts to execute transaction logic to achieve decentralization. This code can create bias in valuing liquid assets. Arbitrageurs are adept at finding and exploiting this information gap to earn revenue, while attackers make it and capture value.
In the past, we defined sandwich trades from the victim's perspective as a form of MEV that causes swap users to suffer more severe slippage losses by pinning them between front-run and back-run transactions. This report summarizes the annual situation of three typical MEV types, including arbitrage, sandwich, and liquidation in Section 2. We also present you with alternative forms of sandwich bots to refresh your knowledge of sandwich attacks in Section 3. Any combination of trades that creates an information gap in favor of the attacker could be a sandwich trade, and the victims are not only swap users but also LPs.
1.2.3 Not all liquidity is created equal.
The third point we want to emphasize is that there are superior and inferior liquidities, except that we used to have difficulty comparing different liquidities with objective and reliable data. Now that sufficient data is available, we believe it is possible to do this in the future and rank the value of various types of liquidity. This would benefit from providing another important reference metric for valuing assets in addition to price indexes.
The process of smart contracts evaluating liquidity is prone to manipulation. They tend to rely on the price information fed by the oracles, which is a scalar based on historical performance and hardly reflects current and future market conditions. This is particularly problematic in scenarios such as lending and clearing. Liquidity data can help improve risk control models and reduce or prevent the emergence of MEV trading opportunities with negative externalities.
In this report, we take you through a few long-tail MEV trades in Section 3 to see how MEV searchers can use liquidity data and the composability of DeFi protocols to extract wealth for themselves.
1.2.4 Liquidity costs are significantly lower compared to CeFi.
Finally, due to flash loans and permissionless lending platforms, the cost of accessing liquidity funds in DeFi is significantly lower in terms of time and volume of funds. Flash loans can also considerably lower the trial-and-error cost for attackers. Thus, the security assumptions that some protocols presuppose by calculating the attack cost may not hold water.
We are very interested in the development and application of flash loans. We found clever searchers have successfully applied it to leverage sandwich attacks involving multiple transactions, as described in Section 3. With the right combination, the role that flash loans can play is not to be underestimated.
2. MEV market opportunities and outlook
We emphasized the importance of liquidity analysis above, and we also believe MEV is the most real manifestation of liquidity in the DeFi market. In 2022, MEV bots generated revenue of at least $307 million on Ethereum. This section will overview the MEV market throughout 2022 and uncover the major trends and new opportunities based on data analysis.
2.1 Takeaways
In 2022, the number of MEV transactions increased over time. Arbitrage bots trade more frequently than sandwich bots and liquidation bots. Liquidation opportunities are more likely to depend on intense market fluctuation than conventional arbitrage ones.
Mainstream MEV bots generated at least $307 million in 2022. Arbitrage bots generated over 47.5% of total revenue. May, June, and November, three months involved in risk contagion, show significant money-making effects for MEV bots.
MEV is a fierce battlefield. The most profitable MEV bot gained a total profit of $9.2 million from arbitrage transactions, 12.3% of the total profit generated by all 2266 arbitrage bots detected. Nearly half of the liquidators have reported a loss.
After the Ethereum Merge, the top 2 block builder addresses capture over half of MEV. Although changes in the off-chain auction market for block space affected the allocation of MEV, the oligopoly pattern remains unchanged. Sandwich transactions contributed a primary incentive source to block builders after The Merge.
In 2022, the total MEV volume involving sandwich bots was $287 billion, more considerable than the arbitrage volume. Uniswap V3 was the most popular place for either arbitrage bots or sandwich bots, with a total volume of $72.8 billion contributed by bots.
As for different blockchain platforms, MEV opportunities on BSC were much more cost-effective than on Ethereum. The average cost-revenue ratio (CRR) of arbitrage bots on BSC is significantly lower than Ethereum. The total revenue generated from arbitrage is smaller than Ethereum. But thanks to the lower CRR, the total amount of profit is relatively larger. The top 10 arbitrage bots' profit share on BSC is 25%, lower than 51.3% on Ethereum, indicating a more welcoming environment than Ethereum.
2.2 An overview of the MEV market
2.2.1 Trading opportunity increases throughout the year
The frequency of MEV opportunities varies and depends on market conditions. To answer the questions of how often MEV searchers can spot opportunities and which type of MEV provides more opportunities, we analyzed the frequency of MEV transactions in 2022. Our results show that arbitrage opportunities were the most frequent, accounting for 68.3% of the market. Sandwich opportunities are around 30.6%. One thing to note is that the statistics about liquidation transactions calculated in this report range from May to December, while statistics for other types range throughout the year. Despite this difference, opportunities for liquidation transactions are far smaller than the other two MEV types, indicating that liquidation opportunities are more likely to depend on intense market fluctuation rather than conventional arbitrage ones.
The following figure shows a stacked bar plot of the monthly count of MEV transactions. The result demonstrates a rising trend of total MEV counts each month, reflecting a steady increase in the opportunities for MEV searchers in the market. Typically, arbitrage bots trade more frequently than sandwich and liquidation bots in most months.
2.2.2 Market share and trend of different MEV types
The MEV revenue that we estimated that searchers could generate from the market comes from three different types:
Arbitrage gains from narrowing the price difference between markets.
Sandwich attack gains through front-running user transactions.
Liquidation returns by capitalizing on the difference between debt and collateral values during market fluctuations.
Here are the results for the overview of revenue, cost, and profit of MEV transactions. Note that the data for liquidation starts in May.
In 2022, MEV searchers generated total revenue of $145 million from arbitrage transactions and $128 million from sandwich attacks. Although the revenue from sandwich attacks is comparable to that from arbitrage, the cost of sandwich MEV is significantly higher.
Considering the higher cost of sandwich MEV, the total profit generated from sandwich attacks is lower than that from arbitrage transactions. The arbitrage searchers generated a profit of $75 million, while only $26 million went to the profit of sandwich attackers. Sandwich attackers paid costs of nearly 79% of their revenue to block builders and validators.
Liquidation contributed to $33 million starting May 2022. With a cost of $16 million, the liquidation bots finally generated more than $16 million in profit from the market.
To gain a deeper understanding of the cost versus revenue of each month, here is a summary of the revenue generated by arbitrage searchers each month in 2022. The revenue generated by arbitrage searchers was relatively higher in January, May, June, and November, while the rest of the year showed stability in terms of revenue. This pattern was due to some "lucky" arbitrage bots generating significantly higher revenue in a single transaction. For instance, in June, there were two examples of successful arbitrage transactions, with one making over $3 million in a single transaction and the other generating more than $1 million.
The following chart shows the revenue trend of sandwich transactions throughout 2022. It is noteworthy that sandwich transactions have a higher cost-revenue ratio each month when compared to arbitrage transactions, with an average of 0.78 for sandwich transactions and 0.49 for arbitrage transactions. Except for November, sandwich bots' revenue experienced a downward trend in Q3 and Q4.
We also compared the monthly revenue generated from liquidations starting from May 2022. May, June, and November revenue was significantly higher than in the rest of the months. The chart below depicts the historical Ethereum price starting from May 2022. As seen from the chart, Ether experienced a sharp decrease in the consecutive months of May and June, leading to more liquidation opportunities. This price decrease is the reason why those two months generated more revenue compared to other months. And in November, the higher revenue was related to the CRV short-squeeze event, which triggered a death spiral on liquidating the shorters' Aave lending position.
2.2.3 MEV bots
For those interested in searchers' general behaviors, this part demonstrates several metrics depicting the major MEV bots. In the highly competitive environment of MEV bots, it is crucial to do profitability calculations in designing effective algorithms and competing strategies. This requires a comprehensive understanding of the various factors that impact profitability, as well as the ability to compare one's strategies against peers in the market. By staying informed about the latest trends and best practices in the market, MEV bots can gain a competitive edge and maximize their chances of success. The factors that will help include:
The distribution of MEV bots' PnL,
The trading frequency of MEV bots,
The duration of the bots' operation.
We also provide a leaderboard for the top 10 profitable bots of 2022 for each MEV type hoping to give a snapshot of the current market landscape.
2.2.3.1 MEV bots profit distribution
This graph shows the distribution of total profits generated by arbitrage/sandwich/liquidation bots. The horizontal axis shows the different profit ranges, and the vertical axis shows the number of bots in each range.
As we can see from the graph, there is a significant number of bots generating negative profit. The percentage that arbitrage bots were generating positive profit is 68%, which is the highest among all the bot types. For sandwich bots, the number is very close, with a percentage of 67%. For liquidation bots, it's the least at 51%.
The competition between these bots is fierce as they all aim to generate profit from the market where opportunities pass away quickly. Not all bots are successful in this endeavor. It could be related to factors such as their trading strategies, cost management, and the sophistication of their contract. We have listed the top 10 most profitable MEV bots in section 2.2.3.3, which collectively hold more than 50% of the market. EigenPhi presents a bot leaderboard and maintains a dedicated page for each bot's latest transactions. For those interested in exploring strategies, our tool would be an excellent starting point for investigation.
2.2.3.2 The lifetime of MEV bots
A significant proportion of the MEV bots are one-time bots. Searchers may use the one-time bots for testing purposes. Once they identified a working strategy, the bot was moved to a new address to consistently execute the strategy. On the other hand, long-term bots represent a smaller proportion. On average, the lifetime of arbitrage bots tends to be shorter than that of sandwich and liquidation bots.
The chart below shows the top 10 most profitable bots ranked by their profit and the percentage of this bot's profit as to the total profit of all bots. According to the data, the top 10 arbitrage bots collectively hold about 51.3% of the market value, while the top sandwich bots hold 74.8%, and the top liquidation bots notably hold 90.2% of the market value.
The competition of liquidation bots in this market is like swimming with sharks - a bloody feeding frenzy where only the strongest survive. The top 2 liquidation bots alone account for over 53% of the market value, indicating their dominance in the market. Surviving as a newcomer in this market can be challenging. Liquidation bots must find ways to outcompete these top bots' strategies to gain a market share.
Interestingly, the top-performing arbitrage bot in terms of profitability is not necessarily the most active. Despite executing fewer transactions, arbitrage bot 0xbad generates the highest profit because it creates the most profitable single arbitrage transaction. Back-running large swap transactions during the Nomad bridge exploit that occurred in August. This bot results in a profit of more than $3 million in one atomic transaction, highlighting the importance of having a superior strategy in the MEV market.
2.3 MEV before and after The Merge
During 2022, a total of $133.8 million of MEV value was allocated to miners or block builders who are in charge of collecting transactions and building the block. We also compared the scale of MEV from three different sources and the distribution of MEV among the top 10 addresses. More importantly, we compared the situations of the auction marketplace for block space before and after The Merge that was completed on block number 15537394. Here we define MEV values that are allocated to miners/builders as the sum of the priority fee and the amount of ether directly transferred through coinbase.transfer() for each transaction.
The resulting MEV values paid by arbitrage, sandwich, and liquidation transactions during the entire year are $45.8 million, $73.9 million, and $14.1 million respectively. According to these numbers, we see that sandwiches contributed more than half of MEV to miners or block builders, constituting a major part of the extra incentive source. If we look at the distribution before and after The Merge separately, it is clear that the percentage of MEV contribution from sandwich trades is increasing after The Merge.
On the other hand, changes in the off-chain auction market for block space have affected the allocation of MEV. The top 10 addresses (label source: Etherscan) with the most MEV revenue have changed from POW mining pools to block builders developing new businesses. However, according to the large percentage of MEV extracted by the top 2 addresses, the oligopoly pattern remains unchanged.
2.4 A calibration of volume involved in MEV
In order to determine the potential impact of MEV on market liquidity and gauge the level of MEV participation by each protocol, we examine the total volume that different MEV types have brought to the market, as well as the MEV volume that each protocol has involved. The following pie chart is an overview of the volume of arbitrage transactions and sandwich transactions.
The total MEV volume that sandwich bots are involved in is $287 billion dollars, significantly larger compared to the arbitrage volume, with a percentage of 87.5%. The larger volume of sandwich transactions can be related to the fact that, while arbitragers are finding the price difference through the market to generate the profit, the sandwich attacker must invest a larger volume to initiate price slippage in order to generate the profit, as demonstrated by our investigation into the sandwich impact on Curve.
We also investigated the volume trend of each month in 2022. Our findings revealed that sandwich volume consistently dominated the total MEV volume in each month, with a particularly significant increase in November. This surge in sandwich volume can be attributed to the FTX crash, which led to an influx of users flowing into decentralized exchanges to exchange their assets. This created more opportunities for sandwich attacks, resulting in a larger volume of sandwich MEV.
Sandwich MEV has a mixed impact on the market. On one hand, these attacks bring a significant volume to protocols, which benefits liquidity providers who are able to generate more fees from increased trading activity. However, the flip side of the coin is that swap users are directly affected by these attacks, with some suffering huge losses. As such, it is crucial for them to take steps to protect their assets and minimize their exposure to these types of attacks.
We also examined the level of MEV volume associated with each protocol. To calculate the arbitrage volume, we looked at protocols whose pools were involved in arbitrage transactions, while for sandwich volume, we focused on the pools of each protocol that were targeted in these attacks. The table below displays a ranking of the MEV volume associated with each protocol.
Based on our findings, Uniswap V3 is the leader in terms of both arbitrage and sandwich volume, owing to its dominant position in the DEX market. The sandwich volume for Uniswap V3 was significantly higher, by an order of magnitude, compared to its arbitrage volume. For more information on our investigation into the impact of MEV on Uniswap, please refer to our research report.
In addition, we compared the MEV volume of each protocol with their overall trading volume according to the data from Dune. While some protocols may have a high MEV volume, this may not represent a significant portion of their total volume due to the overall scale of their trading. However, in the case of protocols such as DODO and Uniswap V3, the sandwich volume represented nearly half of their total volume, making it a notable point for users to consider.
2.5 A comparison between MEV markets on Ethereum and BSC
2.5.1 The Arbitrage opportunities on BNB Smart Chain
We have compared the MEV opportunities across different blockchain platforms, as shown in the following chart. It is clear that BSC offers more cost-effective opportunities than Ethereum since the average CRR of arbitrage bots on BSC is significantly lower than that of Ethereum. Despite the fact that the total revenue that arbitrage searchers generated from BSC is $95 million dollars in 2022, which is smaller compared with the $145 million dollars arbitrage revenue from Ethereum, the total profit that BSC arbitrage searchers generates is larger than Ethereum, with a number of $90 million compared with $75 million.
2.5.2 Arbitrage bots on BSC face less intense competition compared to Ethereum.
Here is the chart showing the top 10 most profitable arbitrage bots on BSC. And the percentage provided denotes the proportion of total profits contributed by each bot.
The top 10 arbitrage bots on the BSC chain generate 25% of the total profit, whereas on the Ethereum chain, this number is 51.3%. As a result, the opportunities for arbitrage bots on BSC are relatively more equitable than those on Ethereum. Newcomers are more likely to find a welcoming environment to explore the BSC chain.
2.6 Situation: MEV infrastructures
We can detect a shift in the MEV market landscape through the significant change in MEV allocation before and after the Merge, as shown in Section 2.3. Although the underlying mechanisms that underpin the operation of the MEV market are not the focus of this report, in this part, we briefly discuss the current state of the MEV infrastructures.
The most critical infrastructure of the MEV market is the auction marketplace that ensures that transactions of MEV bots are packaged on the blockchain. To achieve a more fair MEV market, at least that is the vision of Flashbots, this auction market is starting to segment from the wild dark forest (mempool) at the beginning to the off-chain specialized auction market offered by relayers represented by flashbots' MEV-geth.
After the Merge, the Ethereum foundation started to implement the pre-PBS scheme. In the PBS scheme, the block builders, such as flashbots and builder0x69, bid for the right to build the next block, while validators propose the block with the highest offer. This approach has effectively subdivided the process of packaging MEV transactions into two auction markets, one opened by the block builder for MEV bots to bid on block space and the other opened by the validator for builders to bid on the right to build the next block. Block builders and validators can also be routed between each other via third-party relayers, such as MEV-boost, to achieve data privacy and maintain fairness. The degree of competition in both auction markets will impact the allocation of MEV bots' revenue.
The censorship resistance of those inherently centralized parties is currently a significant concern, and one of the latent forces in the crypto world is to counter this centralization trend. As the chart from mevwath.info shows, this confrontation is raging.
Another infrastructure we would like to mention that is often overlooked by the market is financial engineering infrastructure. MEV bots have a tendency to provide more high-end and specialized financial engineering services to the DeFi ecosystem in the future, and they need to rely on data services and financial derivatives tools in order to strengthen their performance.
So far, flash loans are a typical financial instrument that is popular with MEV bots, and EigenPhi is dedicated to building cutting-edge data services and on-chain transaction analysis tools for them.
2.7 Discussion: Outlook for new opportunities in 2023
Based on the analysis above, we see a strong trend of increasing opportunities for MEV bots to extract value from DeFi protocols over 2022. Arbitrage continues to be the dominant type in the MEV market, holding a major share in terms of revenue and profit. And arbitrage bots trade the most frequently in the majority of the months and pay a smaller percentage of revenue to rent-seekers as compared to sandwich bots. A comparison of the total number of unique bot addresses also shows that arbitrage bots are much more diversified, suggesting that sandwich bots and liquidation bots may have other restrictions on entry.
In the report analyzing the MEV impact on Uniswap V3 we released in November, 2022, we also introduced a new kind of MEV bot called JIT, and the JIT bots are seeing an increasing trend of trading opportunities in the last few months. Since JIT bots provide a substantial amount of liquidity for a very concentrated range around the market price, there seems also to be an increasing trend of unique swap users that can benefit from JIT activities. The slippage data from both actual swap transactions and simulation also validates this point. Compared to other kinds of active liquidity management strategies, JIT bots are trying to provide liquidity in an innovative and more capital-efficient way. It is worth considering for related parties such as AMM protocol designers to directly provide similar features, which can connect swap users and LPs in a new way while improving user experience and enhancing LPs' revenue.
Besides these mainstream MEV bots, another off-chain MEV market opens up in some DEXes and aggregations. Users' trading orders are piped directly to routers created by these protocols in the format of dark pool orders or limit orders. Searchers, no matter what they call them in different protocols, can access these invisible orders to mempools under a set of auction rules, and extract values by offering optimized settlement service. The so-called Payment for Order Flow business seems to be a big trend that builders are working on, including Cowswap, 1inch Fusion Mode, and Flashbots' MEV-share. Although this model was controversial when it was adopted by Robinhood very early on, there is no clear regulatory policy on it yet.
Payment for Order Flow is actually a kind of democratization of MEV if users are rewarded for providing the information. MEV democratization is a frequently discussed topic in the community. Another proposal is to distribute a portion of MEV revenue from validators to the ethereum community through liquid staking, although this has not yet been achieved in light of current interest rate of liquidity staking platforms such as Lido Finance. The booming MEV market has also attracted builders of the DeFi protocols to think about how to use MEV to enhance the customer experience and protect their interests.
3 Annual distinctive MEV trades
3.1 The beauty of arbitrage
On August 1, 2022, an arbitrage bot 0xbaDc profited $3.197 million at a cost of $2,057 from a single spatial arbitrage between two Uniswap WETH/WBTC pools, back-running large swap transactions during the Nomad bridge exploit. EigenTx visualized the beauty of arbitrage as below.
3.2 Diverse sandwich trades
The patterns of sandwich attacks are becoming increasingly complex. For example, on Nov 3, 2022, EigenPhi found a sandwich bot that sandwiched 35 consecutive swap transactions on Ethereum. However, this is no longer a record. The new record is a 58-layer leveraged sandwich attack until 2022. And EigenPhi also detected unconventional sandwiches with various kinds of victims.
Sandwich attacks with 56 victims
There are 56 transactions in a block that swap WETH for MEME on Uniswap V2, and the sandwich bot attacks them all together. The discovery of this transaction reveals that the Sandwich Bot does not necessarily attack only one transaction, splitting a large order into multiple smaller orders does not guarantee traders can escape being attacked. Sandwich attacks that may span multiple transactions pose a challenge to the identification algorithm, but EigenPhi's algorithm has the ability to identify those sandwiches.
Adding/Removing liquidity can also be attacked
In the original understanding, a sandwich attack would attack the swap on the DEX, thus causing an extra slippage loss to the trader. However, in our past analyses, we have found that it is not always the swap on DEX that is attacked, adding and removing liquidity might also be attacked. In the past research, a sandwich attack against adding liquidity can be seen as a risk-free arbitrage against the change in slippage before and after adding liquidity to the pool. The LP being sandwiched as well as other LPs may all bear the loss. Similarly, removing liquidity may also be attacked and LPs may bear a similar loss. Thus, LPs should be careful in setting checkpoints and be aware that sandwich attacks profit from their losses.
3.3 The dilemma of leveraged sandwiches
In some proficient sandwiches, flash loans provide the capital required for leveraging, and traders only need to invest a small part of their funds in the front-run transaction, thereby driving up the price of the victim's trade and extending the potential revenue. The downside of this, however, is that the risk of sandwiches is also increased. In particular, the sandwich will lose money if the front-run transaction is packaged successfully and the corresponding back-run transaction is not. Sandwich bots using this strategy may have to pay a higher MEV cost to prioritize the trade.
From a different angle, flash loans used to be a popular tool to enhance capital efficiency in atomic transactions. And another advantage of it is that unsuccessful transactions can be reverted, and the trader does not have to bear the corresponding losses with their own money. In the case of leveraged sandwiches, we seem to find the opposite situation, which also opens up the idea of using flash loans.
3.4 Long-tail MEV trades
If we define MEV as an additional incentive for rent-seekers to censor or reorder on-chain transactions, then the types of MEV are not limited to arbitrage, liquidation, sandwich, or JIT. The multiple attacks in 2022 can also be classified as Long-Tail MEV.
In the case of abracadabra arbitrage, the attacker exploited the protocol's price caching design, and took advantage of the update mechanism of the protocol's price oracle to complete the arbitrage. In the Mongo Squeeze and CRV short-squeeze incidents, the attackers manipulated the market's liquidity and created bad debts on corresponding lending vaults. In the case of the Ankr attack, the attackers used a stolen Ankr Deployer's Private Key to attack the token issuance mechanism and successfully reap the benefits.
At the same time, the large amounts of money flow accompanying trading often present opportunities for traditional MEV bots, and large swaps within AMMs can present significant arbitrage opportunities. In the analysis in Chapter 2, it is shown that months involving large risk events are often accompanied by higher overall arbitrage profits. In addition, the dramatic price changes associated with CRV-shorter's liquidity manipulation offer liquidation bots more opportunities. For example, in the CRV short-squeeze incident, a liquidation bot implemented a profitable liquidation strategy during the dramatic CRV price changes, earning over $1M in revenue.
The arbitrageur who benefits from the Ankr attack
In the December 2022 Ankr attack, we discovered a massively profitable arbitrage trade. On 2022-12-02, Ankr Developer's private key was stolen, and the attacker minted a large amount of aBNBc and swapped it out on DEX, causing aBNBc prices to crash. The arbitrageur astutely took advantage of the fact that the lending protocol Helio failed to update the price of aBNBc in a timely manner and still regarded aBNBc as pegged to BNB. Therefore, the arbitrageur could deposit aBNBc to the lending vault as collateral and borrow excessive HAY even when the collateral was dramatically depreciated. He acted quickly following the initial aBNBc minting transaction by the attacker and before the aBNBc market entirely collapsed, allowing him to conduct small-scale tests within one hour and successfully finish a high ROI trade where he earned 15.5 million BUSD with only 10 BNB.
In the midst of the huge disruption caused by an attack, it often presents a vast MEV opportunity, and this searcher's sensitivity to the microstructure of the DeFi market shows his advanced ability to profit from liquidity calculation. The rapid response of the Helio arbitrageur and other participants shows that searches on the chain are more effective than automated protocols in gathering information and identifying trading opportunities or risks.
Appendix: A glance at Helio arbitrageur's trading process
Step1: Swap BNB for aBNBc
Step2: Deposit aBNBc
Step3: Borrow HAY
Step4: Swap HAY for BUSD
4 MEV bots and the DeFi ecosystem
Since the notion of MEV became popular, most people's first impression of it is negative. MEV incentivizes miners to rent-seek for the demand for packaging transactions with significant revenue, and the PGA competition among MEV bots raised the average level of transaction fees on Ethereum. What's more, MEV may also threaten the security and decentralization of the blockchain protocol itself. MEV bots can extract values by monitoring pending transactions and front-running or sandwiching their targets, which is a negative externality many protocol builders seek to mitigate.
But one must face the fact that MEV is fundamental due to the nature of blockchain protocols in achieving openness and transparency. From the DeFi protocol's perspective, MEV bots can also provide several values, despite some concerns associated with their activities. The most common arbitrage bots detect price discrepancies between DEXes or CEXes and profit through buying low and selling high. Their calculation of the price deviation of liquidity pools enhances the efficiency of market price discovery. Liquidation bots monitor the health ratios of collateralized loans and initiate liquidation once the collateral value falls underwater, which facilitates the deleveraging process, especially when the market moves volatility.
In the future, like the JIT bots and statistical arbitrage market makers that are emerging in this market, more diverse bots will emerge that are computationally savvy, profit from superior data analysis and financial engineering, and are an essential part of the DeFi system's ability to smoothly automate its operations.
On the other hand, the interaction of MEV bots with other participants of the DeFi protocol has become more complex and important. As revealed by the alternative sandwich and JIT bots, the victims of sandwich bots are not necessarily simply the swap user, but also the LP. Swap users do not necessarily bear more slippage losses thanks to sandwich bots, but may benefit from the slippage discount brought by the JIT bot.
In 2022, EigenPhi conducted an in-depth analysis of the impact of MEV on the two major DEX protocols, Uniswap V3 and Curve, respectively. On Uniswap V3, the size of the mainstream MEV bot's revenue accounts for 25% of LP's revenue. On Curve, the MEV volume accounts for 20% of the total volume on most days.
EigenPhi uses a genetic algorithm based on token flow patterns to identify MEV transactions, which can basically cover most of the DEX asset pools in the market. According to EigenPhi's analysis, during the entire year of 2022, arbitrage and sandwich bots contributed a total of $328 billion volume to DEXes, approximately 49% of the total volume, $666 billion (source: DefiLlama), generated on DEXes for the year.
In summary, we can see that MEV bots have become an integral part of the DeFi community that can not be ignored. Understanding the transaction relationship between MEV bots and other entities can help stakeholders better understand the long-term impact of MEV on AMM.
5 Reference
[1] Flashbots Transparency Report — December ‘22 & January 2023: A million blocks post-Merge! Flashbots, 2023. https://collective.flashbots.net/t/flashbots-transparency-report-december-22-january-2023-a-million-blocks-post-merge/1237
[2] MEV: The First Five Years. James Prestwich, 2022. https://medium.com/@Prestwich/mev-c417d9a5eb3d
[3] MEV: Maximal Extractable Value, Part 2: The Rise of the Builders. Galaxy, 2023. https://www.galaxy.com/research/whitepapers/mev-the-rise-of-the-builders/
[4] Extractable Value. Amber Group, 2022. https://medium.com/amber-group/extractable-value-7b0d4356a843
[5] The Secretive World Of MEV, Where Bots Front-Run Crypto Investors For Big Profits. Forbes, 2022. https://www.forbes.com/sites/jeffkauflin/2022/10/11/the-secretive-world-of-mev-where-crypto-bots-scalp-investors-for-big-profits/?sh=2ec013252d8d
[6] Miners as intermediaries: extractable value and market manipulation in crypto and DeFi. BIS, 2022. https://www.bis.org/publ/bisbull58.pdf
[7] Just-In-Time Liquidity: How MEV Can Enhance DeFi on Ethereum. CoinDesk, 2022. https://www.nasdaq.com/articles/just-in-time-liquidity%3A-how-mev-can-enhance-defi-on-ethereum
[8] Post-Merge Daily OFAC Compliant Blocks. MEV Watch, 2023. https://www.mevwatch.info/
[9] A Super 37-Layer Sandwich Trade Including 35 Preys. And They All Have Been Taxed, Attackers Included. EigenPhi, 2022. https://eigenphi.substack.com/p/a-super-37-layer-sandwich-trade-including
[10] A Brand New Sandwich Bot That Could Empty LP's Wallet. EigenPhi, 2022. https://eigenphi.substack.com/p/a-brand-new-sandwich-bot-that-could
[11] Casting a Magic Spell on Abracadabra. EigenPhi, 2022. https://eigenphi.substack.com/p/casting-a-magic-spell-on-abracadabra
[12] Cleaning Up of the Battlefield of Avi and Curve. EigenPhi, 2022. https://eigenphi.substack.com/p/cleaning-up-of-the-battlefield-of
[13] An In-depth Analysis of How AAVE's $1.6 Million Bad Debt Was Created. EigenPhi, 2022. https://eigenphi.io/report/aave-bad-debt
[14] The Arbitrageur Who Beats Everyone Else in An Hour. EigenPhi, 2023. https://eigenphi.io/report/ankr-exploiter-report
[15] A Liquidation Strategy That Profited $1 Million During the Creation of Aave's $1.6 Million Bad Debt. EigenPhi, 2023. https://eigenphi.substack.com/p/a-liquidation-strategy-that-profited
[16] MEV's Impact on Uniswap. EigenPhi, 2022. https://eigenphi.io/report/mev-impact-on-uniswap
[17] 10M Revenue Drain in 5 Months: MEV impact on Curve. EigenPhi, 2023. https://eigenphi.io/report/mev-impact-on-crv
[18] Dexs volume in Ethereum. DefiLlama, 2023. https://defillama.com/dexs/chains/ethereum
6 Disclaimer
The "Information" contained in this post has been prepared solely for informational purposes, is in summary form, and does not purport to be complete. The Information is not, and is not intended to be an offer to sell, or a solicitation of an offer to purchase any securities. The Information does not provide and should not be treated as giving investment advice. The Information does not take into account specific investment objectives, financial situation, or the particular needs of any prospective investor. No representation or warranty is made, expressed or implied, with respect to the fairness, correctness, accuracy, reasonableness, or completeness of the Information.
We do not undertake to update the Information. It should not be regarded by prospective investors as a substitute for the exercise of their own judgment or research. Prospective investors should consult with their own legal, regulatory, tax, business, investment, financial, and accounting advisers to the extent that they deem it necessary and make any investment decisions based upon their own judgment and advice from such advisers as they deem necessary and not upon any view expressed herein.
We are open to discussion. Please feel free to contact us via contact@eigenphi.com.
Follow us via these to dig more hidden wisdom of DeFi:
Lol, how much Nathan paid you to be called "renowned mev scientist". You guys lost any credibility right there.