How Much Is Uniswap Botted?
For an ongoing project of mine, I’ve been wanting to track every swap transaction on Uniswap pairs to try and build up a database.
As is always the case with these things, what seemed like a simple idea at the time turned into anything but.
A lot of you know of the Uniswap router. The most famous one is at the v2 router address ending in 88d. This does exactly what the name says, it plays traffic cop and routes trades to the appropriate pair contract to execute the swap.
Technically, it doesn’t actually do the swapping itself, it just facilitates it in a nice user friendly way that works well with the Uniswap website/front end.
So anyway, one would think tracking all the transactions in and out of the Uniswap router would be a good way of doing it. Nope! Not even close.
I ran a script to trace all the transactions from the past few months. Here is a breakdown of how many transactions were completed as a result of the Uniswap router function calls, in descending order:
Uniswapv3 Multicall function: 4,294,395
So 10.9 millions TX’s. Not bad. The same script also counted every swap that was called without using the router. There were 3.9 million.
36% of Uniswap transactions are NOT made via the Uniswap router.
This doesn’t mean 36% were bots. I broke the transactions down further, and with the help of the fine services of https://www.4byte.directory/ , deciphered some of the function names that were used to make the swap.
Let’s take a look:
execute : 213,309
The ‘swap’ function is kind of a common name, so it would take a bit of digging to get to the bottom of it. One major player that uses it though is the Metamask swap router.
Next is Unoswap — this is a function of the 1inch v3 router.
We then have another swap function. This is different from the first swap function due to different input attributes (I won’t go into detail, suffice to say it’s a different function with the same name). This swap function is also a 1inch router function.
So far we have 2.3 million TX’s accounted for by legitimate other routers that people use to trade, so not bots really. So we’re left with 1.7m TX’s.
The next function is where we strike gold. Here is an example TX that uses this function.
You’ll see that this function is sent to a contract that has been identified as a MEV Bot, or Miner Extracted Value Bot. You’ll see this bot does an enormous amount of transactions. This is 100% a bot. Be it front-running or other reasons.
My script identified 957 different functions, or in tech speak, at least 957 different combinations of the first 4 bytes of contracts calls that invoked Uniswap pair contracts to issue a Swap event.
Here are the next few:
0x Exchange router: 184,287
MEV Bot: 127,992
Cow Swap: 118,204
0x Exchange: 63,805
MEV Bot: 60,241
MEV Bot: 55,119
I’m not going to go through all 957 to figure out if they look like they are bots or via legitimate swap sites. But as we go further down the list, it’s more likely we will come across bots with weird and wonderful function names.
Let’s add up what we know are bots so far. There is a total of 456,000 TX’s that are MEV bots. Out of a total of the 10.9m genuine uniswap functions and 3.8m of ‘other’ functions, the MEV bots we’ve identified above account for 3.1% of transactions. Let’s be generous and assume that half of the rest of the non-uniswap function calls (665k total) are bots. That gives us another 332k of maybe bots.
That brings us to 6.7% of all swaps using Uniswap (And it’s forks!) pair contracts are being executed by confirmed, or possible Bots.
I would like to round off that this is a gross underestimation. Why? Because the bots we have accounted for above are the real hard asses in the bot world that use custom contracts to execute their trades. The ones run by people that seriously know what they are doing and are using the best minds, equipment and contacts to extract the most out of exploiting Uniswap trades and using MEV to their full advantage.
What it does not account for are the many bots out there that are using bot algorithms, but use traditional function calls like the Uniswap calls. Speaking from experience, my first few bots simply used a python web3 library to call the router v2 functions directly, which would make them look like legitimate transactions. There is no way to estimate this without some serious data mining, but I think a very conservative estimate would be to at least double the above 6.7% figure… hell some would argue to even triple it.