April 13, 2022: Curve vs 1inch Analysis π§βπ¬π¬
Comparing Best Rates Among Random Sample of Tokens
Is Curveβs new smart router more efficient than existing options? We found this to be the case anecdotally in a recent spot check, but wished to attack the problem more rigorously by selecting random pairings of tokens and measuring the results.
Introduction
The invention of Curve v2 pools Egorov (2021) allows for the capability of trading between specific tokens efficiently and in a decentralized manner. By routing among multiple such pools, trading diverse assets with low slippage may become possible without the assistance of an external oracle.
With the launch of a few dozen such v2 pools and routing at https://curve.exchange/, we have a basis to compare trading efficiency. Here we compare the quotes offered by Curve and compare the results against quotes by 1inch, a popular trading aggregator.
Methodology
We wrote a simple Brownie script to select a pair of coins from all coins listed within Curveβs registry, crypto registry, and crypto factory. We excluded the v1 factory from selection because thereβs a fair amount of noise, and often these coins are not relevant for routing.
We then sourced quotes from both routers for a smaller sized trade (~$4,000) and a larger sized trade (~$40,000) and recorded the results. All transactions were assigned to one of 9 categories:
Available on Neither: Neither Curve nor 1inch had a routing pair.
Only on CRV/1nch: Only one of the protocols offered trading.
Insufficient Liquidity on CRV/1inch: The trading pair existed, but with >10% slippage within tested amounts
CRV/1inch Wins: One protocol offered better results for both whales and shrimp
___ for Whales, ___ for Shrimp: Split results depending on transaction size
We processed 50 pairs and compared the results (2 were removed due to data contamination):
The veteran 1inch had the edge in terms of more available routes. Youβre far more likely to find cases where 1inch found a pathway and Curve could not, appropriate for a major aggregator versus an upstart service.
In raw numbers, of the 50 routes sampled, 14 (28%) were available on 1inch while being unavailable on Curve (including routes practically unavailable due to liquidity). The reverse, 5 pairs (10%) were not available on 1inch but could be completed through Curve. Neither could handle 9 pairs (18%), meaning a total of 28 pairs (56%), or a majority of transactions could not be completed by one protocol.
Weβre more interested in the βapples to applesβ comparison of efficiency when both pools could make trades. Therefore, we drilled down to just the categories where neither routing nor liquidity were issues. Looking at just this subset, we identified a slight but statistically insignificant edge for Curve in terms of efficiency. Curve outperformed in 9 pairs, with 1inch the winner in 5 pairs. The remainder split evenly by transaction size.
With only about 20 data points in this sample size, we went back and added 10 more pairs where both protocols had sufficient liquidity and routing capabilities (trials 51-60 in the spreadsheet) to get a bit more data to work with. Results are presented here, and available publicly (csv | xlsx) so the reader may draw their own conclusions.
Process
Clearly this would benefit from a greater sample size, and repeated over multiple time periods (in case of temporary pool imbalances). However, our attempt at pulling 1inch rates from smart contracts occasionally did not match the data presented on the website, so we opted to run all quotes manually. Additionally, the Curve Smart Router is only available in JavaScript, so it was non-trivial to pull the data into Brownie without writing a more complicated script. Weβre looking into building more advanced tooling to automate future analyses.
Weβre also aware that only selecting coins with a v2 pool on Curve may theoretically present a bias in favor of Curve. When tokens had to be imported into 1inch one might presume something of a home-field advantage for Curve (we did not track this variable). However, because we also did not consider the effect of Curve pool size, this theoretical Curve advantage may have been mitigated.
Tokens we might flag for concern due to medium slippage (>1%) at larger volumes on 1inch included $SILO, $BTRFLY, $PAR, and $SDT. Curiously, in the case of $SDT (trial 13 mUSD/SDT), Curve had superior transaction efficiency at the higher amount where 1inch started seeing the effects of slippage, but at lower volume 1Inch had a .3% advantage.
We did not consider the effects of gas, which may be a more important consideration than slippage for smaller sized trades.
Results
The overall takeaway was that neither 1inch nor Curve were completely dominant. Instead, it was effectively a toss-up which was better. We calculated the Curve Bonus % as the advantage gained in trading using Curve versus 1inch. We generated this number using several different methodologies to try to erase outlier effects, among all the βapples to applesβ trades. The average was as follows:
Overall: 0.14%
Whale: 0.27%
Whale (exc. outliers): -0.04%
Shrimp Only: 0.01%
Shrimp (exc. outliers): 0.02%
Here we consider βoutliersβ to be anything where the bonus exceeded >1% in either direction. As we see, using any methodology, the results were very close, with a marginal edge to Curve.
Discussion
For users, the addition of Curve as a viable decentralized routing option is fortuitous. The existence of Curve should net users a slight bonus in about 50% of trades where Curve is a routing option. Users are advised to get quotes at https://curve.exchange/ in addition to existing routing options.
Due to the fact that many aggregators may not yet integrate Curve routing, this also presents an opportunity for such aggregators. Aggregators gain loyalty by offering traders the best rates, so this is an opportunity for some such aggregators to built trust by providing better quotes than competitors.
We also note that Curve may gain an advantage over time. Curve v2 pools are also relatively nascent phenomena. At the moment, Curve routing capabilities are limited given the small number of v2 pools and relatively low liquidity. If additional pools and liquidity are added to Curve, we may expect Curve grows even more efficient as a routing option over time.
References
Egorov (2021) Automatic market-making with dynamic peg https://curve.fi/files/crypto-pools-paper.pdf
Thanks for the detailed analysis!