Asset Risk Assessment - RAI
A risk assessment on the Reflexer Finance RAI stablecoin for Curve veCRV holders
Useful links
RAI as an asset:
The framework of RAI is based on Maker. The framework is called Generalised Ethereum Bond (GEB). GEB is a framework that is used to deploy RAI it is a modified fork of MCD that has several core differences.
RAI is not pegged to any asset. The underlying stability mechanism works by different monetary factors that keep the price “Stable”.
RAI is 100% backed by ETH.
The initial redemption price of RAI: 3.14 (pi). Market and protocol mechanisms have since then priced RAI.
Weekly Rai Trading volumes: https://dune.xyz/queries/39745/78255: for the month of November, trading volume has averaged 30+ million (RAI? USD?).
Historic RAI-USD and ETH-USD prices:
The data was derived from the oracles mentioned earlier. RAI has held its value over different market regimes. Zooming into the May 2021 crash
The value of RAI has remained fairly stable in extreme market regimes (volatility and price action).
Market price
The market price of RAI refers to the price at which the asset is traded on the secondary market and is determined via a Chainlink oracle with the following sources.
Rai Redemption Price
The redemption price is determined by the redemption rate; The redemption rate refers to the price at which the asset is devalued or revalued. Devaluation or revaluation occurs when the redemption rate changes (Daily Annualized redemption rate).
When RAI's market price > redemption price for a sustained period, the redemption rate will become negative
When RAI's market price < redemption price for a sustained period, the redemption rate will become positive
When RAI's market price = redemption price for a sustained period of time, the redemption rate will settle at a steady-state (that may be non-zero)
One can safely say that the redemption price is the platform's 'desired price' of RAI. At any given time, there exists a delta between the redemption price and the market price. This changes over time: at any given point, the redemption rate either encourages minting more RAI or encourages settling debts. This re-pricing of the Ethereum Bond incentivises balancing market and redemption prices of RAI:
RAI Market Price > RAI Redemption Price, Redemption Rate is Negative (protocol devalues RAI): You can now take on more debt and sell RAI in the open market for DAI or other assets. This brings the market price down.
RAI Market Price < RAI Redemption Price, Redemption Rate is Positive (protocol revalues RAI): Buy RAI in the open market, pay back debt cheaper. This brings RAI market prices up.
Historic Redemption Prices:
RAI Collateralisation
The following graph gives an idea on the collateral to debt ratio of RAI, or the solvency of the entire system.
Visualised simpler, global collateral ratio compared to liquidation ratio, where the ratio represents the system's total assets in collateral versus total debt. For ease of understanding: the blue line (system state) should be above the red line (mass liquidation events).
Looks like RAI's system is solvent with a good buffer between collateral to liquidation ratios. RAI has proved to be a resilient asset in volatile market regimes.
Reflexer Labs and RAI governance
Platform History
RAI implementation on-chain began in block 11848304: Feb-13-2021 12:33:18 PM +UTC (so, more than 300 days at the time of writing this report).
Revenue/TVL
The platform does not have any revenue. The model of revenue is similar to Maker: the stability fee generates revenue: fees are expected to be switched on at a later stage. The current TVL is 51,634.03 ETH or approx 196 million USD at 29th December 2021 (derived from Reflexer Protocol Analytics). The contract capturing this TVL is 0x2D3cD7b81c93f188F3CB8aD87c8Acc73d6226e3A.
The RAI Dune Analytics Query provides information on undistributed stability fee revenue (Stability Fee Treasury contract) and liquidation revenues (Accounting Engine Contract). A snapshot from their dune analytics dashboard (the treasury is denominated in RAI) totalling to 953k RAI or 2.87 million USD.
Liquidations/Keepers
Like Maker DAO, RAI has keeper bots that read an auction's status directly from the blockchain or from a Graph node. Its unique feature is the ability to plug in external bidding models, which tell the keeper when and how much to bid. Bid prices are received from separate bidding models. Below we see the number of liquidations in the system and the liquidated RAI/ETH.
Shutdown Module
The Shutdown Module oversees winding down the system and returning all collateral back to users in case of a serious threat, such as long-term market irrationality, a hack, or a security breach. In case of any emergency, LP providers to the RAI3CRV pool can always withdraw the underlying value that backs RAI. Everyone can trigger the system shutdown, but in order to do so, has to burn 120K FLX tokens +- 12% of the supply. This might be lowered to 10% before ungovernance, more info.
DAO Backstop and ungovernance
In return for depositing collateral and minting RAI, users are charged a stability fee. The fee is used to encourage external parties to maintain the protocol and build a surplus buffer to fix bad debts. RAI is on a route off ungovernance its protocol and move to community voting; the community can vote with Reflexer Ungovernance Tokens (FLX) that is now being distributed to users of the protocol.
FLX token will have two main functions:
Backstop mechanism: If the RAI protocol goes
down, FLX stakers are the first line of defense. Debt auctions, which mint new FLX and auction it in exchange for RAI, are the second line of defense.
Ungovernance: once governance minimization is complete, FLX holders will be able to take management of any remaining RAI components or, if necessary, continue to manage components that may be difficult to ungovern (such as oracles or any other component interacting with other protocols)
Multisig
There is a 3/5 multisig involved, which has 2 people outside the team and a 24 hours Governance Delay. The multisig address is 0x427A277eA53e25143B3b509C684aA4D0EB8bA01b. The goal of the platform is to minimize governance: the deadline for removing the vast majority of RAI governance is mid-August, 2022. The requirements for Governance minimization are:
The protocol’s governance must not add or plan to add any more collateral types.
All the infrastructure for governance minimization must have been audited and evaluated in production.
The system must accrue enough surplus in its main treasury so that it can afford to pay for oracle, PID, state management, etc for at least six months.
There are lots of discussions ongoing in the Reflexer Governance forums. One such discussion is the discussion of keeping protocol and treasury governance separated, to ensure malicious governance is deterred.
Currently, the multisig has the capability to upgrade and manually set almost all components in the GEB (Generalised Ethereum Bond) framework. The process of governance minimization aims to reduce this drastically.
Audit Reports
All audits can be found in: https://github.com/reflexer-labs/geb-audits. The following list the one's known. If there are audit reports originating from Reflexer's github, those were not found in the auditor's githubs.
There are a few sets of audits done by
OpenZepplin: https://blog.openzeppelin.com/geb-protocol-audit/
Quantstamp:
Solidified:
Curve pool stats:
Answers:
Curve pool history – How long have they had a pool up? – Historical TVL/Volume
The RAI-3CRV pool's genesis was in block 13634171. It is a custom StableswapRAI.vy implementation by the Reflexer Labs team, in collaboration with curve-core devs.
The StableSwapRAI implementation has also been audited by Quantstamp. It's a ver interesting audit report because it begins with QuantStamp suggesting that the code they audited is written in Solidity, but the code is actually written in Vyper.
Summary of audits: There are two points to consider.
QuantStamp discovered that the compiler version used for the contract was not the latest (at that time: 0.3.0) and recommended an upgrade: to which, Reflexer Labs acknowledged the risk and did not upgrade the compiler version. The reasoning was: curve already uses the older vyper version to secure billions of TVL (most of curve's TVL is probably secured by the older version), and hence there was no need to change something which had already proven itself in production.
The redemption price used by StableSwapRAI.vy contract uses an older version of the RAI Redemption Price. The more accurate method would be to first update the price using the updateAndGetSnappedPrice() method from RedemptionPriceSnap.sol or use the Chainlink Oracle for the Redemption Price before the price is called by any of the methods in the contract. Reflexer Labs core team decided to acknowledge and not act upon this suggestion as the redemption price does not fluctuate that much (data from contract: RedemptionPriceSnap)
The other limitation of using an update-and-then-use the redemption price method is the gas costs involved. The team expects that LPs and traders with high value transactions may want to consider calling updateAndGetSnappedPrice to update the RedemptionPrice snapshot contract to the latest value before large liquidity events.
This is an interesting pre-condition to LP-ing or considering large swaps between RAI and 3CRV (socialised RedemptionPriceSnap updates!). The price update is not a gas intensive transaction done once in a while: Example Transaction.
The TVL in the curve pool until 10th of December 2021:
Final Takeaways
RAI is an over-collateralized asset (ETH), having stood the test of time (200+ days old project, which in DeFi years can be eons) through various market crashes (including a 50% drop in ETH prices in 2021). RAI hovers around 3 dollars in its value.
RAI price stays stable, it is almost over-damped, its price in dollar value is barely
affected by changes in ETH price and stays at $3.
RAI is a fork of Multi-Collateral DAI that is formally verified, audited, and went through a generous bug bounty program before hitting production. The changes made are small but effective for the long-term growth of the protocol.
Reflexer Labs has a multisig that controls virtually everything in their GEB system: in mid-August 2022, this will go down drastically.
There have not been big liquidation shocks in the system. The liquidations/keepers mechanism still needs to prove itself but looks promising.
The curve pool implementation was a collaboration between curve-core devs and Reflexer Labs devs and has been audited by QuantStamp with two issues, one high risk, and one medium: these issues in retrospect seem to not be too much of a hassle. The contracts are based on foundational contracts that have stood the test of time. Traders and LPs using the contract for very large transactions (add, remove, swap liquidity) may want to update redemption price before using the pool.
NOTE TO AGGREGATORS AND INTEGRATORS Consider looking into the delta between redemption price snapshot and the system redemption price before adding, removing or swapping liquidity. This may help get your users the right prices for large liquidity events.