Dutch Exchange: a decentralized exchange well suited for blockchain purposes - Dominik Teiml
Devcon·Tue, Oct 9, 2018, 12:00 AM
Speaker
Recording by Livepeer.tv
Transcript
okay so what I'm gonna do right now is I'm gonna talk about the exchange for ER C 20 tokens which are tokens on a theorem that we developed at gnosis so we call it the gnosis Dutch exchange and it's a decentralized exchange for aetherium tokens using the Dutch auction mechanism to determine a fair value of tokens and I'll explain what that means in a second so first of all a small disclaimer I did not make this presentation I kind of read through it and I'm pretty sure that I understand everything so I do understand everything on the technical side and and the finance stuff it shouldn't be very difficult so let's start with a introduction of the of a traditional exchange that uses an order book and a continuous auction or continuous exchange so you can either do limit orders whereby they get placed on an order book they can either be bids which means that you will buy it at a specific price or they can be asks which means that you will sell it at a specific price right and you have the spread which is the difference between the bid and ask and you can also do market orders which are like basically limit orders with with the value being the current lowest or highest value respectively so that the order is immediately executed right yeah so a market order is as a result immediately executed and you have so that's why it's called a continuous exchange is there is a serial processing of orders one by one and also like on a different note I think could be also termed a continuous exchange because order can be fulfilled as soon as it comes through right so yep and orders matched using pay as bid actually yeah so that's that's that so the okay so the problem we see with that is as many fold there is yeah so the biggest problem of all is the possibility to front run and that means so okay so if for example if you have a centralized exchange then if you submit an order then the exchange knows about this order before it broadcasts it right so it can actually act on that order act on the information before it broadcasts it so it gives it an unfair advantage and in the case of decentralized exchanges like other ones then the NAR is a lot of them use a centralized order book so that still means that the exchange like even theoretically has the possibility to act on the order before it fulfills it right so that's a problem with with our exchange it's fully decentralized so it's fully on chain so we don't nobody has any more information than then other people yeah anyways so other disadvantages of order books include like you have you can have a high spread for like illiquid auctions so they're not they're not ideal for those either and like for example if you have a if you have a illiquid pair then if the size of the order book on like either side is not that large and if you make an order it's it can push the price right you will actually get a different price for for every part of the order yeah that's basically that so like I guess it can be summarized by the by the paragraph that or by the statement that applying a continuous mechanism to the blockchain doesn't make a lot of sense because in the blockchain there's a discrete time obviously and yeah that creates all of these problems cool so instead what we decided to go for is something more appropriate for the blockchain which is a batch option system and in particular we we basically collect all the orders at once and then we auction them off all at once right so we we batch many orders together and we and we sell them all at once does that make sense cool so in particular we use a mechanism of the Dutch auction which is like kind of the opposite of an English auction so in an English auction that's the thriller auction people bid and every bid has to have a higher price than the previous one right for the for it to make any sense so in a Dutch auction it's the exact opposite the price is like falling and the first person to like take that price wins the other thing so that's like if you're auctioning off one item for our purposes we have to like auction off you know tokens so it's it's many many many and and hence we adapted it for it to be usable for many not just one one thing at a time and in particular the way that works is I think there's a graph even that explains it the best yeah so on the x-axis you can you can view time and on the y-axis you can view the value right so we start off with a constant like cell volume so a constant amount of tokens to be sold and and we always multiplied by the price to get its value right so yep so as a result okay so we have we have we have two two expressions right we have the the cell volume we have the price and what's what's crucial in in this is that the price is decreasing and if you have a constant cell volume and you have a decrease in price then the value would be decreasing as well right so that's what we can see in the graph can you guys see it it's it's the the line in red is it is it visible somewhat okay so the the line in red is the like the value of the cell volume and then what you have underneath is the kind of like the by volume right so right right okay okay okay so the price is is like the the the cell volume in terms of the by volume so it's kind of like a conversion price between the two tokens right so as it's decreasing the value of the cell volume is decreasing and then you have the the blue thingy which is the by volume and that's increasing and at some point it will it will match right so necessary and sufficient condition for that is that there's at least one by order and as long as there's at least one by order then you know at some point in the worst case in a really long time those will intersect in fact even if there isn't any by order they will intersect because the way our price function works is that actually reaches zero after 24 hours does that make sense so basically they will intersect at some point always and that's when we close the auction what happens then the bidders or in other words the buyers they can claim the tokens that are being auctioned off and the sellers they can claim the tokens that the buyers sent as well so yeah this that makes sense I think that makes sense so let's see right so what's what's actually very crucial here is that the the price is the same for all the bidders right so it actually doesn't matter if you participated let me show you the graph again like at the very beginning or at the very end say the by volume is always increasing and when they intersect all the bidders get that price okay so so everybody gets the same price at the end okay right right so actually this is a very good this is a very good illustration for for understanding how it works so you have you have a two by two diagram and you have so prior to the auction the sellers they deposit the tokens and then the auction starts and then the bidders bid for them right so that's that's a very good summary of kind of the mechanism that I explained great so yeah okay I'm gonna say it so also notice that there's two possibilities the the buyer side can either intersect the seller side like by with a buy order if it goes up or it can intersect it by the seller side going like for a long time and intercepting it from the top down right so basically there's like two possibilities either a buy order can clear the auction or it can be cleared what we say like with time so yeah that's that okay so so the way it works is we have like for example ether and token a and you can there's always two symmetric auctions running at the same time so there's going to be one where ether is being the sell token and the token a is being like the token that's bitted and you have the opposite symmetric one where it's token a that's being the cell one and an ether is being bidded so we always run these symmetric auctions and they always start at the same time and when the second one closes of the symmetric pair then after 10 minutes we initiate the the next pair so that's kinda how the mechanism works and there's okay there's there's a condition which is that the next auction pair received a combined value of at least $1,000 worth of cell volume so that could have our sir it's not combined it's like an or so either auction must have received at least $1,000 worth of so I and I guess I haven't explained the the price function so kind of hinted to it so the way the price function works is we always start at two times the closing price of the last auctions and and it decreases and after six hours it reaches the past closing price the previous closing price right and then after 24 hours it reaches zero so I don't know maybe it's better if I just really simply so we have it starts out like two times the previous closing price and then after maybe something like this so it's it's a reciprocal function cool right so yeah I mean this is this diagram just summarizes what I explained except for for multiple options for for multiple things after one another in sequence cool so now I'm gonna get into like the more interesting stuff apart from like the basic mechanism so you don't need any tokens obviously to participate in the exchange and in particularly gnosis tokens are not required and so in most we have this thing where like you stake those tokens and they generate these things called owl tokens and then those are used to pay fees so the owl tokens you do not need them to participate in the exchange but if you have them then like it's worth it to use them basically so then we have a token which is intrinsic to the Dutch exchange and that's we call a a a magnolia token and it is used to decrease your fees so there are fees in the exchange and they let me just I remember there was a slide yep so there is 0.5% for both the seller side and the buyer side but they do not go to us so it's a fully decentralized platform the fees there they are put back into the system however you can also decide to spend up to half of your fee in like the equivalent amount of like our tokens does that make sense I think so huh so that's yeah that's that's that's pretty much it and how do you actually get the Magnolia tokens for every ether worth of tokens that you traded on the exchange you're gonna get one magnolias token so it's like a constantly inflating supply of of tokens based on how much value was traded on the exchange and there is a specific function that determines the transaction fee that you have to pay so when I say pay if you also participate in the next auction you will very likely get some of it back because it does it since it goes back into the ecosystem in particular it always goes to the next auction so that's kind of a way to incentivize people to participate in succeeding auctions and yep the graph is as you can see it on the thing hopefully it's a step function and it's it's kind of very like social I would say because it it works in like a log10 manner so yeah as long as you have what is this zero point zero point zero zero one percent so I guess that would be one that would be like one hundred thousandth of all the magnolia tokens in supply then your fee is reduced to zero point four percent it does say tulip so there's been a rename and now they're called Magnolia cool so I'm just gonna quickly finish off by yeah summarizing so what are the multiple advantages so there's there's others since it's everything is Unchained there's no front running by any party apart from like I mean this is with respect to the underlying technology that we're using which is aetherium so if the rim itself might have front running issues and we can't deal we can't do anything about that but it doesn't introduce any new ones because there's no centralization involved at all right so yeah I mean I think it's uh it's it's it's like kind of a summary of what I said so we think this this also will like make it easier to determine a fair price because it's an auction mechanism and auctions are very well known to be very good at determining prices of goods so I mean this is kind of like financial stuff but it's yeah and a huge advantage we think who worked very hard on this is to make it very like gas efficient so to make it to me out to make it very very efficient and yeah it's it actually turns out that it's that that we did a good job that is very very efficient so one one like point to note is that for example ether Delta so if you or other order book changes if you post an order then it's very likely that multiple people who try to fulfill it at the same time with but only one of them or there's a chance that only one of them will be able to fulfill it obviously can be partially fulfilled but there is a chance that some of the orders or some of the transactions will not be able to fulfill the order they wanted to in which case there's a lot of gas wastage so there's even a graph here right here which shows I am not sure which exchange this is but in any case it shows how many transactions are failing because they're trying to fulfill an order that isn't available anymore it's four out of like eight or something like that yeah I mean as for the gas costs so it's it's pretty good that for example sellers they can they can choose a really low gas price because it doesn't matter when they when they submit it and the similar thing could be said for the for the buyers the bidders as well yeah oh yeah and two more like huge advantages that we see of this model is that it allows smart contracts to use the platform and the reason for that is that like for example with ether Delta you have to sign you have to sign the order and then it goes into like a centralized order book and smart contracts they can't sign stuff because they don't have a private key so in this in this model even smart contracts can participate because they just have to call a function of our exchange so so we think that's that's really powerful and it kind of like changes the concept of an exchange it doesn't have to be just an exchange it can be a platform where like you know some contract might want to sell or exchange tokens so they can do that using this as well it means you can pay in one token and the person can get paid in another token if it is in like in the process exchange on the Dutch exchange and last of all there's a there's a on chain price Oracle that which is actually one of the reasons the main reasons why we developed this is like to have a reliable on a circle for all the tokens because with order books you can always like sequence the transaction so that you post a really for example high limit order and and then and then you fulfill it immediately yourself which means that you will like for a very short time you will change the market price of the token and if you sequence your transactions in the right way then you can take advantage of that for your gain which means that the price Oracle isn't isn't reliable well in this case you know yeah you can do thinking yourself there's there's a way to do that and yeah so we have a bit of front end as well it's it's looks quite quite slick so you choose yep I think it's it's pretty straightforward self-explanatory and you can use meta mask or gnosis safe in the future and you submit your order and you can see the status yep and let's see so yeah I mean there's a lot of potential audiences for this right now we're we're we're actively looking for market makers which are you know professional traders so if anybody is into that business then and you feel like you want to trade on this exchange please get in touch so yeah and last thing I'm gonna kind of kind of an offer so we develop this exchange we're also doing many other projects and notice one of the other ones we're doing is gnosis X which is a competition for you to think and develop of prediction market use cases and yeah so there's currently three categories and they all have a deadline in like August and September and if you feel like you fit one of the categories I don't yeah there yeah I mean if you you can you can you can you can access the information about the gnosis X which you can find for example a medium and you can find the categories there and if you feel like you you have an idea for one of the categories you can apply and you can win up to $100,000 worth of gino talkin sand and support with developing the application so that's kind of an offer that i wanted to make and with that so yeah no sex id8 that's kind of the logo and oh okay so the three categories are science and R&D touken diligence and blockchain project integration and we have a we have an SDK de that will allow you to do that in a better way cool and yeah you can use this email address to get more information anyways great so that's it thank you very much yes I that's exactly what I'm here for [Music] thank you how do you get liquidity into the market so you post a sell order well okay so the question is how do you get liquidity into the market and the answer is very simple you post a sell order that's that so the sell order will include the information of which auction you want to participate in and how many tokens and that's it you can either participate using the front-end in which actually right now or in the first version there will only be a sell side front-end so when you're participating through this you will always be selling it's very very simple and in the future you also have a possibility to use a graphic user interface for the the buyer side and yeah or you can just use the smart contract directly does that answer the question go yes so the security audit ship and next week I believe and it's deployed on test network on covin but mainly on a rinkeby and it should be life I guess within a month or a month and a half on maintenance so recently there's quite a few price fluctuation all large engine sees the people selling off acknowledgments influencing markets if you're selling in batches wouldn't there be a high risk of that would there be as so would there be a higher risk of what what's the question and higher volatility yeah thank you yeah I mean I I don't see why [Music] great great mechanism which she's absent yeah yeah yeah so in fact I think it opposite is true so the reason is that let's say you have an order book I guess I'll just use a diagram it's the easiest so you have like or the book and it looks I don't know something like like like like this whatever right and so suddenly when you start selling a lot then like this stuff like always will move to the right right and it could like move very fast you know you know this is very steep then it will move very fast and the price will change a lot right well here if you sell a lot then will not necessarily change the market price did you see that so if you sell a lot in an order book it will necessarily change the market price but if you sell a lot in a batch auction system it will not necessarily change the market price because you would just have a larger cell volume this X would just be a much larger number and but there can still be sufficiently many by volume so that the market price in theory could stay the same yeah cool yep just I have two questions the first one is probably the most important is why you decided to rename from tulip to Magnolia I mean is much better the second one is just out of interest how do you how do you model these things or do you one of these things economically like how do you basically form an opinion of whether this model what effect this will have on a bigger scale if it becomes very popular okay so yeah I'm gonna start with the first question I mean IIIi don't know like I guess the reason was that tulip it kind of has a connotation of like the the a bubble and and we didn't want that the second question was how do you model this economically what effect would this have on the financial system if this takes off and like if this model becomes like really really prevalent well I think it will have huge advantages right one of them we just discussed yeah yeah I mean yeah you can just say at the comparison the disadvantages versus or the advantages they will be multiplied right if this is much more prevalent so yeah any other questions yeah thanks for the talk my question is if either said the Dutch auction model correctly chooses to reduce on chain events and also to have avoid these concurrent transactions and waste of gas right and have you ever studied the possibility to use a lightning or rain and completely go off chain and do the and matching engine off chain and only when people go in and go out they sign on chain so in this version it we did not use Raiden but it is something that we are looking into so yeah this this does have the the the advantage of even further reducing gas fees doesn't it and it would allow a traditional exchange I think 99% of users now traditional exchange is much more so maybe they are more used to the conventional order books so I see a small risk for you that mainstream adoption will be hindered by this new kind of managed engine yeah well I mean so it's you know it's a new model and and and we'll see if it takes off we believe in we think that there's that there's huge advantages and that it's more suited for like four blocks in than the traditional but you know you know the market has to decide on that yeah that's that cool any other questions yet one more question by gentleman in the third row as the auction maker and I understand if I want to sell I don't know 100 s or what can I set the properties of the auction like for example at the time and things like that that's big yeah that's always 24 hours that's right yeah so in order to like aggregate all the liquidity we don't divide it by like having everybody start their own auction everybody just all they do is they post the sell order and we a great all the liquidity and we have a uniform rules of the game that that all the liquidity follows cool one more question yeah absolutely I mean yeah totally so there there will I mean there there is there is a possibility for arbitrage right so in particular if the price ever goes below the market price in other exchanges then the auction will be closed because all the bidders will buy up that at that price because they can get it at a lower price than at other exchanges so that means that the sellers will actually never get a worse price than the market price at that point after the six hours so yeah I mean as a buyer or as a seller you can decide which exchange you want to use whether this one or a different one so inherently there's always going to be arbitrage between the exchanges which is good because as a as a trader you should get the same price on all the exchanges and arbitrage works to achieve that yeah yeah not really so I mean like here it doesn't matter what the market price is like the world could be burning we're here and like that doesn't matter right but like what matters is like once we get close to the to the closing I mean unless though so it's there's like two mechanisms are going on right there's time going on and there's price so as soon as the price reaches the market price right that's one end and that's very likely to happen after oops I think after six hours rather than sooner than that yeah does that make sense or yes so basically like what I was trying to say is that the only time arbitrage can happen is at the closing point which obviously that that varies where that is but as soon as the price drops to the market price elsewhere is when a arbitrage happens before that it can happen because yeah I mean the bidders we just go and buy it somewhere else double of the closing price of the previous one what if that's already below market price what if that's what already below market price oh so that that would mean that the option closes instantly or what so okay I'm going to see two things so yes like in in theory yes so if if X is still is a smaller than or equal to the market price at this point then yeah it will close instantly and the second thing is it can't happen like from an economic point of view because previously if like as kind of my answer to the previous question if the price had gone below the market price in the previous auction then the economy the traders would close it then so prices will never go below their market price because otherwise bidders are incentivized to actually bid and buy them up right so or are you saying like the the time difference will make the right okay that's a very good point so there's actually only 10 minutes usually between the two options so that is it's it's very unlikely that the price doubles or halves in ten minutes that's a very good question so the reason we we put the ten minutes there is like if you want to be if you want to claim the tokens like here right and then you want to participate in the next auction immediately so then we we have time where you can like claim them and you can also sell them in the next option immediately know something yes I mean obviously so there are many many advantages to this model one of the possible disadvantages is so let me start with the bidders so the the bidders or the buyers they actually are like really well off right because they they come in like at the last whatever and they get the tokens very very soon so very very low lag and low volatility risk the sellers on the other hand you are right they they will get their the tokens on average in six hours so yeah that's that that we are aware of that like that is so one of the disadvantages so it's like it's it's all the other it's all the things together right so you have you have a smaller chance for for the exchange to front run so basically this this mechanism allows you to get the fair value of tokens because there's no trust needed the miners yeah so there's no trust with respect to the protocol yeah any other questions so thank you very much offices spread evening thank you very much like here to you Saints organizing the sealant next months there'll be another Meetup of course it will be more aim for beginners so a lower technical level and I hope to see you next month thank you [Applause] you
Automatic transcript — names and jargon may be misspelled.