CEX vs. DEX: Diving into the Data

ETHCC 4 · July 2021 · 19:55

Clara Medalie compares the market data available from centralized and decentralized exchanges. She examines liquidity, trading volume, trade size and trade count, considering which measurements are meaningful for each exchange model and how they respond to market movements.

Speakers

Topics

From ETHCC 4, hosted by Ethereum France.

Transcript

good morning today i am talking about decentralized exchanges in the context of centralized exchanges and i will be diving into the market data so before i go into the presentation centralized exchanges no longer dominate the cryptocurrency industry and we've seen this narrative throughout this entire conference over the past year but i like looking at data more than narratives so today i'm going to look at trends in market data rather than look at the narrative as a whole because while the decentralized finance industry is definitely innovative there are still a lot of work that needs to be done especially in the decentralized exchange space so before i get started a bit about me and about kaiko my name is clara i lead

research at keiko which is a cryptocurrency market data provider we were founded in 2014 and for the majority of our existence we have solely collected data from centralized exchanges like binance coinbase gemini but over the past year we've spoke to more and more investors who expressed interest in dexes like uni swap in sushi swap and curve so we made a big d5 push starting last fall and now we collect data from two dexes sushi swap and uni-swap and we have many many more added in the pipeline so at kaiko our main job is to collect normalize and distribute this data and our main clients are institutional investors so we collect data from two types of

exchanges of course a centralized and a decentralized exchanges but each type is very different so before i get into the actual data i'm going to quickly go through the main differences and similarities between the two so first a centralized exchange is of course centrally managed the exchange controls your assets when you send it to an exchange you do not have any ownership there's listing fees and extensive due diligence before a token pair starts trading there's regulatory jurisdictions kyc aml rules it's quite difficult actually and this is simply because it's a centralized financial entity and they must abide by rules no matter which jurisdiction they're in on a decentralized exchange it's all

different it's completely by nature decentralized and operates on a blockchain most common is the ethereum blockchain you also control your assets at no point does a decks like uniswap control your assets you will always have the power over them not only that anyone can list a pair on a dex simply by creating a new smart contract there is no regulation or kyc but that also means that there's no control over the order flow meaning no one is actually monitoring trade data or order books or liquidity pools to make sure there's no malicious behavior so how is this data actually provided by each exchange on a centralized exchange we collect data from public rest and websocket apis all exchanges have public access to

market data today however many exchanges don't actually store this data therefore a data provider is very important for making sure we collect and store data so that the rest of the industry has access to clean data feeds but that's all different on a dex by nature every transaction and liquidity event is added directly to the blockchain network therefore you can actually go directly in browse the blockchain ethereum blockchain network and find every individual transaction that happened on uniswap so what does that mean for a data provider that means we actually have to build blockchain data infrastructure in order to scrape the ethereum blockchain to collect these data feeds and i really believe that as dexes and centralized exchanges converge

market data providers will increasingly need to build blockchain data infrastructure in order to really capture the trading activity in the industry now how can we actually compare a centralized exchange versus a decentralized exchange so it's important to understand a bit the architecture of how these exchanges actually operate on a centralized exchange how does a trade happen you pretty much have market makers placing bids and asks on what's called an order book when i let's say i'm a trader i want to buy bitcoin i will place what's called a market order and this order will be matched to either the best bid or the best ask on the order book liquidity is actively managed and you

actually need to be quite sophisticated in order to be profitable as a market maker almost all liquidity in crypto is provided algorithmically at this point um and it's by these big market-making firms and so there's definitely huge barriers to entry to providing liquidity on a centralized exchange and that's all different on a dex and that's the biggest difference between these two types of exchanges is how liquidity is provided on a decentralized exchange liquidity is almost always provided passively and of course i say almost always because more and more dexes are creating new opportunities for providing liquidity there that are a bit more sophisticated most notable of course is uni swap v3 but i'll just for this presentation

assume that liquidity is passive on a dex and so what does that mean it means that in order to provide let's say the bids or the asks for a trading pair you simply deposit pairs of assets or multi-asset groupings into what's called a liquidity pool so this liquidity just sits in the pool until a buyer or a seller comes by and wants to actually swap their assets so price discovery happens through the swap of these assets in market makers in dexes they're actually called liquidity providers they're actually quite passive and they don't really influence the price of the asset so again i'm not this presentation isn't about dex market architecture it's definitely

complicated and it varies from decks to decks but the key thing to remember is that the difference between how these exchanges operate is how liquidity is provided so today i will be analyzing trade patterns on four exchanges i'm talking about uni swap which is the largest decentralized exchange by far it has the highest volumes you have sushi swap which is i think at this point a top three exchange but it's a direct fork of the uni swap protocol you have coinbase which is the largest regulated exchange and then you have binance which is by far the largest exchange globally today i'm only going to be looking at the highest volume pair on each exchange

so why the only the highest volume pair why not the entire volume of each exchange this has to do with the difficulties that come with aggregating volume data on dexes because anyone can create a trading pair there are thousands and thousands of trading pairs often with little to no liquidity on uni-swap and sushi swap and not only that the actual collection methodology for getting and aggregating this data differs according like data provider to data provider so if you look at volume of uniswap on coingecko and compare that to volume of uniswap on uniswap and volume of uniswap on coinmarketcap you will always get three different numbers and this simply has to do with the different methodologies for aggregating this data

so in order to form a stable basis of comparison i simply selected the four highest volume trading pairs so the highest volume pair on each exchange on binance that's bitcoin tether on coinbase that's bitcoin dollar and on uni swap in sushi swap it's the ustc ethereum pair so the first chart chart i did is um so it's actually weekly volume i simply charted the weekly volume for the highest volume pairs on each exchange and what we can see is very much expected binance dominates coinbase is number two but you can see a little bit uni swap and sushi swap they appear starting in may on this chart but yes let's zoom in a bit and here we can see

the cumulative volume since september again binance has processed a massive amount of volume for their btc tether pair more than nearly 900 billion dollars and everything is converted to usd coinbase a little more than 200 billion and uni-swap and sushi swap it's quite impressive considering dexes only became popular last summer they've already processed many like double-digit billions in for the highest volume pair so it is impressive how far dexes have come but when looking at the data you see that centralized exchanges definitely still dominate the like the i would say the top-tier assets which are bitcoin and ethereum so i'm going to skip this and go back

but the next chart i want to look at is trade count so again this is weekly trade count not daily trade count is something that i have not yet seen any data provider or researcher analyze and this is because most other data providers are simply looking at aggregated volume statistics at keiko we collect every individual tick level trade therefore we can actually quantify the number of trades that happen for each trading pair so here i've charted the weekly trade count nearly identical chart but we notice a different trend we can see that the ratio of centralized exchange trade count to decentralized exchange trade count has fallen dexes have a very very small like

percentage of total trade counts and if we go back and look at volume you notice that that ratio is just a little bit higher for dexes so right now we know that trade volume has been increasing on a decentralized exchange they definitely have since september but trade count on the other hand there's something weird going on here i've charted the trade count on dexes compared to sexes and they're right next to each other because of the huge difference you can't really tell in the previous chart so here you can actually get a better basis of comparison and you can actually analyze the trend line in trade count across these two types of exchanges so let's just look at binance

for the bitcoin tether pair on average about two million trades every single day are executed on coinbase it's a bit about 500 000 a day on uni swap it's only five thousand to ten thousand trades a day and on sushi swap even less it's about one thousand to two thousand trades a day and again this is for the highest volume pair on each of these exchanges so another thing to point out is the trend line on binance you see a very clear trend you see an increase in the trade count from october to april on coinbase you see a similar increase trade count has nearly quadrupled on binance but now let's look at uniswap what's going on since october to april of this year you see a

slight surge but overall you can pretty much draw a flat line through that curve so we see that volume has increased on uni swap and sushi swap but trade count has nearly stayed the same so how is that possible on centralized exchanges the like the ratio between volume and trade count almost always stays the same when volume increases trade count increases but on dexes we don't see that happening so let's see why right now i'm going to take the ratio of volume to trade count which is otherwise known as the average trade size the average trade size is simply the average volume in dollars of every transaction that happens over the course of one day so here i take a 30-day moving average of the average trade size

and you can see it's quite it's quite a fascinating chart on binance and coinbase the average trade size is about two thousand dollars per trade and it has stayed very consistent since july of this year but when you look at uni swap and sushi swap it's completely different you see spikes you see drops in trade count not only that you see a massive surge in the average trade size so what's going on if volume is increasing trade count is staying flat of course the only way that can happen is if the average trade size is also increasing so here i take the average trade size for all pairs on the exchange just to make sure it's not only happening for the ustc eth pair

so here i take thousands of instruments trading on this exchange and then i take the average and again it's very high on coinbase and binance the average across all trading pairs is just about four hundred to five hundred dollars on uni swap the average peaked at more than fifteen thousand dollars a trade on sushi swap more than twenty five thousand dollars a trade and again for the highest volume pair it peaked at eighty thousand dollars a trade just so you get an idea like that is massive that would never be able to happen on a centralized exchange and so first like why is this happening um my next chart shows something a very similar curve i have the ethereum network transaction fees and you can see that there is

nearly a direct correlation between the dex trade size the average trade size on a dex and the ethereum transaction fees so here i overlaid the average trade size with the ethereum transaction fees and you see that trade sizes surge when transaction fees surge and this makes sense um when i first looked at this chart i thought okay of course if the transaction fees on ethereum are high that means fees for trading on uni swap and sushi swap will be a lot higher therefore it automatically self selects for high volume traders if i'm a low volume trader i only want to buy let's say a thousand dollars in ethereum it's going to be economically unfeasible for me if the ethereum trade size transaction fee is so high but then i thought about it

if that were the case and ethereum transaction fees were causing average trade sizes that doesn't really make sense you would assume that in these low periods of low transaction fees that the trade count would increase low fees in there would be an inverse relationship between the ethereum transaction fee and the actual trade count but again when i showed you that chart trade count is actually flat so what's going on then i thought what if it's a chicken in the egg problem what if it's ethereum average trade size what if it's uni swap average trade sizes that are actually influencing ethereum transaction fees rather than the other way around so how would that happen and this has to do with a concept called

front running and this is one of the most i guess talked about issues with trading on a dex um like at this time and so what does that mean like in the context of a dex so front running i like by nature a decentralized exchange is um completely decentralized and every transaction is public meaning anyone can monitor transactions before they are actually added to the blockchain so transactions sit in what's called like the mempool and this is on the ethereum blockchain and so if you're a trader and you want to get ahead of a large trade you can actually place a trade in front of a transaction you see by raising the gas fee so let's say you see a large trade that's about to happen on uniswap and you want to front run that

trade you'll do that by incrementally increasing the gas fee so that you pay more and so that the miner is incentivized to add your transaction to the blockchain before the large trade that you see so what happens if you have many traders that want to front run at the exact same time you get what's called a bidding war and bidding wars happen when the when the gas fees of traders they're mostly bots they're just bidding back and forth and they're incrementally increasing the gas fee until one drops out and one becomes the front runner after that happens then the front runner will instantly execute an opposite transaction after the first trade happens and so that's how they profit that's how they profit through front running and it's a

little more complicated than that but for the scope of this presentation i'll leave it at that so to summarize dex transaction fees index average trade sizes could be influencing the transaction fees of the entire ethereum blockchain and so there's definitely a lot more research that needs to be done on this but i thought it was fascinating to see that on both uni swap and sushi swap you see a very similar trend in the average trade size and again going back to dexes and transaction fees everyone knows it is very expensive to transact on the ethereum blockchain high gas prices make most transactions on the blockchain economically unfeasible for low volume traders and this ultimately is exclusionary if i want to buy only a thousand dollars of

ethereum then i'm going to go to coinbase where i know i have a stable transaction fee and this begs the question who is actually trading on a dex if front running is such a big problem is it only arbitragers that are trading is it only front runners that are trying to extract maximum value from every transaction and this is an open question i'm not fully sure more research needs to be done but it leads me to my final slide which is that market data is greater than narratives when we look at average trade size it shows there is a big divergence between what you see with volumes and what you see with trade counts and this is interesting because most data providers only have access to aggregated trade volume and so this makes it difficult to

actually analyze trends that are happening at the tick trade level and ultimately trade count the fact that it's nearly flat on uni swap for the highest volume pair shows that dexes still have a very long way to go before catching up to a centralized exchange and ultimately transaction fees still pose a significant barrier to widespread adoption but at the end of the day the defy industry index industry continues to innovate at a rapid pace you see on uni swap v3 you now have more options for providing liquidity not only that transaction fees are actually going down because of this and so ultimately i see convergence of decentralized and centralized exchanges but for now there are still lingering problems

so thank you very much you