Deploying an RToken to Goerli Testnet using the Register App
Reserve Protocol Gitcoin Hackathon Research & Create Content Essay & Tutorial
What is the Reserve Project? It is new way to create a decentralised stablecoin or digital currency that is immune to inflation and has yield bearing capabilities. These stablecoins are called RTokens and are unique to the user that deployed them. On the other hand, LUNA or USDC are algorithmic and 1:1 fiat backed stablecoins, respectively. RTokens are backed by a basket of digital assets or collateral tokens. 1:many.
They are trying to solve the inflation problem.
Why do I care and you should too? From a humanity lens, in countries that have high inflation like Latin America, Venezuela, Sri Lanka, or Argentina (if you’re into soccer, they are in the finals!). This is an opportunity to give the local people a way to protect the value of their local currency from dropping in value. As a result, this improves quality of life because they can save and spend more. From a technology lens, I am extremely excited because I think the next dapp that will bring us out of this bear market is an innovation around decentralised stablecoins like Reserve Protocol.
What are the possibilities? The possibilities are limitless. On the one hand, in hyper inflation economies and currencies prone to inflation like Pesos and BOB. You can exchange them for USD and in doing so protect the value of hard earned money and savings. On the other hand, in richer countries with low inflation like Singapore, by being an RToken holder or RToken staker, this allows the ability to leverage those tokens to earn yield or in the case of a staker, earn passive income through fees.
What can I do with this new stablecoin or RToken? The possibilities are limitless. In particular, two that I’m excited about are tokenising real world assets and decentralisation.
Reserve is working towards a future where any digital asset can be a collateral. Once a real world asset like a piece of real estate, financial loan, or gold is tokenised, it can become a collateral in the basket that is used to mint or generate an RToken. This RToken can be used for purchasing goods and services like healthcare or education that can significantly improve the quality of life for people.
RTokens can be minted and distributed to different stakeholders. This makes it a decentralised project because it is owned and controlled by the community and not a centralised party.
Now that you know the background, the rest of this essay is a tutorial targeted towards tech or non-tech users who are new to Reserve, thrive on using technology to make a difference, interested about stablecoins, or want to get a taste of deploying their first stablecoin on Ethereum.
You will build a basket of collateral, set up basic governance for it, and deploy the RToken to Goerli testnet using Register, the first dApp for Reserve Protocol. We will be using Metamask. To perform this tutorial successfully, you will need to have Goerli test ETH. See this page for a list of Goerli faucets. Currently, it’s hard to get a good amount of GoerliETH for testing. For me, the best way to get a good amount is on Discord, preferably through someone you know from a particular project or protocol you’ve been contributing. For those interested, there will be a sidebar to explore each of the 15 parameters that can be configured for greater granularity. We will not going into the governance parameters in this tutorial. But I’ll be providing links to external references.
These are the steps that will be completed and the screenshots for each completed stage.
Step 0: Connect Metamask and select the appropriate testnet.
Step 1: Configure your RToken collateral basket parameters.
Step 2: Define RToken parameters.
Step 3: Set up governance.
Step 0: Pre-setup
Open browser to https://test.register.app/
Connect wallet > Choose Metamask
Ensure the Goerli test network is selected in your Metamask wallet.
Click “Deploy RToken” button
Click “Start”
Step 1: Configure your RToken collateral basket parameters.
Click “Add Token Plugin”
We will be using three plugins > select
aUSDC plug-in
cWBTC plug-in
wETH plug-in
Why have we selected these three collateral assets is not important. These were randomly selected. What is important is that you must have these collateral assets in your wallet to mint the RToken after it is generated.
Now that we have selected the collateral we want to use for our basket >
Click “Add to primary basket”
Your Primary Basket settings should now look like this.
3. Click “Confirm basket”
Step 2: Define RToken parameters.
Token name - the name of the RToken eg. LonesomeShark SGD
Ticker - symbol eg. LSGD
Mandate - The mandate describes what goals its governors should try to achieve. By briefly explaining the RToken’s purpose and what the RToken is intended to do, it provides common ground for the governors to decide upon priorities and how to weigh tradeoffs.
Use this for the mandate - First, capital preservation. Second, spending power preservation. Third, permissionless access.
We will not be customising any values and using the defaults. However, if you are interested, see the section below otherwise skip to step 4.
Sidebar: what each parameter does and why does it matter. If you just want to deploy the RToken, feel free to skip this section.
All the information on RToken parameters can be found in their System Design Github page here.
Backing manager x7 parameters
Trading delay - how many seconds should pass after the basket has been changed, before a trade is opened. Why does this matter? To avoid losses due to poor liquidity. The default is 2160s or 36 minutes.
Auction length - defines how long Gnosis auctions should be. Gnosis Auction is a platform enabling fair price discovery for token auctions. The aim of the platform is to make it easy for teams to discover a fair price for their token. The default value is 900s or 15 minutes.
Backing buffer - percentage value that describes how much additional collateral tokens to keep in the BackingManager before forwarding tokens to the RevenueTraders. The RevenueTraders here refers to the RToken and RSR traders. Why this matters? It allows collateral tokens to be periodically converted into the RToken, which is a more efficient form of revenue production than trading each individual collateral for the desired RToken. For more info on the BackingManager and Trader types see the “Revenue distribution to RToken holders” and “Summary of revenue distribution” here. The default value is 0.01%.
Max trade slippage — maximum deviation from oracle prices that any trade can clear at. The default value is 1%. Why this matters? Acts as a form of slippage protection.
Issuance rate - allows the issuer to limit the amount of RTokens issued per block. This matters because in an exploit where an attacker tries to issue more RTokens. This buys time for users with pause or freeze permissions to reduce the amount of RTokens that can be issued. The default is 0.025%. If an RToken gets deployed with the default settings, only 0.025% of the market cap of the RToken can be issued per block. For more info see the “Issuance throttle” section here.
Scaling redemption rate - percentage value that describes what proportion of the RToken supply to allow redemption of per-hour. It controls how quickly the protocol can scale down RToken supply. The default is 5%. For more info see “Redemption throttle” section here. Goes hand in hand with redemption rate floor below.
Redemption rate floor - minimum quantity of RToken to allow redemption of per-hour, and thereby the rate to charge the redemption battery at. The default is 1,000,000 RTokens. Goes hand in hand with scaling redemption rate above.
Other x8 parameters
Reward distribution - sliding scale that determines what percentage of the reward goes to RToken Holders and what percentage goes to RSR Stakers. The default is 40% to RToken Holders and 60% to RSR stakers. For more info see the appropriate sections on “Revenue distribution” here.
Short freeze duration - number of seconds an initial freeze lasts. The default is 259200s or 3 days. This provides the ability to freeze an RToken’s system for a short period of time which is useful to thwart an attack.
Long freeze duration - freeze an RToken’s system for a longer period of time. The default value is 2592000s or 30 days.
For further information on both of these freeze parameters see “System States + Roles” here.
Un-staking delay - number of seconds that all RSR un-staking must be delayed in order to account for stakers trying to frontrun defaults. The default is 1209600s or 2 weeks.
Reward period - length of time that comprises a single period. Works in conjunction with reward ratio (see below) to determine the desired payout rate. The default is 604800s or 7 days.
Reward ratio - amount of the current reward amount that should be handed out in a single period. Works in conjunction with reward period (see above) to determine the desired payout rate. The default is 0.02284. This is approximately half life of 30 pay periods.
Minimum trade volume - minimum sized trade that can be performed, in terms of the unit of account eg. USD. The default is $10K.
Maximum trade volume - maximum sized trade for any trade involving RToken, in terms of the unit of account eg. USD. The default is $1M.
Click “Customize” then “Confirm parameters”
Again, we take all the defaults in this tutorial. For further info, refer to their System Design doc on the Reserve Github page here.
Your RToken Summary page should look something like this
Click “Deploy RToken”
Metamask popups > click “Confirm”
Your RToken should be deployed in under 5 seconds.
This is the page you’ll see.
At this point, your status bar at the top looks like this. If you’ve reached this point, you have deployed an RToken.
Step 3: Set up governance.
Click “Configure Governance”
Ensure “Use Default Governance format?” is turned on (green)
Open Metamask > Copy your wallet address > Paste it in the “Guardian” and “Pauser” address fields. For more info on what these addresses are and Reserve Governor Alexios see this page.
Use the default “Governance parameters.”
Click “Confirm governance setup.”
You should see this summary page.
Click “Configure Governance”
Click “Confirm governance setup” then “Confirm” on the metamask popup.
Governance setup is now complete and this is the window you should see. Note: the addresses will differ.
Congratulations. You have successfully deployed your first RToken!
In this tutorial, we built a basket of collateral, set up basic governance for it, and deployed the RToken to Goerli testnet using Register app. For developers, you can deploy an RToken by directly making smart contract calls. See here for how to do that.
By now, I hope you are as excited as I am. Now it’s time to go down the rabbit hole, see below.
References
Everything on one page (go through it, spread the love and share it) - here.
All the protocol docs on github - here.
Reserve Protocol docs for humans - here.
Best Reserve Introduction video - here.
October 10th, 2022 Reserve Protocol launches on Ethereum mainnet in Bogotá, Colombia - all videos on launch day here.
RToken and governance parameters - here.
Deploying smart contracts - here.
How to write a collateral plugin - here.