"Rai: Building a Money God" - Ameen Soleimani
ETHOnline 2020 · 20 Oct 2020 · 28:12
Ameen Soleimani, co-founder of Reflexer Labs, introduces RAI, a volatility-dampened, ETH-backed reflex index that is not quite a stablecoin. The talk makes the case for decentralisation and minimal governance, explains why the project forked multi-collateral Dai, and uses control theory, including PID controllers, to show how an automated redemption rate can keep the asset steady without votes. It closes with the planned testnet launch and audience questions on incentives.
Speakers
Topics
From ETHOnline 2020, hosted by ETHGlobal.
Transcript
next up we have Amin Solani who is going to be talking about Ry and Ry is a ethereum back stable coin for the defi ecosystem and I'll uh I'll let a me sort of introduce uh how he got started with this project and how Ry works so please welcome a me is it working you can see everything properly yeah cool great uh thanks for having
me um yeah so my name is uh Amin Solani uh I'm here to present Ry building a money god um the co-founder of reflexor lab so thanks for having us uh eth global so today I'm going to give an introduction about the project I'm going to talk a little bit about what I mean by money Gods um we're going to talk about control theory I'm going to explain the reflex index which is the what Ry is it's a new kind of defi asset and I'll talk about our uh forthcoming protoy inet demo launch I want to start with why
decentralization matters and it matters because some things are more important than countries so blockchain networks are Global public utilities and uh Bitcoin is a it's a store of value vending machine for the world eth is a globally neutral Financial system uh we we want to keep them this way uh there's there's a reason uh we we build on eth um and it's uh because we we believe that it's it's going to be uh resilient and and decentralization is a tactical decision maybe even a a formation something like a fallinks where you eliminate the dependency on centralized leadership to reduce the payoff Matrix for an adversary to attack you know if
there's one guy who can topple the whole thing and it's like super worth going after them but if there isn't and then it might not be worth going after anybody at all so the long story short if you want your financial infrastructure or any infrastructure to outlast your country you should think about decentralizing it so what is Ry Ry is a new eback defi asset it's stable coin is uh because it's a reflex index it's not quite a stable coin uh it is volatility dampened index of its collateral so it it's designed to resist sudden price movements but it uh can drift uh over longer time frames uh it is a fork of
maker Dow's multic collateral die we thought that was a great place to start because it's been formally verified ifed doesn't have external dependencies uh has a network of experts that understand it in depth the system is governance minimized so we're trying to remove governance as much as possible uh over the system we uh want to have ungovern meetings where you know the point is to uh stop having the meetings and and and figure out fully automating the system so it can run itself uh one of the things that we have figured out how to automate is the interest rate so we automatically uh set the interest rate uh that keeps the Ry asset stable uh and the asset is optimized to be defi
collateral so it'll be low volatility and we think that because it doesn't have the same counterparty risk that say usdc or usdt have or even die if you think about the maker governance system as your counterparty um might might be helpful so rise being developed by reflexor Labs the CEO is a Charming young man named Stefan ionescu he a 22-year-old solidity wizard in in the UK uh the team is five devs including Stefan I'm a part-time contributor I just work here um uh we also have Nikolai uh the technical co-founder of maker as our adviser and we've raised $1.6 million from uh metac cartel
Ventures and Paradigm standard crypto variant and Robert Ry was born of frustrations with multic collateral die so single collateral die in 2018 was pretty great uh it had eth as its only form of collateral the governments didn't really do anything except set the stability fee and uh the project cared deeply about decentralization I'm going play a little time capsule Blast from the Past um but anyway so so the thing about these this entire model as a whole I don't think that it's possible for this model scale at all in the same in the same way that that D can maker can right because they're not decentralized so like it's just like a different product
essentially because let's say for instance you're building a de if you build it on top of something like tether true USD it's no longer a de right it just became an app because you're actually building on on top of a bank and underneath your product like your product there is a bank that is essentially the the platform you're building on because they're the ones who in a sense they have to agree to you're doing and if they don't you're in trouble because they will actually I mean they can and they will seize your funds freeze them or whatever right like um yeah so uh that was in 2018 uh and now it seems that uh you know with uh M maker and die by extension has
sort of become more of an app than it than it d uh because more of the collateral backing dieet at this point is usdc than than e and and the governance has extended its reach to to do a lot I love this meme of of Mariano slapping all the tokens into into maker so uh uh oh yeah one one more thing I mean also note like uh spankchain had like 400,000 of the die at the time like we liked it because it was you know cyppher Punk money and then uh now it's a little little harder to explain what it is and and justify it but so talk about money God thesis so the idea is of the money God is that it
is possible to build a system that transcends human intervention and is thus treated with a sort of divine reverence so to speak uh you know you you you have faith in in the system and so um one of the things that you have to have is is a a perception of control is liability uh and so if you eliminate these points of control you you can reduce the possibility that uh insiders will exploit the system or Outsiders will will try to damage it or attack it through even regulation um and this increases uh its resilience uh and then through minimum governance you get social scalability so instead of needing to trust some group
of people to make the right decisions about what the interest rates should be or or you know the risk tolerance for various things you sort of just uh trust that the algorithm will continue to operate as it was programmed and maybe it's less flexible but uh you don't have to worry about the Black Swan risk of the humans failing uh you you certainly can worry about the technical risk but um uh the the the the bet is that it's easier to um to scale and and you can see this with Bitcoin right bitcoiners are willing to stake their lives on bitcoin because they trust the system not to change on them unexpectedly there's no group of people that can go and just change Bitcoin unilaterally and and they all uh they Bally enforce that
Norm um another thing is to break the dependency on USD uh USD is losing its purchasing power and it might go away entirely it doesn't seem uh wise for a God to to tether itself to such mortal uh mortal systems uh and and the last is is longevity U because you you want to design the system to outlast its creators and have that kind of framework when you're when you're thinking about uh the design um and the idea is that if you do all these things like people interact with the system differently than they otherwise would and do you get people to buy in and commit uh to uh help it you know grow the system uh because they they know that the rules
can't be changed by anybody and and you can see V Alex a fan too um so talk about control theory uh control theory is is everywhere uh it's the science of maintaining stability um in this context the reason that we're interested in control theory is because we want to remove the control of governance over the system so if we want the to not have people voting on what the interest rates are we have to have an algorithm that sets it and we have to design the algorithm that it can sufficiently handle you know crazy Black Swan events and your sort of day-to-day without needing too much uh human intervention uh ideally there would there would get to a point where there's none um so a control system works like this it has some output that you're
trying to uh get to some desire state it has some input that you're manipulating and you sort of measure the output and then you you manipulate the input and my favorite example of this for beginners is like a shower right you get into the shower you know how hot you want the water to be you you have the input which is the knob and you're sort of twisting the knob to make sure that the shower eventually gets to to be the right temperature um if you if you move the knob too fast uh if you're if your controller is too sensitive then you're going to overshoot and you're gonna get hot water and then have to you know turn it all the way back and then uh you know repeat the process and so the whole science of control theory is to um try to optimize the system to quickly
achieve uh the desired Target but without overshooting too much the most common form of uh controller is the PID controller and the way the P controller works is it combines these three terms all derived from the error the the difference between what we want the system to be at and what it is currently at so the proportional term is directly proportional to the current err so if if the temperature that we want the water is like 100 and the temperature is currently you know 105 that's uh if if it was 110 then that term would be like twice as big so uh that just points in in the direction of uh what the error is
the uh and and you can think of that as like the sort of standard okay well if it's hot then I should oppose it if it's cold I should you um the integral is different the integral it accumulates the error over time and it's typically used to deal with steady state error so if there's a slow a small amount of error that the proportional uh term isn't quite sensitive enough to pick up uh it'll build and build and build over time until uh it uh you know is large enough that the integral term grows and responds to it and so you can think of this in the context of like cruise control maybe your car is good at uh if you have the set point to 80 mil hour you know if it's like one mile per hour lower and and it's staying there for a
while then there's something that'll eventually bring it back up to 80 um the the derivative is based on how fast you are approaching or moving away from the equilibrium I'm not going to talk too much about that it's not as relevant for this but um it's it's another way to uh quantify there it's typically used for uh uh more more fast responses um so when when we're building this algorithm we're essentially tuning a controller and so each of these terms has a constant associated with it called the gain there's a KP the Ki the KD uh so there's proportional gain and integral gain and our objective is to determine what these parameters should be so that the uh interest rate responds
and and keeps uh Ry stable and uh we're going to take a little field trip it's going to be a few minute video of watching a man uh stabilize his robot so yeah let's uh start again and uh look at just proportional control and how to pick the uh gain and uh and what it looks like if you go too high or too low all right so I've uh got the robot laying on its back right now and I took the uh if you look at the bottom the bottom three charts I took the integral and derivative part uh the gains and z the mount so are basically not have any effect we now just have a proportional uh control feedback loop and um let's
take a look at how that performs so because it has the gain that I uh chose earlier it's actually balancing all right but let me uh try to get this all on frame so you can see it a little better see if I can get that this is the kind of thing we do at uh reflex all in frame okay so that's stabiliz about as good as I can get okay so if I um if you look at the bottom left chart the P scaler or P gain chart um well first let me drive it around I guess so you can kind of see that it it balances okay but not very well you kind of see whenever I give it
an input it kind of It kind of oscillates a little bit and that's even with the the proportional gain set pretty well if you set it um much lower so if you can kind of see now on the on the TV I've got the game set at about 5,000 and now it just really doesn't want to uh to balance I have to uh I have to kind of constantly I have to kind of manually balance it uh it's just kind of all over the place so yeah if your proportional gain is set too low it's just going to drift it isn't going to uh hold its position very well and it might even flip over okay so if you uh if you raise the gain so we're going to bring it up
towards about 12,000 which is where it was you can see that it'll work all right it still drifts quite a bit but now it can I get that in frame uh now it can you know reasonably well on its own um perform but it still drifts a lot and then if you set the gain way too high so you can kind of see right there the gain is set to 24,000 um it balances a little bit better but then it'll oscillate and uh you can even see in the the graph um yeah so that's one thing you got to be careful with if you set it too high it's uh it'll get kind of
ridiculous so for my particular robot uh a proportional gain uh cool yeah that was it um so so the point of that is that that that is actually uh what what we are doing uh except instead of uh keeping a money a robot uh up we're keeping uh the the price stable and uh we're not fighting gravity and and and what not we're fighting Market forces and we are tuning process and uh what we'll try to accomplish with our main net demo and and uh building the system over time is understanding the Dynamics of the market to properly tuned parameters so that this thing can be stable in a variety of conditions one of the interesting things
that I learned in the process of of this was that um central banks actually sort of run on control theory they just don't know it yet uh so they uh have these these uh policy rules of thumbs uh most of them derive from this Taylor rule where you've got this inflation Gap pi and output Gap Y and they determ the federal funds rate the interest rate are um and uh you know some of them have historical terms like the integral and and so forth and if you break down uh many of these policy rules they're actually all fit into the same terms that a p controller would have in terms of forward-looking and backward
looking uh adjustments um so let's talk about what Ry is as a reflex index um so the to understand what Ry is you need to understand these these Concepts so the concept of the Redemption price uh it's different than in something like maker because in maker the Redemption price is sort of always one die equals $1 uh that's the the meaning of of it having a peg uh in this case uh the value the Redemption pric is uh the value of R internal to the system used for the collateralization ratio same as maker but uh it's in dynamic equilibrium with the market price so the Redemption price can change over time uh and it
gets uh set by the the Redemption rate and so the Redemption rate is the current rate of change of the Redemption price and the Redemption price doesn't really matter what it what it starts at it can be sort of arbitrary um so the and then the Redemption rate feedback mechanism is what updates the Redemption rate in response to uh differences between the Redemption price and the market price in order to uh make those two reach equilibrium uh and keep the ultimately Redemption uh the price of Rye uh stable so here's the two sort of Loops so if the price of Ry goes up people start buying Rye uh then the Redemption
rate of Rye goes negative uh which means the Redemption price of Rye starts to drop and so if you are a holder of Rye at that point you are effectively getting a negative interest rate you are uh you are essenti uh paying to hold Ry and so some of those holders might want to sell in order to avoid that negative interest rate and in which case Ry would return to its its uh equilibrium and I say new here because uh when the Redemption uh price starts to drop like it'll go the the it'll continue uh to change until the market price reaches it uh it it won't go to what it originally was it'll it'll uh end up you know
having drifted some from its original set point um and and the same happens in Reverse if the r price goes down then the Redemption rate goes positive uh suddenly uh if I'm holding Ry I'm being uh paid uh to hold rye and if I'm borrowing Rye then uh I am I'm paying extra interest on my loan uh the the Redemption price starts to increase uh and so Ry borrowers who don't want to face that interest uh buy back Ry to pay their loan uh and then Ry returns suits new equilibrium got it message in the chat how do I check that oh
cool um right so uh this is like what that looks like in practice so this is uh on the right and on the left this is the same uh chart the 2016 uh data science that makerd did uh to to try and um simulate how the uh trfm as they called it Target rate feedback mechanism would have worked the market price the terminology is a little bit different so on WE renamed Target uh price to Redemption price and deflation rate to Redemption rate but ultimately it's sort of the same you can see that this system introduces a shock between uh days five and 15 so on day five the market price spikes uh and you can see it up here too and in response to that the interest
rate uh drops a lot and uh it keeps going until the market market price uh reaches equilibrium and uh once it does then the two sort of remain in equilibrium for another several days until the shock wears off and at which point the market price rebounds so the interest rate then rebounds in the opposite direction until it reaches equilibrium again and note that the Final Redemption price given that this Redemption rate has sort of been between one and three it's positive this whole time is slightly positive and so it is not pegged to anything it's it is actually increasing um so yeah the behavior of the reflex index so when you think about this in
terms of a financial product uh what do you expect it to do well you expect it to resist sudden price movements uh and it's essentially using these interest rate based incentives to counter that and create its own little gravity well um but on the long term the the price should follow the demand for E leverage with the ass being that um the uh sorry demand for eth leverage with the Assumption being that eth uh eth Leverage is also correlated to eth price so on the long term we expect this to sort of follow the eth price um and and the mechanism for that is when people
are leveraging eth they they leverage eth Ry so they borrow Ry they sell the Rye they buy more e they borrow Rye you know keep doing that uh and this pushes up the price of Rye but but then over the longer term this pushes the Redemption rate uh I'm sorry pushes the price of ride down which pushes the Redemption rate positive and overtime increases the Redemption price so you could see that um equilibrium will shift over time uh and then the other thing is we want to optimize Ry in terms of shock recovery time how long does it take the system to reach stability again uh minimize overshooting and add an amount of manipulation resistance and so that's like how expensive is it to somebody to
introduce instability into the system by for example you know messing with the control or buying a lot pushing the controller one way and then selling and then moving it the opposite way and and essentially doing Oracle manipulation uh and and another goal is of course to maximize for Ry e liquidity which would reduce slippage to make it cheaper to enter and exit into uh Ry um as a system so our progress thus far we've been pretty busy we converted multic collateral die to English so it doesn't have weird names anymore built all the smart contracts including the control system built the subgraph the keeper liquidation Bots typescript libraries developer docs did the historical data
analysis on maker we calibrated our CAD cut Sims and we are now preparing for our main net demo uh this is what it looks like to calibrate our uh simulations with our solidity code so at the top you can see the python uh the bottom you can see our solidity and they look pretty much the same so the the left you can see is uh Y axis is the target um price and and on the right you can see that's the interest rate that's the Redemption rate that's being set this is important because if if if they didn't match then our simulations would produce parameters that were not super helpful in production on on real ethereum um we've also made uh
schematics like this uh in building this if this kind of thing turns you on please proceed to our documentation love to work with you um protoy so we are launching our first main net demo in four weeks there it's going to be a 10,200 pry RIT limit uh it's about two bucks so like 20 20,000 is total um it's just meant to be a game to see how people interact with it we try to leverage long e dry we try to mess with the controller uh and and test out our our system so if that sounds fun to you please come and join that uh and if you're a control freak uh please uh join us and help us taking
blockchain control theory from zero to one we're proud to be working with block science with Michael zarum uh who made CAD cat our Sim software uh and we are are interested and working with anybody else who's who's interested in this as well so yep that's all I got amazing um thank you so much I mean that was a great um was a great lesson in not just where rise but also a good refresher on control theory that definitely takes me back to some of the my college courses um there are a handful of questions that have come up and and uh what I'll do is I'll kind of ask you a couple of them here um but uh just to kind of keep
everything moving along on time I'll I'll encourage you to kind of join the chat after this if you have time and just answer those people directly but uh the kind of the first question that I have is actually for me and that is um there's a lot of reinforcement uh and and kind of uh information you need to do and and kind of improve on uh for the control systems to work so I'm actually just curious um are there any limitations on what you can do on on Smart contracts uh with respect to designing a perfect control system or feedback loop here uh and like is there anything that's not possible uh or or like is everything just fine and works really well in in kind of how you're envisioning R Tob yeah that's a good question um so we're fortunate that most of the even
like more sophisticated control systems are mathematically efficient uh so they're relatively easy to build on Smart contracts uh the there is like you know gas thinking to do because you have to think about how often you update the system and how expensive if it is to often to update it often and uh if you can for example you know update it less often and and but but what there's always a trade-off when you're when you're doing that right so awesome um and uh the second question we have from our chat I'll just say this for BM um what is the incentive to redeem Ry when the Redemption rates go negative uh shouldn't they just wait until it
rebalances on its own or when they are ready to redeem uh what is the incentive to redeem Ry uh so if if the rate's going negative so that means there's a lot uh the price of Ry goes up so the rate goes negative um I mean uh like part part of it is arbitrage I mean you know why do people redeem die when the price is up uh part of it is that uh you if if the price is currently like I don't know let's say 1.1 relative to its starting position uh and the interest rate is ne10 then you know you know that uh it's going down so you want to get ahead of that interest rate you
know if if you that doesn't bother you then you can hold and anybody who that bothers can take that action I hope uh this clarifies the question for the person who asked this on the chat um so thank you so much I mean uh we uh we have posted I mean slides on our chat so if anybody's interested in looking at the deck uh you can just click the link there and uh for any other questions that you have for me uh we'll either relay them to him directly or he'll join the chat and answer them directly to you so uh thanks so much um and thanks again for your time thanks for having me with that I'd like to
Related talks
- Liquity V2: The Endgame for CDPs
- Exploring f(x) Protocol 2.0
- Blockchain trilemma cracked: what about the stablecoin's?
- Yield-bearing stablecoins and the growth of Spark
- Creating Peaceful Money | Ameen Soleiman, Joseph Schiarizzi, Jessica Salomon, and Reza Jafery
- Ameen Soleimani: RAI – A Low Volatility Trust-Minimized Stablecoin #460
- The Landscape of Decentralized Stablecoins
- The On-Chain Euro: An Open Design Conversation Between Banks and the Builders Who'll Make It Real
- Yield bearing Stablecoins: Design Trends & Redefining Value Distribution
