Understanding DEX Aggregators’ On-Chain Activity
As the decentralized exchange sector matures and DEXs start to form their edges in the market, the importance of DEX aggregators is more pronounced than ever.
Although the DEX market is still very much oligarchical with Uniswap and Sushiswap occupying over 68% of the DEX market share, protocols such as Curve and 0x’s native DEX are able to generate over $250 million volume on a given day as well. Additionally, some long-tail assets have better liquidity on one DEX over another, or are only available on certain DEXs.
As such, aggregators emerge as a way to address the problem of liquidity fragmentation and provide the best price execution across DEXs. This process is usually rather complex, involving some combinations of order splitting, routing, and gas fee optimization, and the different ways these tools are used together have deterministic influence on the final price of a trade.
However, currently there is very little research focusing on how aggregators execute orders and what their order execution logic is. While the overall framework of routing, splitting, and lowering gas fees remain the same, different aggregators can have very different preferences in terms of which tools to use, and their preferences may also change over time.
In this study, we reviewed over 810,000 transactions across 1inch V1, V2, and 0x, which are the top 2 aggregators in the market. We found that a majority of the transactions on these aggregators are for major assets such as ETH or stablecoins, and small to medium-sized trades (<150 ETH) tend to be more popular.
Aggregators also do not usually choose to perform order splitting, although order routing is more common. Notably, 1inch performs both more routing and splitting than 0x. The number of splits and hops also have varying degrees of impact on gas fees.
It is important to note that the order execution logic described in this report is derived from the aggregators’ final transactions history as extracted from Etherscan. Therefore it may not fully reflect how their algorithms actually work. Nevertheless, it provides a useful glimpse into the inner working of aggregators and helps us understand the role that aggregators serve in the increasingly more complex DEX ecosystem.
The contracts we use to extract these aggregators’ transactions and the time periods our research covers are listed below.
Aggregators overlap on many common trading pairs
To understand what assets are traded on these aggregators, we parse all the trading pairs on 1inch V1, V2, and 0x. Note here that A/B and B/A are counted as two different trading pairs. This is because although A/B and B/A cover the same two tokens, their directional differences can result in aggregators’ completely different executions.
There are a total of 330,000 trading pairs on 0x, 1inch V1, V2 together, each having 90,000, 120,000, 220,000 pairs respectively. We found that the top 1% most frequently traded pairs across the three protocols account for 40% to 60% of the total transactions, and these trading pairs mostly consist of major assets such as ETH, USDT, USDC, and DAI. The chart below shows the transaction distribution by trading frequency percentiles.
The three protocols overlap on a substantial portion of these top 1% trading pairs. Specifically, 41 out of the total 274 pairs are shared by the three protocols. However, while 0x and 1inch V1 only have a small number of unique pairs from the top 1%, 1inch V2 stands out with 104 top 1% pairs uniquely traded on it.
Zooming out, among the 330,000 trading pairs, only 24% of them have overlaps across the three protocols. This number is significantly lower than the top 1%’s 41.6% overlap. There are around 250,000 pairs that only occur once on one of the three protocols, while 2,375 pairs were traded on all three.
The venn diagram below also indicates that 1inch V2 is able to capture more trading pairs than the other two protocols, having around 65.4% of unique trading pairs.
ETH dominates aggregator trades
The chart below shows the Top 3 most traded pairs on 0x, 1inch V1, and 1inch V2, respectively. All pairs include ETH and they together account for more than 7% of total transactions.
Around 13%, or a total of 4,129 total trading pairs contain ETH, and ETH denominated trading pairs take up approximately 64% of the total transactions.
Small to medium sized trades are more popular on aggregators
To understand users’ behaviors on aggregators, we further study the three protocols’ trade size distribution. It is worth noting that here we only analyze ETH denominated trading pairs and use ETH as the accounting unit so that the data is not skewed by price fluctuation.
The chart below shows that most transactions are for small to medium-sized trades (< 150 ETH) on the three protocols. Among them, 0x and 1inch V2 have over 5,500 transactions that trade less than 0.5 ETH, while transactions on 1inch V1 concentrate around 1–5 ETH and 150–500 ETH.
It is also worth noting that 1inch seems more attractive to large traders than 0x. Between its two versions, accounting for over 84% of the total transactions that are 150 ETH or higher, which sum up to 15,508 trades.
An aggregator’s final order execution route is usually a hybrid of order splitting and routing, based on the trade’s volume, slippage, DEX preference, the usage of gas tokens, etc. The algorithms that 0x and 1inch use both tend to split the order first, then complete routing.
Order splitting means to first break up an order into several sub-orders and then trade them on different DEXs. Routing refers to the involvement of a third token when exchanging token A for token B. For example, A → C → B means the order has undergone a one-hop routing. The diagram below illustrates how aggregators complete trades.
The main goal of order splitting is to alleviate the problem of AMM slippage. The larger the trade size and the lower the liquidity is on a DEX, the higher the slippage. As such, splitting is an effective way to reduce slippage. However, since order splitting in fact turns one transaction into several, it actually increases gas fees as well. Therefore, to assess whether an order splitting action is successful, it is important to balance the profit from slippage reduction against gas fee cost.
Order routing, on the other hand, is needed when certain trading pairs do not have a direct liquidity pool, or their pools have limited liquidity.
Aggregators prefer less order splits
Our analysis shows that order splitting does not occur frequently across the three aggregators. On 0x, only 6% of transactions are split, while the numbers on 1inch V1 and V2 are over 20%, respectively.
We further categorize order splitting by how many sub-trades they generate and chart out the result as below. -1 means that some order splitting has been performed, but Etherscan does not provide details on exactly how many splits occur. 2 means that one split has been performed to create two sub-trades, etc.
Across the three protocols, most orders are only split once or twice. On 0x, only 5.8% of the trades are split, and most are split only once.
Most orders on 1inch V1 and V2 are also split once. The most complicated order on V2 has 15 suborders resulting from 14 splits, while on V1 there are orders that have been split 17 times. In comparison, 0x’s highest split is 7.
Aggregators like to route orders
Compared to order splitting, routing is more common among the aggregators. Over 70% of the transactions on 1inch V1 and V2 include some third tokens, while 0x shows much less appetite for routing and only has 26% of its orders routed.
As previously mentioned, 87% of the trading pairs on these aggregators do not involve ETH, and many of these pairs contain long-tail tokens. Therefore it is not surprising to see a higher percentage of the orders being routed.
A closer look at these routed orders reveals that 1inch V2 and 0x exhibit very similar patterns when it comes to order routing. Both tend to only route their orders once and have fewer transactions the more third-party tokens are involved. However, 1inch V1 has most of their orders routed one to three times, although proportionally it has the same amount of orders being routed as V2.
Routing and splitting both impact gas fees, but to varying degrees
One of the biggest challenges that aggregators face is gas fees. Order routing and splitting increase the complexity of a transaction and also add to the gas fee it needs. Gas fees have always hindered the adaptation of aggregators — even though aggregators are able to provide the best price execution, it may not be the best place to trade due to high gas fees.
Below we analyze how gas fees, the frequency of order splitting and routing change through time.
Overall, 0x’s order splitting count, routing count, and gas fees all seem to trend downwards, and 1inch V2 displays a similar trend from November 2020 to February 2021. Meanwhile, the three numbers for 1inch V1 were relatively flat before May 2020 but started to move violently after that month. Notably, 1inch V2’s order splitting count decreases as gas fees rise, while the routing count stays stable.
Although gas fees are largely determined by the number of times an order is split or routed, their relationship is not exactly linear. The heat map below indicates that the average gas fees on the three protocols increase as more split or routing is performed. However, the influence of these actions on gas fees is not uniform — adding one routing token to the transaction has a greater impact on the gas fee than adding one suborder.
Uniswap is aggregators’ favorite DEX to interact with
Currently, 1inch covers 31 DEXs, while 0x has 17. To understand how the aggregators interact with these DEXs, we analyze transactions that contain Sushiswap, Uniswap, and Curve, which together control over 60% of the DEX daily trading volume. Since an aggregator can interact with the same protocol multiple times or with several protocols in one trade, we count all of these interactions even though they appear in one transaction.
The chart below shows that Uniswap is the most used DEX by both 1inch V2 and 0x, followed by Sushiswap and Curve. However, Sushiswap is not used very frequently by 1inch V1. This is likely due to the fact that Sushiswap launched around the same time 1inch V2 was deployed — the former was in September while the latter in November. Meanwhile, Curve is barely used by 0x but garners around 100,000 transactions on 1inch V1 and V2, separately.
Curve seems to fall behind the other two DEXs in terms of interaction frequency with aggregators. One explanation for this could be that Curve is mostly used for stablecoin swap and stablecoin traders tend to directly trade on Curve rather than going through aggregators. Indeed, when compared to general DEXs, Curve provides better slippage for stablecoin exchange and likely has lower gas fees than aggregators.
The three charts below show that on average, Uniswap is used once or twice a day by 0x and 1inch V2, respectively. Overall, 1inch V2 and 0x exhibit very similar and consistent patterns when it comes to interacting with Uniswap, Sushiswap, Curve. On average, Uniswap is used 1.5 times a day, while the number is 0.5 to 0.7 and 0 to 0.25 for the latter two.
In comparison, Uniswap’s utilization frequency on 1inch V1 has gone through several phases. Between November 2019 and June 2020, Uniswap was consistently called 0.5 to 1 times a day on 1inch V1. The number increased to 1.5 to 2.5 times per day during the DeFi summer, only dropped back to around 1.5 and fluctuated violently from August to September last year. This coincided with the period when Sushiswap launched. The emergence of Sushiswap has notably dampened the frequency with which these aggregators interact with Uniswap, although the number soon bounced back. 0x also observed a similar trend over the same time period.
DeFi today runs on DEXs. Platforms such as Uniswap are providing not only a place to trade all assets, but also to launch new tokens and bootstrap liquidity. Meanwhile, aggregators are the application layers built on top of the various DEXs — they are as necessary as the DEX liquidity is fragmented.
If designed properly, aggregators are able to establish a unique position in the DeFi market that does not necessarily compete with DEXs. At the same time, different aggregators can also appeal to very different user groups, depending not only on their order execution algorithms but also the user experiences they provide. By analyzing these aggregators’ on-chain behaviors, we hope to shed some lights on how their algorithms work and how their offerings advance the DeFi market as a whole.
Thanks to Lijie Huang for edits and formatting.