"Priceless Financial Contracts: Building Synthetic Assets with UMA" - Hart Lambur
ETHGlobal·Sat, Oct 9, 2021, 12:00 AM
Speaker
Hart Lambur of UMA describes how you can use UMA to access the power of DeFI on Ethereum without using an oracle.
Transcript
on priceless financial contracts building synthetic assets with uma uh heart welcome to the stream uh we'll let you take it from here thanks josh um can you hear me okay everybody all good all right cool let's get this share started okay guys so um thanks for having me as usual um i love these online events i love this community i love these hackathons so this is super fun um so i want to talk about uh priceless financial contracts um and how we can use this design this design philosophy to build synthetic assets with um uma with uma and um it's really a focus on like what the hell this priceless thing means so okay let's start with what oma is um is a protocol for building synthetic assets so we let developers create priceless financial contracts which i'll get into what that means and other types of synthetic assets that minimize oracle usage and the protocol really has two interwoven components it has these design templates that are again written pricelessly designed to minimize oracle usage and a data verification mechanism which is really like our version of an oracle that's specific or purpose built for uh this this design philosophy and our view is that these two technologies combined are really what enable the creation of super fast efficient and very secure synthetic assets and other types of financial contracts on ethereum so one example that we have is this uh this yield dollar product that we've had live on mainnet for a couple months now and right now this product has over 40 million of total value locked in it the current iteration and it's only expected to have two oracle calls in a three-month period so i think this is very cool i think this is a very useful innovation and i'll explain in more detail why but this is like trying to kind of give a high level flavor of what this priceless idea is we can put a huge amount of value locked in these contracts and we can use an oracle extremely rarely so like how how is this possible how are we doing this and the answer is this uh priceless framework so our priceless contracts are designed to minimize oracle usage by really framing the d5 design pattern or design problem as a as a challenge response game um what that means is that we're writing d5 contracts um that are designed to be executed or be looked at optimistically where the baseline assumption is that people are doing what they say they're going to do and we only use the oracle in the event of a dispute and i'll go into some more examples later on but if you think about traditional legal contracts they are also written optimistically you know if josh and i write uh write a contract on on you know our eth global agreement we hope that we are going to um follow the terms of that contract without having to go to court and the court is the enforcement mechanism so keep that in mind as i keep going here because basically the idea here is we want to we want to default to assuming people are doing what they say they're going to do and we want to use the oracle as a type of enforcement mechanism to enforce or ensure that people do follow the terms of the of the contract or the agreement and this looks a lot like layer two solutions for designing these by contracts um in fact we actually owe a bunch of credit to the optimism team um and a conversation that we have with them you know a year and a half ago um of thinking through uh optimistic approaches to d5 contract designs a lot of that thought process is what led us to this this path um and to to kind of highlight why this is layer two like it's it's like uh in a layer two game things are happening optimistically and you only use the exit game if people cheat same same idea and incidentally like i said before this is very similar to how contracts work in the real world um this is like how legal agreements are written so let's go into a hypothetical example here let's assume alice and bob make a bet on bitcoin and we have this contract with a million dollar payout um alice gets the million bucks at bitcoins above 10 000 at your end bob gets the million bucks of bitcoins below 10 000. so what should we use as our oracle how how should we construct this um so it's like a bad joke but uh it's trick question uh the idea is like in the optimistic scenario we do not need an oracle if alice and bob are in agreement on the outcome of their bet if they agree that alice should get the million bucks or bob should get the million bucks um after on dec 31st we do not need to make any oracle call at all no oracle calls no oracle usage no transactions to the blockchain super efficient everybody's happy so what we do need though is we do need an enforcement mechanism to resolve a dispute if bob and alice don't agree on who should get the million bucks and so this is really the whole basis for our our priceless philosophy oracle calls are disputes and if we can write contracts that minimize disputes we can minimize the oracle calls which leads to greater efficiency greater scalability greater security uh a whole bunch of like problems fall away we basically solve the quote-unquote oracle problem by minimizing oracle usage so let's go back for a second and just think of this again as a legal contract alice and bob in like the fiat world wrote a legal contract says one of them's gonna get a million bucks the idea is that both of them will follow this legal contract optimistically in the real world and if they don't alice can sue bob or bob can sue alice that's how like the traditional world works and incidentally that's how like all kind of financial derivatives in the existing fiat world are enforced too they're enforced with a court system we want to take the same concepts the same optimistic enforcement concepts and say hey we are only going to call an oracle to resolve disputes that's it that's the whole idea behind this priceless thing so let's go a little bit more complicated here because this alice bob example was like pretty trivial um let's review how uh synthetic tokens or how a contract like maker's die system works today and i'm going to call these just for comparisons difference i'm going to call them price full um d5 contracts versus price list and so on the left we have like so let's imagine we're talking about make or die and a cdp and we want to check whether it's correctly collateralized or not um we really have like two two cases we have the good case which is on the left here where the total collateral locked in the contract is greater than the collateral requirement and we're happy what is enforcing whether we're in this good state or not is this price feed that's being pushed to the chain every so often on the right we have the bad state which is when a contract drops below its collateralization requirement then the contract gets liquidated uh penalties gets assessed life moves on that liquidation whether this contract is in the left or the right state is determined by this price feed that's being pushed on chain and this works but it has some problems so before we get to the problems let's just actually i'll jump ahead one slide and talk about what the price list version of this looks like and the priceless version means we have no on-chain price feed there's no price fee being pushed at all and instead we have a same sort of contract where it's like okay we have a contract that's supposed to have so much collateral it's got a required collateral amount and then it has the total collateral in it but here we are optimistically observing this contract to see if it's correctly collateralized or not so the contract participants on both sides anyone in the ecosystem can look at the blockchain can look at the ethereum blockchain and be like okay this contract yes it has enough value in it or no it doesn't and we have no on-chain price feed if people think it's correctly collateralized it is correctly collateralized what would happen then in the the downside scenario if somebody goes oh wait no i don't think this is correctly collateralized they then trigger a liquidation and uh that then and only then do we call an oracle and i'll go in a little bit more detail how we actually minimize oracle usage further but the idea here is that look at it if everybody's happy with how it's collateralized we're good we only need to do anything if people dispute the state of the contract so okay let's go back and compare it again to our price full version our price full version is is really enforced by this price deed and one of the problems we have here is that the price fee doesn't happen that often um the the performance and the efficiency of this d5 contract is purely limited by how often i can get price prices pushed to the blockchain and validate them and so we sit here and we keep having like checkpoints um pushing transactions making oracle calls so that the contract can determine whether we're in the good or bad state and if you just think about this naively this is hyper inefficient to start with like we're pushing all these transactions to a blockchain that we don't use or don't need because most of the time you know there's no there's no liquidation that happens um most of these oracle checkpoints will never actually be used to trigger a liquidation it's it's it's very like an inefficient use case from a transactional perspective but more importantly because these block there's such a gap between these price updates it also makes the contracts themselves inefficient because we need to over collateralize our d5 contracts since we will only be getting prices every 15 minutes every hour whatever it might be and the bigger the gap between prices the more we need to over collateralize our contract so things get really capital and efficient and we have to have greater over collateralization with this design than we would if we could execute these contracts optimistically so this goes to like one of the advantages of this priceless design we can start doing things that are super capital efficient because we can execute liquidations instantly the moment that someone says hey this thing should get liquidated we can go and execute a liquidation now um okay one like nuance to detail about how we we actually do this with our current um design um is when a contract gets liquidated we don't even call an oracle then uh a liquidation happens um instantly but the rewards for that liquidation aren't paid out for uh for a period of time for two hours and in that period of time participants can dispute that liquidation so we actually only send oracle calls we only make a call to the oracle if somebody disputes the liquidation and you can call this a version of an escalation game where we are having uh the contracts optimistically enforced we are having liquidations happen when people think that a contract deserves to be liquidated and then we are only calling the oracle if somebody says hey that liquidation was invalid that was a bad state and in doing so we go back to the first slide here we can secure a huge amount of value with minimal oracle calls so it's hyper efficient and hyper fast hyper performant um let's talk on another problem with this uh priceless design um in this in the in or the price full design in the priceful design we also have a lot a lot of brittleness so we have this on-chain price feed pushing prices but any one bad price point and the whole thing breaks and you know here's a graphic from the bzx like flash loan attack um this is the older version of bzx right where an oracle got manipulated um they were using kyber as the oracle and this one bad price point led to somebody stealing a million bucks worth of youth out of the contract so you know you're sitting there from like a d5 developer perspective and this is like utterly frightening because you get one bad price feed one bad price point and huge amounts of value can be instantaneously taken and will be taken if people can break this stuff it feels very brittle and you know you can think about another way if you if you kind of conceptualize these d5 contracts going back to a court system where um this is basically bob and alice have a contract and the oracle call is a dispute it's going to like the judge saying hey is this right or not in the price full design it's almost like we're asking the judge to make an instantaneous judgment like what is the price what is the price right and if you think about that if we were to like take our legal system and try to have instantaneous judgments like it wouldn't work there's not enough time to gather facts there's not enough time to see what's going on it would be like really dangerous and would lead to all kinds of bad outcomes the solution for the price list design is to slow things down so when we frame this as a as a dispute resolution problem as something where the oracle calls only is only happens when there's a dispute what it lets us do is slow things down and asynchronously resolve this dispute so when a dispute happens and gets triggered we can take our time we can take our sweet time and understand okay who's right here is alice or bob right and we can slow down those disputes and it doesn't block the system from functioning because everything else is acting optimistically it's uh the other analogy to push on the the legal kind of conceptualization um if there's a lawsuit happening about one financial contract the rest of the world of finance doesn't stop or the rest of the legal system doesn't stop all those contracts keep operating so we're able to take the take the r um take disputes and solve them asynchronously which means we can have a much slower much more decentralized much just more resilient uh solution to the oracle problem when we do need need those those disputes resolved um so let's talk for a second then about like practically what does this mean for ethereum d5 developers or for people in the space like what can you actually use this priceless thing for and so my points here is that it's like more resilient right and it's more efficient it lets us do more capital efficient things and this lets us build some really cool um uh actually i'll make another point here because we don't have an on-chain price feed we can actually support uh uh long tail assets things that we like wouldn't want to push a price on chain very often for um and so here are some examples of things just that pulled from um recent hackathons and current development ideas of what we can build um one thing that i'm i'm super excited about is gas futures so right now if you were to join our discord there's a bunch of people talking about how to build a synthetic token um that will expire every month so month of january month of february whatever with the average price of gas paid of the ethereum gas paid that month and i think it's a pretty cool way where you could actually have people hedge their uh gas costs so big projects could buy this token to hedge their gas costs and you could have speculators bet on how expensive gas is going to be in the future and actually have a whole curve a whole futures curve of what we think um uh the future price of gas and ethereum is going to look like and we can do this because we can have this whole uh like kind of difficult calculation it's actually not you can't really do this instantaneously on chain difficult calculation happen off chain and enforce this um with this uh this priceless mechanism purlin is a really cool project um based mainly out of singapore that is using uh the uma contract and the priceless design to create their own synthetic assets that are collateralized with their own token and one of the reasons why they can do this is because they can be quite capital efficient or they can they can secure the value of their token by uh using this priceless thing to to not have a super robust price feed on chain of the price of their own token versus say e potion labs came out a hack money hackathon the eth global hack money hackathon earlier this year um and it's a pretty amazing uh insurance protocol that invented a kind of almost a new form of uh of a put option that can protect against price drops in any asset and the reason why they're able to do this is because they can make it a hyper capital efficient thing because they're not pushing prices on chain all the time and they can also make it super extensible so their design will let you ensure the price drop of like any erc20 asset uh which i i find pretty fascinating and then a couple other things here that like came up earlier from earlier hackathons uh tom schmidt came up with this idea of a barf token which was a synthetic token that tracks the price of san francisco bay area housing and again we can do that because we can use a price fee we don't have to push this price feed on chain it's kind of hard to get this price data and in east boston uh last year uh a group of uh three guys named will uh came up with a token called swandai um that would allow to hedge against any dislocation the price to die from its peg and this also shows that we could create price identifiers or have a lot of flexibility around the uh the design of this contract because again we're just looking to to only enforce or only dispute we can have a pretty complicated contract in terms of what the payout structure would look like that is all evaluated off chain um and only only resolved within with a relatively rare dispute okay so i've run through this pretty quickly um i want to throw a few links out here in terms of um our channels that you guys can reach out to us and where you can get our developer docs um we are actively building and promoting various uh uh new ideas and we are trying to be pretty active with our community um we've hired uh or we've grown on our team quite a bit recently and we have a bunch of new community people that are very much interested in hearing your ideas and helping you guys build different types of synthetic assets so please hop in our discord and with that josh if it's not too early i will jump into some q a um kind of early on that is appropriate i've got a couple questions i'm sure we can have an interesting discussion here um so one question right at the gate and this is actually from zuma who's going to speak next and i'll just read this question directly what are your thoughts or your research on how to make priceless oracles faster going forward so for example removing collateral or liquidity could be a multi-day process even in the absence of dispute which might be too slow in some cases yes so my answer to this would be to to frame it as an escalation game so if if we basically say hey um we need a price like really fast or really instantly um you can't say hey i'll give you a price right now and and let like say hey this price will stand if nobody disagrees with it in five minutes and that'll give you a pretty fast resolution to this dispute game and then if somebody disagrees with it in five minutes you can be like okay well i'll i'll bet you twice as much and give you another five minutes to disagree with it and you can actually have a fairly quick escalation game in this process until you get to a point where you're like holy this really is a legitimate dispute maybe we should uh take it to the full uh the full dispute the full kind of oracle system so it's like think of it like a court system where you start with like your small small claims court and you get a really quick answer and then you keep escalating it through an appeals process until you get to like the supreme court which might take a long time and yeah my intuition um josh is that this general type of approach is going to be the most efficient way to scale this and it kind of again looks like layer two where we're gonna say hey let's operate optimistically and then we have a funnel of like how how bad a dispute is we operate optimistically 99 of all things go through without any um issue one percent goes to small claims court and then one percent of that gets appealed and so on that actually uh segues nicely into the next topic so i mean just generally you know as more and more layer two systems are coming online um what does that change for the synthetic assets uh marketplace for with crisis design specifically like is that does that open up a lot of these possibilities does it change the landscape in some important way for you so i think if there's a few angles to that so we think if synthetic assets are erc20 assets if we start there then um layer two or call it like other scalability solutions they just have this base problem of like hey where do we put how do we move erc20 assets between uh different side chains later to shards whatever else and i think that's kind of like a core that's like a layer two problem of how are we gonna solve that usability thing of moving these assets back and forth if the underlying contract though um is just being written optimistically it's like the legal the financial contract that's created these erc20 assets that um that can actually live on any shard any layer two system any chain and you can execute all of the same concepts of hey watch this thing on layer two on this chart on that chart on the base chain and only trigger a dispute if something goes wrong and because you slow down these disputes it's like for example if this whole priceless design was operating on a layer two uh system if there was a dispute it's okay if it takes a while it could go back to the main chain because it is all resolved asynchronously it's kind of like triggering an exit game okay um and one i think last question unless we have any other new ones in the chat um and you know this is a maybe an easy question for the answer but what do you want us to get built uh at the etho online hackathon uh whether that's on yuma or that's on something else uh something else entirely that's not an easy one to answer josh i got this whole like philosophy that i think um what's going to be like very kind of meta answer of what is so cool about defy it's not build bringing like traditional financial assets onto d5 or onto ethereum or or even traditional financial concepts like put options or call options i think it's like fundamentally about innovating new and by lowering the barriers to entry to create a financial product i think it gives us um like a a a really big design space to innovate new things um and you can think about it like you know someone once told me um that if you wanted to start a mutual fund um it basically takes like 100 million bucks of like assets raised to uh to be make it possible to start a mutual fund and so there's a lot of people that can't go and start mutual funds with whatever idea they have because they just can't raise 100 million bucks defy and this whole this whole technology the barrier the entry to actually create a new financial product is so much lower uh i think that it it lays the front the framework it's the foundation for like an explosive amount of innovation in terms of what you can actually do um with financial concepts and and josh actually i think um jordy and the team from potion from the hack money hackathon which i am biased because they did build on top of us but um ignoring that entirely like they they they reimagined um a way at least at the time um and they've changed their thinking a little bit since then but it was like a different type of put option that actually i'd never seen in um uh traditional financial context and it like made my head hurt um but it was i think a really powerful concept of hey you give a bunch of smart people a new platform they can build um some really cool yeah that's very interesting i think what i mean just to build on that you know one thing that we're seeing or that we might expect to see using platforms like yours you know our uh you know financial products derivatives of things that never had a market for them before um right i mean like the barf index obviously you know real estate is a traded asset but it's a different kind of market and there's all these people out there who might have a lot of expertise in something you know whether that's like culture or music or art and there's going to be synthetic assets that track you know now a market that exists on that making a whole new set of people you know financial users where they never had access to convert their knowledge into financial speculation or bets before um okay one one last question um from sorry go ahead no no no no i could keep ripping on that but you actually have an agenda you got to keep so uh okay there's one more question this came in from chat um uh if there is no cost for disputing uh why can't you just spam disputes how do you how do you solve that civil problem there is a cost for disputing for that exact reason right um and so we actually spent a lot of time i'm not going over it in the in this sort of high level talk but we spend a lot of time analyzing um you know exactly that problem if you make things free you will get spammed um just because some tries to like you know be an right um so we spent a lot of time on the game theory of making sure that dispute costs are always unprofitable and it would be un sorry would be unprofitable to spam disputes and very happy to go in a lot more detail on that in our discord um or in our various other channels if the person that asked that question is asking please jump into uh the yuma discord i'm sure that we can put the link into the chat for you um so you can find your way there okay thank you so much discord discord discord.uma discord.umaproject.org um so yeah easy great all right thanks so much really enjoy the talk uh enjoy the bright red background uh it's giving me life we're
Automatic transcript — names and jargon may be misspelled.