ZKPodcast: The road to DEXs with Will Harborne

1 Aug 2019 · 58:33

Will Harborne, co-founder of Ethfinex and previously at Bitfinex, joins the Zero Knowledge podcast to trace the path from traditional exchanges to centralized crypto exchanges to today's decentralized exchanges. The conversation covers what role DEXs actually play in the market and touches on Phil Daian's research on frontrunning and transaction reordering, an early look at what is now called MEV.

Speakers

Topics

Transcript

[Music] welcome to zero knowledge a podcast where we explore the latest in blockchain technology and the decentralized web the show is hosted by me Anna and me Fredrik [Music] in this episode we'll sit down with will from e3 next to talk about the history of crypto exchanges and how they've evolved into these decentralized exchanges over time so before we start we wanted to say thank you to you our

listeners if you like what we do please do subscribe to us on your favorite podcast app and maybe leave a little review you can follow us on twitter at zero knowledge fm or join the conversation on our telegram chat we really like to hear from you about topics that you would like us to cover or ideas in the space that interest you and if you'd like to support the podcast there are a couple ways to do so you can support our get coin grant patreon account or donate directly all the links on how to support or in the show notes lastly if your project you would like to sponsor please get in touch at hello at zero knowledge dot F M so thanks again for being part of our crew now here's our conversation all about Dex's with will from eath Phenix so today we're

gonna be talking about Dex's and we have a really good guest here to help us do that welcome will from ethnics hi Anna hi Fredrik hello hello I think we have a lot to cover and I'm super excited to jump in but I think maybe to start if you can just tell us a little bit about what you work on and maybe what you were working on before this okay so I I'm an engineer by background and I got involved in aetherium initially back in 2015 and started building various products and then joined BitFenix actually to work on various of their sort of early experiments and products using a theory and particularly listing

tokens and a whole load of other stuff that they were building internally and then prior to that I'd been working with group of friends on some decentralized exchange experiments and I discussed with BitFenix and they were interested in supporting that so we spun out this new company Etha next to basic focus on growing trustus exchange technologies and a lot of that's been research and development led but we did also launch several products over the last few years for trading Trustee between uses noncustodial wallet so today what we want to talk about our Dex's and it's interesting we've actually never really dived into Dex's on this podcast Texas being

decentralized exchanges exactly and I think we I think we'll I think you're a great person to help guide us through this especially given the fact that your background is working in a more centralized exchange and you've moved over to building a decentralized exchange so I think it's gonna be really cool to get into that we can start a little bit on on pre decentralized exchanges and just talk about centralized ones and something that I found kind of interesting with the whole crypto space evolving is most people know of exchanges as like the New York Stock Exchange or you know these big like the Tokyo exchange or like some some things like that that there's like

one major exchange in a country and that that's all there is and then in the crypto space we still see like big players but it's you know way way more exchanges in general and and under very different sort of quote-unquote regulations or in terms of what kinds of regulations they follow and how have you seen that space evolve and like what's the relationship yeah so I think the centralized crypto currency exchange space itself is actually very very interesting and given that the real sort of big change that happened I think when a lot of the exchanges in originally

just Bitcoin started launching was that they're open so unlike New York Stock Exchange London Stock Exchange which have very high barriers to entry not just to launch draw exchange but also for the customers who are using them a lot of these early ones were kind of spun up very quickly and initially not much interesting technology and quite slow they went down all the time but the big innovation that they made was that anyone could connect often anonymously and trade cryptocurrencies and so for the first time you had quite a big and growing market for people wanting to exchange products with each other but where you had not just a hundred members joining which is what

you typically would have on the New York Stock Exchange and everyone else accessing via them but potentially tens of thousands of people all connecting into one system and that led for that I think for the first time to have huge amounts of investment actually start going into creating exchange products and at that stage we're not talking about decentralized exchanges but we're talking about just being able to connect and trade with each other but in an open ecosystem where suddenly all this technology had been built before and existed owned by London Stock Exchange New York Stock Exchange but was then suddenly in the in the publics public sphere so you had developers who typically would not have been interested in even finance necessarily working on building all these systems and that's I

think what led to all the early innovation and then later on to the things we're now saying with these centralized exchanges you know any centralized exchange that is open source so actually so I initially when I joined this space I started working a bit for necks and BitFenix was based on some open source code which was released by a couple years ago basically by it by one of the failed cryptocurrency exchanges and it was then developed on significantly but ever since they've also been big believers in open source so a whole load of the audit order placement strategy frameworks and a lot of the front-end code is now starting to get open sourced and increasingly as

well several other cryptocurrencies exchanges although to a lesser extent so far as starting to release a lot of open source code and the interesting thing about that is although at the moment it's not the kind of core matching engine technology which is what a exchange is really built on that part is actually the the easy part anyone can builder or a lot a lot of good developers can build matching engines and is actually one of the things that as a computer science graduate you often do early on I just almost isn't it as a sort of assignment but the harder parts are the gateways and all of the code that goes into generating strategies and that that side of things is now what's getting open

sourced and what that means is people can start to build on top of them they can build all sorts of more complex algorithmic trading strategies which previously you could only really do if you had access to and test them and back test them on real data from big sent big traditional financial exchanges so suddenly you've opened it up to a whole new group of people something peripheral or like near a lot of the financial systems are things like Bloomberg and I always wondered like in a centralized exchange in in the crypto exchanges are there pieces of Bloomberg like technology incorporated into it or is that something that's actually you're waiting for a secondary market to come

around and build this stuff so there's certainly a lot of and technologies that get built on the data source is coming from exchanges and similar to where the way that Bloomberg might feed in from multiple data sources and also then allow people to start to build other products on top of it and that's also been one of the big changes here is that I don't think there's any crypto currency exchange which charges for access to its order books and data feeds and therefore again there's the ability for people to build charting software's to build all sorts of analytics tools and sentiment analysis and just make this data public and I think that's what's probably contributed so much to

the high liquidity we see on cryptocurrencies in proportion to you know the size of them as assets because people can get excited and developers do come along and just launch something and release it open source and someone comes along and improves on it so in a way it's the combination of traditional financial ideas with open source development community although I think a lot of people look skeptically at centralized crypto currency exchanges it does have that open source mentality in a lot of ways I mean the data point is interesting it's also I mean in in like the New York Stock Exchange there and being one of the major players their data is much more valuable because they are such a large player and when you have a hundred exchanges all trading the same assets you know one

individual data source is less valuable and in there the value values in in the aggregate of all of their data sources innocence yeah so we're here to talk about decentralized exchanges and not centralized ones so it's interesting to see how that has shifted and I'm curious later to dig into like some of the aspects of an exchange like what are their components and how are they replicated in index but let's start first at what is a decentralized exchange and why would one want one so I think there are a lot of different ways of looking at these centralized exchanges and a lot of the ones that we've seen launched so far are in the

kind of early days of Dex technology where basically replicas of what you would see on a centralized exchange and which doesn't always fit directly onto a blockchain but in essence I think what we usually mean when we talk about Dex is noncustodial so there's no there's no one else you have to trust with your funds in order to be able to trade with counterparties and you don't need permission in order to trade with those counterparties and in the kind of ultimate sense that you can permissionless lis transact with anyone without having to go through other intermediaries do you think that Dex is in a way though are like are they the

true crypto exchanges like like kind of how you said centralized exchanges at least the initial ones were copies of more traditional exchanges sort of with those models but when you think of a Dex could that actually be like does it still have to take up that space of an exchange or can it be like is it something that could almost disappear more than a centralized exchange could so I'd certainly see that and I think actually ultimately centralized exchanges should or will end up going that way as well it's just that we're very early in this industry and there's a lot of new technologies coming forward but really all exchanges is it the infrastructure layer it should be to facilitate and actions between multiple parties when

they want to exchange currencies or other assets but it shouldn't have to be something which your end user comes along and uses and I think we're still at the stage where there's too much to learn and too much differentiation still available but it will become a commoditized force and certainly dex is I think are much closer to that already because you sit you end up with a very much simplified version of what you would have with a centralized exchange where you need to connect in and maybe even have a relationship with not just the exchange but maybe maybe your counterparties which as you reduce out those relationships you can in theory long term reduce your costs as well and start to in a not very sexy way but start to really turn it into just

something that's almost invisible at the infrastructure layer I almost want to map out a little bit of a history here to try to understand kind of how maybe and I think you might you might know this well but like what were what were the first centralized exchanges that actually came on the market so the kind of largest and most well-known one in the early days was mt.gox but there were several others that were much more well than much maybe less successful before that and several of those go had quickly disappeared or had all sorts of other issues and and on the whole they I think most of them weren't built model much on kind of traditional central limit order

book exchange an empty box was of course the when I think that most people have heard of which suddenly took off and at the same time that Bitcoin was really becoming talked about in the news and in the aftermath of that I think after they collapsed a whole load of new exchanges kind of sprung up to fill the spot of which if an X was one bitstamp as well was one of the the biggest following that and then I think we saw a kind of diversification happen over the next few years of a lot of people actually who had much better understanding of financial systems come in and start to improve on these start to build all sorts of more advanced and faster and sort of more reliable exchange platforms

when did like Kraken and coinbase come onto the scene and did they come around the same time I think both Kraken and coinbase were kind of in that aftermath period and so they're still early on but coinbase mainly focused on the the retail market to begin with and was using on it's sort of back end actually other other large exchanges so when when a customer came along and wanted to buy they would actually be placing an order via API onto one of these other exchanges and fitting the the back end and of the order and later on then started to kind of build them or professional offering with coinbase Pro and which was yeah previously G Dax i I remember coinbase in the early days their pitch was

actually more around security and kind of having learned from Mon Cox and the all the other things that got hacked they were like well we were gonna have cold storage and we have this vault concept and they were talking at length about like how they you know store and we break up the keys and store them in various safety deposit boxes and all this kind of stuff and it was sort of like making a play for this is a place that you can trust to a story or a crypto I think that that ties in nicely later was like why why decentralized a changes as well I'm wondering also like in terms of so as we as we're going along this path is like there's some

exchanges that came out where UX was also like a lot better where they started to be more clear about what they could and could not do in terms of security I'm kind of curious that like at what point did the Dex's start to emerge did they emerge around the time these centralized exchanges were getting better at UX and communication or were they in an encounter to when they weren't I'm just wondering if there's any connection there I don't think it's too much to do with the UX side of things but I think it is that it was to do with at least I felt the the security aspect but also actually that the power aspect I think there was a lot of commentary around for example 28:16 when Maloney X added theory on plastic which kind of kept it alive and was quite a

controversial decision which maybe had a damaging effect in the short term on aetherium and a lot of people were saying at that time why do I do these big cryptocurrency exchanges have so much power so not just the fact that of course they hold your funds and you have to trust them but that they can influence this industry in a way that most other entities can't and so given that we have the tools now to be building decentralized exchanges and there's no reason why you couldn't have built one then on a theorem and people were yeah but none of them had really gained much traction why have they not taken off and that was I think that was when I got really interested in it and that was when a lot of other kind of projects which have now launched I think started serious work on getting ready to

launch a product life as a Dex I think to me one of the major you know inflection points was the the security and just like I said I think Clinton base does a decent job with security and they take a lot of precautionary steps at erä but at the end of the day you have to trust them with your money and it kind of goes against the whole principle of blockchain says you don't want to trust anyone and you want to have that control yourself and in a decentralized exchange you you keep that controlling you you only have to trust how you deal with your keys now in reality like most people will treat their keys worse than coinbase change their keys and so they will

actually have less security in practice but you know maybe offset by the fact that coinbase is a massive target to attack and you or probably not yeah I mean I think ultimately coinbase probably is better at looking after your keys and looking after your funds than you are and there is a there's a huge shift in the responsibility you take on if you want to use a Dex because suddenly you are responsible for that but there's also in return for that you get the freedom and you don't have the frustration of waiting for two days with coin based customer support to get your funds back if something goes wrong and so I think the security aspect is something that was often I mean that was what I think people who launched early Dex's thought would win over customers

but it didn't really win out that wasn't something that that really deeply resonated with people at least not the kind of wider community it resonated with people who had been around for a long time had experienced a hack themselves but even then it wasn't a strong motivator for people to take all that extra responsibility onto themselves the thing that actually seems to have start to get people to really switch over and that now is more to do with the kind of freedom you have over your assets the fact that it can actually be faster because you don't need to deal with customer support and go through all the extra hoops of signing up or whatever else onto these platforms but I think it took a long time for people who were building these platforms to learn that the security element didn't appeal to

the wider audience although it should have it's interesting to hear you say that because I kind of feel the same way that a lot of the attraction is not necessarily to manage your own keys but to you mentioned this earlier as well having the anonymity and sort of the the freedom to transact in whatever way you want I mean that's I think as people more and more people buy into the vision of blockchain and the spirit of life decentralizing and wanting to get away from control they also buy in more into the idea of a decentralized exchange and I should be able to exchange these things without anyone overseeing it or like requiring kyc in email and that

kind of song which is both good and bad but yeah let's shift over to the history of the Dex's then so we've kind of covered centralized exchanges I think there's one exchange that we didn't mention yet which is Finance which actually is centralized but came out quite late but has done very very well but now what what were the first decks is what was the first decks so I think there's kind of there was X's pre aetherium and then there was the kind of theory instead of decks is Richard where I think things really started to take off in terms of experimentation and not the kind of growth of new types of Dex's even back before much sort of happening on aetherium there was bitshares which

had a deck sort of at that built in at the core of the product and actually though it's not talked about much it's being surprisingly successful in still running in terms of like an early decks model and it was it was very simple in terms of having Auto book on chain and that was a model that was then replicated with a lot of it Dex's so we saw a bunch start to get launched around the early days of etherium and most of them weren't used much the problem with any exchanges is getting liquidity to start with because if there's no one else trading there even if you had the most amazing technology it's completely useless because your cost is essentially infinite of trying to trade on that

platform what would that mean like say there was very few people using a decentralized exchange what it just sort of mean like you'd be like I want to buy this and then just like crickets yeah same as any exchange in that you have two components to your cost really you have fees which are charged by the exchange but it could also be like your transaction fee on sharing on a theory and paying guests and then you have the cost of actually crossing the spread so you get a worse price to buy then you get to sell and so the less liquidity and a few other people trading there you have zero fees but your cost could be that you lose 50% by trying to sell because there's no one else buying apart from in a very low price and so that would that was a big barrier

to things to start to take off but the early ones really won because they were listing everything so there was no barrier to getting a token added to these exchanges and therefore that was the kind of winning strategy that we saw really take off and all of these at least the earlier ones were with still with that order book on chain which was pretty expensive so it also means anyone can see your orders you can be front run which is when people come and place an order before you sing that you're trying to take it and then maybe try and sell it to you at a worst price again that was a interesting model just to prove that it's possible but particularly on aetherium that wasn't particularly viable given that the cost just become higher and higher each time you're

trading and therefore that does put a dampening effect on how successful the tough one can be the chairs didn't deal with a lot of the problems of aetherium because it you know that blockchain functions in a fundamentally different way and people take on costs that aren't it's altruistic in a sense but I'm curious if you know how these early decentralized exchanges actually integrated to like that they hand those tokens let's say you're trading Bitcoin on bitshares how do you know that that pick coin exists and is moved I don't know with how has dealt with this but for example to trade cross chain so Bitcoin for something else on a on a smart contract

platform with this with a state based or account based architecture you can sign promises essentially for a transaction you want to make which end it with someone else can then come along and sort of fill to make sure that you're not going to be double spending and trading with the same person twice but these are very slow processes so essentially you're limited not just by it you're limited by the slowest blockchain that's involved in that in those trades and you may also have to wait several blocks for confirmation to know that there's not been a real organization and so although actually in terms of proof of concepts of trust as trading there's a whole load of stuff that happened in this period most of

which still had order books so modeled there I mean the centralized format of having people who place bid offers and people who pays sell offers but that's not that wasn't something that could really scale to compete ever with centralized cryptocurrency exchanges but at least you know prove the concept and for someone who really cared about not trusting the fast in their trading with and is willing to jump through these hoops obviously very exciting so you mentioned bitshares is this first sort of experimental decks in a way and then what were the do you have any other examples maybe the earlier Dex's and maybe even the earlier aetherium based X's I'm kind of curious like where does something like khyber come in like where

are they in terms of the history so I think that's a little bit of a later stage so ether Delta was the one that really took off on ethereum first and to begin with had us had an order back on chain and later moved to a model that was popularized by several other exchanges on a theory I'm like idec's where the order book was stored off chain and so there is a centralized place where all orders are stored so you don't have the cost of placing and cancelling those orders but you you then only submit them on to the blockchain at the point of settlement and we started to then see all sorts of other potentially sort of more interesting models come out like Khyber at the kind of next stage really where

they were no longer copying the model of a centralized exchange in trying to put it onto a blockchain but we're trying out other models which didn't rely on an order book in the same way and that's kind of the two streams that we've seen now of trying to replicate high frequency trading which makes sense on very liquid assets but may not make sense on a lot of the assets that are traded actually on most block chains today where you could use auction models or a model like LIBOR where you have a reserve of liquidity that's it's always available on chain so there's a cost to providing that liquidity but then it means that someone can come along and trade instantly without having to find another buyer or seller to match with

directly the way I always think of a centralized exchange is you have a company and you have kind of like you said reserves that are held by that company and can easily distribute it if need be and can sort of balance those out over time but with a decentralized exchange do you still have a centralized company that owns those reserves like this is the part that's confusing is are the reserves living in a smart contract are they living in yeah so if we look at the khyber model or actually and actually much more recently although it's very simple the eunice whopper model which has some similarities actually what you're trying to do is incentivize someone else so these are market makers to come and provide

liquidity so that other people can trade with them very quickly so you have almost two sides to your market you have the market makers these are people who don't particularly themselves need to make trades for any reason but they're willing to bear the cost of providing liquidity which means that they have to basically tie up assets as collateral into reserves and and and receive a fee in return for that and then on the other side of the market you have we can call them retail traders but they're often not who are coming along and saying right now I want to buy this moment of tokens and I'm not too price-sensitive I'm just going to pay the best price I can find and who will then trade with that person and pay the fee and so if we look at the khyber model you could have and I think

Kaiba does actually run some of these reserves themselves where they provide some collateral in a certain token and if someone wants to come along and buy make a token they pay ether for maker and pay the extra fee and that goes to the reserve manager which might be kaiba themselves but actually could be any number of other people in the ecosystem so instead if I wanted to become a reserve manager for spank token I could create a new reserve deposit a whole load of spank and ether into there and someone else can then come along trade and I'll be earning the fees for it and yoonah swap has also which is taken off a lot over the last six months has done

a very similar model where there's that incentive for anyone to come along and and be that liquidity provider which then enables people to trade at relatively good prices how how do those those liquidity providers is the role then of the decks to find those individuals or groups or company's projects and bring them on board today is it sort of more of a like are they using the same interface are they kind of using something else to actually do this so I think that's just the role of any exchange actually is to create a marketplace where you have those two sides of them to the market and so it's actually the same in a centralized exchange or there in the past really it's been a very people business and that's not what often excites people in this space about finance but the reality

is that for ice for example or New York Stock Exchange a huge part of the business is people going out having nice dinners and lunches and convincing people to come and provide liquidity onto their order books so that others can come and trade and know that that's where the best equality is and we've moved to this model now particularly with well first of all with centralized cryptocurrency exchanges where again market makers are very important so you want to provide incentives for them to create thick order books with tight spreads so that there's good prices for customers you want to come and trade there and even more now with Dex's because you don't have any longer that personal relationship you can't get and someone to go out and have lunch and

convince a market maker to come and trade on unit swap because you know swap doesn't employ people to do that you instead need to bake the incentives into your exchange itself so that there's a reason people to provide that liquidity and so in unis example for exams into the reserves you get a token which then rewards you each basic aliy with a profit share on fees and so we've shifted from the kind of people led incentives to baking your incentives into the smart contract layer which of course is something which is potentially sustainable and could in the long term mean that you get greater liquidity sort

of going because of the reliable and known and smart contract enforced incentives to provide that in the centralized exchange is that incentive comes in the form of like a 0% fee if you're a market maker and you get your trading fee if you're taking and yes usually it'll be that it's based on volumes so if you do a high enough volume you'll get a 0% maker fee and therefore be able to provide the tightest spreads and actually on many traditional exchanges as a maker you'd get a negative fee so you'd actually be earning by being the one who's on the other side of all those orders curious to dig in a little bit to the to the components of an exchange like I was

saying before I think we're jumping ahead here a little bit and explaining a lot of different models and ways to actually implement this without really understanding what the what the different players in this system are so there's market makers there's market takers so there's sort of like buyers and sellers and you we've mentioned an order book which is you know just this list of orders whether it's buying or selling and you have a matching engine so that's like your components of a traditional centralized exchange where is the matching engine like you said it's a relatively straightforward of matching by order with a sell order and in the most optimal way yeah and I think there's one extra piece there which is really important for centralized

cryptocurrency exchanges but less so in the traditional world which is actually the kind of gateways which your users connect to and and send their orders through so typically you might only have to deal with a hundred direct customers if you're running a large centralized securities exchange and everyone else goes via those investment banks or prime brokers but in this space suddenly because anyone can connect you have to do one all sorts of other checks on their orders before you can put them into your order book and then your matching engine and that's where actually a lot of the innovation has happened and is also important for Dex's because you basically need to validate orders assign correctly and they have

the correct balances and all sorts of other checks which you wouldn't would you even even take even longer and do slow down your orders compared to a centralized exchange right yeah and I guess another aspect of crypto currency exchange is you also need to integrate with the blockchain or ball chains which is you know this whole other piece of how do you take money in and send money out when all the trades are settled and people want to exit or enter the exchange but yeah just component-wise that sort of API the order book in the matching engine how like in the first approaches where what you mean mentioned like ether Delta they kept the order

book on chain but I if I recall correctly I don't think they had a matching engine you just kind of manually went in and found the order that you wanted to settle against yes exactly and that means I mean and the I think a matching engine is probably the hardest thing to decentralize so it's pretty easy to build something like ether Delta where you have order books available on both sides and anyone can come along and choose whichever order they want to take and if someone and this happened all the time if someone places accidentally an order at a terrible price because they typed an extra zero people set up instantly bots which would come along and take those orders we actually had a similar experience about two months ago we

launched an OTC over-the-counter trading service where anyone can place orders and then trusted to see someone can come along and take them and know that they'll get the opposite side and within 50 minutes of launching this smart contract and user interface we saw bots competing with each other on the etherion blockchain to take badly priced orders and that was pretty eye-opening but I think also just shows the level of money that was on the table for all these decentralized exchanges which didn't have matching engines which essentially protects the user because they ensure you always get the best price since yeah the end of the day you don't have a great UX experience for that but it's quite simple to do yes like it also shows the speed at which that stuff will

be games are played yeah I remember early days of ether delt I went and looked at a couple of times and every once in a while I would see like a negative spread where it would there were it wasn't even like someone had mistyped anything but it was like you know you're at block X and you don't really see the kinds of orders that you want and so you place a new order at something and then at block you know X +1 a bunch of those orders were settled but you didn't see that because it doesn't play out in real time and then you know they had placed an order that was like with all with the knowledge of only block X made sense but block X +1 is the dumb order to place well the thing about that is it could also be a

very rational thing to have a negative spread on a theorem decks like that because there is quite a high cost of filling an order so if it's a small order that only slightly crosses the spread and your gas fee of taking that transaction is quite high actually you may need it quite a significantly negative spread before someone's willing to trade which is a strange dynamic but that's kind of the reality of unchanging also these bots are extremely straining on the theorem network as someone who deals with the transaction queue and like sees the traffic going through a theorem nodes because of these orders or like because of the bots very

interesting because it used to be like you submit one transaction that you expect to set a long chain but that's not what what happening anymore because you you submit a transaction and then you watch for other transactions and as soon as you see someone like outbidding you can be by like one way of gas fee like gas price then you cancel that transaction and send a new transaction but the way transaction cues and aetherium work is that's still there and it's still it's all like sent around and gossiped over the network so there's like thousands and thousands of transactions per second that never intend to actually make it to

the chain they're just competing with other bots I think there was an interesting paper that was published by Phil Diane called flash boys - which also looked at optimal strategies for that competition and found that actually you're better off even if you don't even if you're not watching others competing with you you're better off periodically just sending out your transaction again but with a higher gas price with the hope that it won't get included first without waiting to first see if someone outcompetes you because otherwise you'll be too late to actually get in before them but obviously a lot there's a lot this is so much money on the table for these things that a lot of people have spent time really optimizing so we've covered some of the components here and

like established that building a matching engine on chain is kind of hard even building an order book on chain has its problems and we've already talked about some of these models but what can we do on chain and like what are the models that are actually being pursued right now what's the most viable decentralized to exchange so the interesting thing is actually there are now exchanges that do have both author book and matching engine on chain but they're using chains such as eos where there's not the same pressure to to kind of keep your cost low because of the way that those watchings are designed and the compromises they've made but actually the good I mean that doesn't actually lead to an optimal design of a decentralized exchange because you're

publishing all this information which makes it very visible to everyone else what got what you're trading and the pressures that have been put onto aetherium for example have actually led to some much better designs emerging one of the things that people do care about is privacy of their transactions and then the second thing is around especially for the lower volume trading models that use auctions for example rather than an order book and so you can get rid of a lot of those components which people consider to be part of an exchange and create systems which are potentially giving better prices at lower cost for for traders so I think

there's there's two streams happening now there's the scaling of decentralized exchanges without having to put every single trade on chain which has been pushed by the fact that order books are expensive to have on there and you end up having to move quite a lot off chain and do a lot of processing before you settle and then there's these other models which just get really entirely of those components and actually are much better suited to lower the quiddity trading pairs where the reality is you shouldn't have most asset or every asset traded on a second-by-second basis they may just not be enough information for that to make sense and therefore you can design a system that suits a slower price discovery yeah some of the off chain approaches like you mentioned are things like what stark ware has been

working on I think with the 0x or someone where you aggregate a bunch of transactions and publish a zero knowledge proof that this match was executed correctly or whatever these trades were executed correctly exactly so in the scaling sense there's - it was - lot two main approaches going on there's the cryptographic one and I think it's dark where's one of the best examples of that where rather than submit every transaction on chain you can batch those into 1,024 trades and then settle you settle them all in a single proof which can get verified by a contract on chain the problem with that is that you do have still a long latency

time so it's beneficial in terms of reducing cost significantly for people who are trading on one exchange but a large amount of activity that happens on Dex is today is of a very different kind of trader it's usually arbitrage traders so if you're you actually may be less concerned with the immediate cost of your trade by having to wait 10 minutes for a batch to be submitted through a proof fight from Starke web could be negative for you in the short term but what it does enable is then high frequency traders to start used X's once you can have these systems in place and you could start to be you can essentially paralyze the creation of these proofs and have them submitted on a much more frequent basis so you do potentially have unlimited unlimited

scaling available from a solution like stock where but with the caveat that right now there's very very few people who can do that so it's not something that can be easily open sourced and therefore you do have to rely on for example stock where if you were using that system or potentially another third-party who generates proofs on your behalf and you're creating another centralized point which for the moment is sort of unavoidable and then the second threat of scaling is happening at the moment is more based on the kind of games theoretical approaches like plasma but in these systems you're essentially creating incentives that the exchange should be to be honest so you could have people placing many many orders of which

you're only settling the kind of deltas of all the cumulative trades at the end of a certain settlement period and then having a punishment mechanism so that if the exchange cheated anyone it can be proved and they can be punished you you therefore don't have the same finality necessarily on trades because you may have to wind back and undo a whole set of trades if it was proved that someone had or all the exchange had withheld information or had had modified balances as long as you rely on these incentives you could have extremely scalable descent trade exchange and I think there's a lot of systems like that which will probably launch in the short term but it seems more likely that in the longer term using things like various forms of zero knowledge will be the scaling approach that would ultimately

make more sense for these centralized exchanges would what roll-ups doing also fall into that category are they because they're also doing sort of off chain computation proven by no it's not I would say it's the same thing as a stock we're just using different technology I mean it's the same sort of principle of bashing up transaction I don't think anyone knows the answer to this but I'm curious about what regulation looks like once you have any component off chain if you have it anything even just matching engine or an order book management or anything off chain does that party that's managing that thing off chain then become you know money movers and and liable for whatever is happening there

I think what's been made quite clear already is at least in certain jurisdictions if you are operating part of a system which helps arrange I mean in fact that's part of the definition often of multilateral trading facility is that if you're even providing part of a system which enables people to find each other and trade with each other then you're you're liable for some aspect of traditional regulation that's particularly true if you're charging a fee I mean it's very hard to then argue that you went operating this platform even if many parts of it are on chain or you're not holding users funds and so you really have to go right to the I think the kind of most extreme end of everything being operated either on chain or by sort of multiple third

parties all open source before you can really not fall under like that regulatory area as a company and probably at the moment that's what's being quite difficult for various sort of decentralized exchanges such as 0x3 layers where ultimately although they're often called decentralized exchanges they're running order books many of those companies are based in the US and their cost they may not hold their customers funds but they are arranging trades and therefore you do need to then go through the huge and regulatory hurdle and barrier before you can which cost a lot of money I mean most of the costs of all exchanges centralized and decentralized I think or sort of semi decentralized is legal and so it does

like to put already up huge barriers to entry for people to come and experiment with these things and try launching new products unless they are completely anonymous and even in the case of ether Delta the founder Zack got sort of retroactive fine for having launched a system which he actually had no control over at that point which which was open-source and running on aetherium on one chain because he should have known apparently that it might be used to trade securities and so that's a really dangerous precedent which at least although it wasn't kind of contested in court shows the way that it's starting to be looked at my question here was like when you do off chain order filling or I know it's not necessarily orders in this case but when

you're going off chaining back does that ever fall into the category of like derivatives which is is there a relationship there or would you say derivatives is like a totally different product I think it's a slightly different category but it's actually a very sort of important category so although at the moment there's a lot of other barriers for people to use these central exchanges the biggest one for let's say professional traders is the inability to access and trade derivatives and on margin with leveraged type products which may seem I think it seems like a small thing to most people who are building Dex's at the moment but the reality is that that is so essential

and so assumes to be there by most most traditional most traders that if you don't have the ability for example to mislead borrow and then trade on leverage they won't even consider your system and so it's quite interesting to see the interplay at the moment with what's happening in various other parts of kind of defy with credit and lending and other derivatives type products which are starting to mature because when those start to intersect with the deck space you will have a much larger value proposition to compete with centralized exchanges and it's quite clear now all the building blocks are there but it will take time to start to

filter through to the stage where especially combining that within some skills with some of these scalability solutions that you're really are rivaling almost exactly what the offerings are of centralized cryptocurrencies changes and potentially later traditional exchanges once you introduce something like derivatives though then regulation also steps up right then it becomes really so in every jurisdiction in the world and we're not just talking about the USA which is often where people are focused on cryptocurrency exchanges but everywhere derivatives are regulated and so and to be honest for pretty good reasons because it's they are much more dangerous products to be trading but

again the way things are going meant many of these then become almost self-regulating so because of the way that you can design leveraged tokens for example like fulcrum from B's EDX on aetherium where the rules are enforced in a certain way that there'll be liquidated under certain conditions which aren't just managed by one entity you could potentially argue that they are self-regulating in the sense that the rules are set out very clearly and can't be changed by anyone and so there are some it occations but it would require completely new laws and and in the short term it's certain that any company that launched an exchange trading those even if they argued that many parts were on chain or decentralized would definitely be at

risk as I've seen Dex's become smoother and simpler almost to use I started to wonder where what is it where Dex's start an interoperability ends or where interoperability ends and Dex's start when you think of interoperability protocols which is about switching between different chains or you think about atomic swap so you think about bridges which is also about like moving tokens from one chain to another through all these different mechanisms Dex's to to me start to fall in the same category whereas centralized exchanges seem like they're in a very different place and I'm wondering if if you see that as a continuum where Dex's exists somewhere

along that or if they're all going to become interrelated or I know that they're gonna be able to use elements of one another but I'm just curious what what that actually looks like to you I think there's definitely various elements to the interoperability question first of all where it is possible to have a cross chain swaps and bridges but the reality is actually the most important coin to be trading for most large traders is Bitcoin and it's also the hardest one to have any reasonable level of interoperability with other chains in because it doesn't have advanced smart contracting for example and so although I think people talk a lot about interoperability the reality is that although you can build interesting Dex's

now which do allow you to make trades between chains you won't build anything that could ever at all start to yet even touch on what is happening with centralized exchanges or even the exes that operate on just one blockchain and I do think it's still probably although there's been lots of solutions talked about probably nothing that can solve that speed issue and ultimately it will come down to the speed unfortunately which is the thing that once you get into it the traders I mean traders care the most about and care about traders because they're the ones who essentially act as the market makers and provide liquidity for other people to then be able to trade at a reasonable price and then on the kind of

continuum continuum between centralized and decentralized I definitely think there is a lot going on in the kind of middle space for the moment if you wanted to there are various ways to trade Bitcoin against aetherium but using for example wraps Bitcoin which hasn't taken off in a big way yet but does mean that you can have a representation of it on aetherium the problem is that you do trust bit go to hold those assets somewhere and but that means that you can come to fo-eenix trust us for example and trade from your own hardware wallet but against someone who might be trading Bitcoin but as a theorem when a centralized exchange and still get settled in wrapped Bitcoin so it doesn't solve your issue of trust but

it doesn't mean that you get the experience of trading from your own wallet and a reasonable amount of speed and they'll probably be other solutions kind of in the middle there and of course you'll have things like cosmos wet and polka dot and others where you do have better interoperability solutions but not with Bitcoin and that's the unfortunately the sticking point and reality of what traders do you want yeah there's a I mean the nor signatures is one of these things that's been talked about in Bitcoin for ages and ages and like I'm I'm generally fine with Bitcoin not wanting to change and improve anymore and it's like that your value proposition you go for it like that that's awesome but if I could

wish for one thing and one P and one signing scheme so we cannot have proper multi SIG's and therefore like build a lot better bridges but I see interoperability as a sort of it's a foundation and like interoperability is not about moving tokens or like exchanging tokens at all it's about moving things so I own a Bitcoin over here and I move it over here and I still own the Bitcoin on this other blockchain and like I can prove my ownership of it on both chains but with that like with interoperability you can build a better exchange I mean to me the missing piece of add X is still being able to trust lessly trade across multiple assets and

like on ethereum your trading mostly ERC 20 tokens and that's fine for that ecosystem but if you then want to deal with Bitcoin yet you can do wrap Bitcoin but then because there's not any great bridges available for Bitcoin kind of stuck with these Oracle's or trust assumptions they don't necessarily want to have but I think and interesting like if if we at some point could build a good Bitcoin bridge an interesting thing that we might end up with is like one add X chain that holds a bunch of at likes similar to a centralized exchange you know you very rarely actually settle anything to the blockchain itself you just kind of hold all the blockchain

assets at the boundary and then you're just trading in an internal database you're not actually moving anylock chain asset when you're trading and that's where you get your speed from in a centralized exchange you could do the same thing where the were a blockchain that's fast and has fast walk times could deal with the trading in between assets and just holds the other blockchain assets at the boundary so to speak and then very rarely settles out through through big bridges or other means and you're you're yeah your key problem to solve then is just making sure you have the trustless bridges to each of the other chains available and operating when you need them but there's

no longer any speaking shape on those because all your trading happens on on one chain yeah I feel like there's all sorts of scenarios that I'd love to ask you questions about like what happens if Bitcoin ever allows it what happens if they don't but maybe to be more general what do you see as the future of Dex's what's what's kind of happening now what can you see coming up so I think two years ago is probably very naive I thought it within six months we'd have scalable decentralized exchanges and all the building blocks were already there and the longer we've been building these products and especially having not so post-launch seeing how people were using

them the more I've realized that there's still quite a few pieces that we're missing so there was a scalability aspect which I think we already discussed related with and yes scaling to be able to handle tens of tens of transactions per second which doesn't even sound like that much but is significant in terms of trading and then there's actually being able to interact with leverage systems and margin trading systems which are acquired by traders and then being able to interrupt interoperate with other block chains and so starting to put all those pieces together combined with what we've already started to improve and iterate on in terms of the actual models of Dex's you start to have a system which

can actually then compete with all sorts of traditional financial exchanges so because you have now the dual the dual combination of something that's open so anyone can come in connect with it and trade without permission and that means that you can have a much much wider network of counterparty so you don't need to trust each other or the exchange you can start to then build something with much lower cost in the long term and cost is never like the sexy thing to get excited about but actually that is what traders care about and that will want that won't end up being what makes Texas win over centralized exchanges so the fact that for the moment it is more expensive to trade in a Dex because you have to settle onto a blockchain and

there's all sorts of other frictions friction points both from the UX but also from the actual fundamentals of on a blockchain but once you can add all these building blocks in you can provide people with high leverage on trading these assets you actually have a system where you don't need to have a prime broker you don't need to have a Clearing House you don't need to have other intermediaries who exist in trading securities or commodities or all sorts of other products on normal exchanges and therefore you can build something that's much much lower cost than any of those and where you can start to have tens of thousands of of counterparties all directly trading with each other at

much lower friction and cost without all the kind of compliance and backends that normally goes into those exchanges and you also reduce the barriers to entry so anyone can start to launch these wants to put once the components open-source because the the rules are enforced and you should have privacy for example and transactions at that point they are they are superior and in many ways they're things like the Nasdaq but enhanced with blockchain rather than wild X's and it's only just starting to become visible now with all the experiments that have been happening but it is now clear that that's been sort of technically proven to be feasible it's just a matter of actually doing the development work and bringing in lots of these new ideas into one system but I guess that's what

you're building that's sort of what we're building I think it's still III imagined we'd be building that two years ago but it's still probably at least two years away but that's I think the ultimate vision of a large decentralized exchange is not just to build a slightly more expensive on chain way of trading cryptocurrencies where you don't have to you know you're not gonna get hacked by an exchange it's to build something that's really really going to replace a lot of the kind of very opaque closed-off high barrier to entry exchange systems that currently get used and only have access to big investment banks cool well thank you very much for being on the show it's been a fascinating conversation this is an

interesting space that touches both on the social aspect of like blockchain user onboarding kind of stuff and also technically super infor interesting and like how we actually build this Tech so thanks very much for coming on and talking about your program thanks for having me yeah thanks and to our listeners thanks for listening thanks for listening [Music]