How to use UMA to build tokens that track the price of anything - Regina Cai
ETHGlobal·Fri, Oct 9, 2020, 12:00 AM
How to use UMA to build tokens that track the price of anything with Regina Cai from UMA
Transcript
okay hi everyone my name is Regina I'm from uma and I will be giving a talk today about what you can build with synthetic asset tokens so uma is also a sponsor of the tacked on so we'll be offering three bounties two teams that create it was creative or innovative use of synthetic asset tokens the synthetic asset token project with the most potential for a main net defy adoptability and then also a joint bounty with 0x for the most creative use of 0x instant as well as a synthetic asset token so we've got four people from our team here with hackathon today that's me on the left heart Lambor matt who is here and Roz Stengel who okay was here so if you have any questions following this presentation you can always reach out to us on Twitter those are everyone's handles and then you can also visit our website or our github for more information high-level overview of what uma is and does we're a decentralized financial contracts platform so that means that we provide the technology to create these kinds of financial contracts that consists of two parts smart contract templates as well as a oracle with economic guarantees so because uma is really focused on a universal market access one of the core types of products that we've been focused on are a synthetic financial products these mean this means that we have financial products that can reference external or real world assets without requiring anyone to actually hold on to those physical assets as a result there's a need to have information from the real world somehow transported onto the blockchain which is where umas Oracle comes in today I'm going to talk about what synthetic tokens are I'm going to demo how you can actually use our DAP called the synthetic token builder to build your own synthetic tokens talk a little bit about what other people have created with this contract template so far what you can make I have one idea that I have actually put in the slides but we can also brainstorm others and then lastly I want to make sure to leave time for QA case you guys have your own ideas or you have some questions about how you could use or adapt the synthetic tooken template to your own project synthetic tokens are really familiar or should be hopefully even think of them as tokens pegged to a particular Price Index so there are token where the token value is backed by collateral that's in a smart contract usually over collateralized and the amount of required collateral is determined by a price index and that price index that I've highlighted in blue is really important because that's where the information from the real world is being transported onto the blockchain and so we've actually seen a couple of examples of synthetic tokens before on main net so some of you might be familiar with synthetics which is another platform where you can deposit snx which is one kind of collateral to create a synthetic Bitcoin for example or you might have seen maker dows die or you can open a CDP deposit eath which is a volatile asset to create a synthetic USD which is a stable ASSA lastly LUMO worked together with a couple of partners earlier this year to create a US stocks token in which you could deposit die to create a synthetic stock index token and so the synthetic asset token template is super general and in theory you should be able to track create tokens that track the price of anything so long as you have the right price feed and so long as you can think of the right type of margin currency or collateral to put inside your token facility and you can create tokens that track anything and that last bullet point is just to drive home the message that here we're talking about synthetic tokens these aren't me this means that these token holders have price exposure to the price feed right so let's say the price feed for this synthetic token is Bitcoin USD the holder of that token has price exposure to Bitcoin est without ever actually having to physically hold keys that correspond to actual Bitcoin so this is another graphic representation of what I just described right so you've got a token facility you've got a token facility here which is this box and inside that token facility you've deposited collateral right so that's what this total collateral is of that a portion is being used as back in collateral so let's say you wanted to create synthetic gold token and let's assume that the price of gold was 100 dollars per ounce what you could do is you could deposit 150 die say into a token facility and then create a token that's backed by a hundred die right so then you'd have a token that kind of reflects one ounce of gold what we have here is you got a required collateral amount so this is very similar to any other kind of over collateralized lending facility they might have seen with CDP where you've got to maintain say 120 die in order to create these tokens worth 100 die well if the lower limit is 120 you should probably top up a little bit more have say 130 die in your token facility and that's the good case right so of course what happens in the bad case you have a liquidation process that's that's very similar to what you might have seen before in this picture you can see you've got again this amount of total collateral right so it goes up to here but because the actual price of gold as is being piped into the smart contract has changed you can see that the actual required amount of cloud or supposed to have is up here you have a shortfall so what happens in this case we have some penalty of the excess collateral on top of your backing collateral that gets paid out to the owners of the synthetic tokens and then the whole token facility unwinds so you as a token sponsor who created this you get to withdraw any remaining collateral that's in there the tokens get redeemed and there's no more collateral in the token facility so it looks fairly simple I'd say in this diagram and we've done that on purpose meaning we've tried to make this product really simple and easy for token sponsors to understand especially for people who are making about potentially opening up one of these positions as a result one of the potential features of this product is that these tokens are not fungible between token facilities we can discuss a little bit more about why we chose for that to be true but I just want to highlight that as one of the features of this template okay so how do you create these synthetic tokens I'm going to try to do a demo using our token builder right now it's ring to be tested up so you will need rinkeby East as well as dye and we have links to those those faucets on our adapt so let me try to open up adapt and show you what that looks like okay so when you come to this page I've already done this before so I've got a token facility up but let's open a new one here you're gonna see you're gonna get to choose the price index that you want the tokens to track so in my example earlier I talked about a token that tracks the price of one ounce of gold but we could choose one of these our team has curated this list of ten price feeds so you really don't want you to feel constrained by what's on this dap and you can talk to mat or frost later about potentially using a different price feed but for now let's say i wanted to create a token that tracked the price of Tesla I'm gonna pick that I'm gonna say that the tokens will expire by the end of the year the reason these tokens have to expire has additional financial engineering context behind it that we can discuss later but what this expiration date means is that before the expiration date only the token sponsor can buy and redeem these tokens against his his own facility at and after the expiration date anyone who holds the token can automatically redeem it back against the against the token facility for the amount of backing collateral that was in there I had a conversation with someone earlier today about how you can think of this as somewhat analogous to the kind of staking or kickback feature that they had for East Waterloo or you how to deposit sort of $20 and then at the end at X pre-write you could come back and redeem it it's a little bit similar to that but we can discuss that in more detail and so now I'm going to watch this token facility what that means is I'm the first remember you need this test nut eath but what that means is remember my diagram before I had those two rectangular boxes right now what's happening in this step is I'm just setting up those boxes with the right parameters and once I actually set up those boxes that's when I can begin to fund them and then borrow tokens from them or close out my positions so I'm gonna let this go oh there we go so right now I actually created those rectangles I'm gonna do this just so that I can begin you know putting dye and borrowing tokens from it and then at the end of this what you'll see is actually that I'll have borrowed some tokens from the facility and then we'll get to see what kind of risk I have so how much dye would I like to collateralize well I can see that the current price of Tesla is about three hundred thirty-seven dollars right so let's say I wanted to create one of these tokens I see that the minimum over Chloe's ation ratio is 110 so that means at a minimum I need say like 370 died right but to be safe I'm gonna put in like 400 and I'm gonna create one token right and you can see it's already doing that calculation of me it's saying that I could do only up to 1.07 so let's do that and now in this transaction what I've done is I've put in collateral into my facility and I'm borrowing one token from it okay so actually quick show of hands after this is done who thinks that I am long Tesla who thinks that I'm short Tesla okay that means that you're alright because the answer is neither the answer is actually I don't have any Tesla risk exposure at all so if you look here what happened is I have this token facility right where I put in a bunch of dye I borrowed one Tesla token so holding the Tesla token makes me long Tesla but I have this token facility out there where I actually borrowed the token from so I'm short Tesla so net I'm flat okay so what do you do now if you're a token sponsor well if I wanted to get short Tesla what I would do is I would sell that token to someone else all right so I'd go out and try to find a counterparty who maybe wants to get long Tesla where am I going to find that person this ties back into Emma's overall vision of universal market access right say there's someone out there who maybe is I know the trope is that you know people are unbanked but say there's someone out there who doesn't have access to a traditional retail brokerage whether they're in the US or somewhere else or for whatever regulatory reasons right maybe not in the US but say there's someone out there who wants access to this well now we've tokenized Tesla into the synthetic token form and you could potentially give that to someone and that give you short Tesla exposure and then long Tesla exposure so that's an example of one potential use case of this kind of technology again this is all in ranked to be testing it it's not on net so I will say like the example I gave is not directly applicable today but hopefully it inspires you to think about what kinds of products you could also create okay cool so sure yeah yeah so um that transfer of the token to someone else you could see on rink me on ether scam yes yes exactly sorry I should've made that super explicit or people Mike it's a new er c22 okay yes ether skin so we can help you debug stuff afterwards - okay I do want to make sure we have time to talk about some other cool applications you can use with this template so what have other people created using this template so far going back there were kind of two main things in that DAP thought I could pick from right I could choose the price index I wanted to track and then also I could choose the merchant currency I wasn't exposed in the DAT but that's another cool toggle that you can play with when you're designing your own synthetic tokens and then lastly of course all this adds up to a project that you're working on so it has some application to the end user that you want to serve so the idea is you know you can pick a flavor so Tom Schmidt from 0x created a really cool synthetic token that he called barf bay area I think what is it real estate fund and it's like a synthetic REIT if you're familiar with with REITs and traditional finance so in that case he chose a reference price index of the Zillow median SF housing price each was a margin currency of dye and that could maybe be a hedge for SF residents right as the cost of housing goes up maybe they hold this token that hopefully gives them some appreciation in case they have to pay more in rent we also saw a really cool project at Eastbourne called swan die and this was a Chokin that tracked the difference between the dye u.s. DC price and one and it was margined in u.s.
DC so basically they were saying well if dye breaks it's peg from one best dollar which we're approximating with USD see the token should go up in value and if it stays very close to the peg it should really be worth close to zero so what is an application of this well if you're someone who really thinks that D Phi is gonna fail and that the maker project is doomed and that dye is gonna break its peg you can put your money where your mouth is and by this token and if you're someone who really believes that dye is going to be stable you might be willing to sell that kind of tail risk in exchange for a little bit of income today so what can you create right I want to do a little bit of a demo ish what's that I wanted to build a crypto Robin Hood again on test nut and everything's on rink B what do you think I would pick as my reference price index as my price index though perfect so I would pick some on chain or off chain assets I would pick maybe the price of Tesla stock right price the price of another stock or basically some kind of real-world asset the margin currency sure I'd probably pick a stable coin u.s. DC is great and then the application is maybe you know I may be running my own exchange where I want people to trade these things and maybe I'm running like a crypt own eyes II type situation or maybe I actually have a wallet and I want to enable the uses of my wallet to be able to buy into these kinds of types of exposures so we got it right one other cool idea I want to throw out there is you could have the margin currency be an interest-bearing stable coin so not only could you then have the price appreciation of whatever stock here looking to track you could also potentially earn some additional interest from using see die instead of die but that I think is the kind of stuff that we're hoping inspires you and gets your creative juices flowing okay so now we're gonna transition a little bit to talk about what technically happens behind the scenes hopefully answer some of your questions earlier but that synthetic token builder I showed you got dad so remember everything lives on test nut and rinkeby right but what I was doing was on the first couple of pages I was defining the parameters of my synthetic token builder and then I sorry token facility then I deployed the contract right and that launched this token facility on test net once I had that I was able to then deposit collateral and borrow tokens and then eventually hopefully trade them with someone so if you're looking to customize your own synthetic asset tokens what are you going to do step one is probably going to be to change the parameters the rest of this flow probably will look very similar and so the main thing that I think is the area where you can add your own twist is when you're defining the parameters I will say you could also try to think about what are some creative ways that you can get people to trade those tokens but on our end sort of I think this is one of the areas where you can add a lot your own your own innovation so when you're changing those parameters basically you'll see this struct with a bunch of parameters and these are the three that I highlighted before that you'll want to think about changing one is the price feed that you're tracking one is the margin currency and the last is the expiration and if you have any questions as you're doing this I don't want emphasized Matt and Roz are here and you can ask them for more technical help in debugging any issues you have but otherwise you should please come talk to us at our table you can follow us on Twitter so that's Emma and then that's me this is our website and then if you scan that QR code which hopefully people know how to do you'll see more information on our talk schedule so this talk as well as a talk that heart Lambor our co-founder will be doing tomorrow on our solution to the Oracle problem as well as some tutorials and links to documentation on how you can build your own synthetic tokens and lastly of course info on our prizes cool any questions in the Dopp yeah yeah so I will say the DAP is something we've used in a bunch of different context so I think one thing to clarify is that those price indices that you see on the DAP the ones with like names make sense the custom ones were ones that we used to give people out of hackathon like the ability to say they had created token without actually setting up their own prices feed but now we have actual tutorials on how you can set up your own and use them with your own contracts so I would encourage you to look at more of the CLI tutorials on the website rather than try to use that to that great question I I know we don't have a ton of time so we'll do a high level answer I think there are probably three main differences one is that maker is trying to create a perpetual product so dye is a perpetual stable coin right while our tokens are expiring the second is that in maker system the tokens are very fungible so if you create a CDP and you borrow die from it you can use that same die to close out someone else's CDP in our structure you can't do that it's not fungible so you can only use the tokens that were borrowed from your facility to close out your own facility and the last is that the maker has a very specific well I guess moving to multi collateral diet certificate they have a very specific price feed that they're trying to target which is EC rusty or as I think our system is trying to be more general and use an Oracle solution to allow you to create tokens that track anything perfect so let me go back to that diagram then this one right okay so let's say we started out in the good case right because when we're initializing this token facility I can always require in the DAP that you have everything in the good case and let's say that you're saying at X Bree right at X Bree let's say that the price of Tesla has doubled then what should happen is over the lifetime of that token facility hopefully the token sponsor has been incremental e topping up or withdrawing margin as needed and so if they sold the token the synthetic token when the price of Tesla was 300 and it went to 600 at X Bree if I hold the Shogun I can redeem for 600 and then exactly because they have the threat that if they don't this penalty will be assessed and the whole tree gets terminated in the Baggies great awesome well thanks for coming please feel free to drop by our desk table if you have any more questions and we look forward to seeing you build oh sure sure yeah yeah I could put this in I'll put it in the discord channel for Emma okay thanks [Applause]
Automatic transcript — names and jargon may be misspelled.