As a long-time contributor to Compound, I am excited to present my latest innovation: a novel automated rate controller system. This cutting-edge solution is designed to improve and streamline the management of Compound’s rates while offering advanced features and capabilities.
User stories
Paul’s experience with setting rates
Paul is responsible for adjusting Compound’s collateral factors to mitigate bad debt and maximize capital efficiency. He faces a challenge in changing the collateral factor for UNI from 75% to 65%. Paul is aware that significant changes can lead to negative user experiences, as such a change could put borrowers underwater. He understands that not every borrower pays attention to governance proposals and may only monitor their current loan health. Ideally, he would like to split this significant change into smaller increments over time. However, this would necessitate multiple governance proposals, potentially overwhelming the governance system.
Paul decides to utilize Adrastia’s novel rate controller to decrease the rate by 2% over five days. By doing so, he enhances the user experience while only requiring a single governance proposal. This innovative solution allows for a smoother transition and minimizes potential negative impacts on borrowers.
Tyler’s experience as a user
During a bull market, Tyler, a user who borrows stablecoins from Compound against his Ether, faces volatile interest rates. He wants to borrow a large number of stablecoins but is concerned about the rapid fluctuations in interest rates. To improve the user experience for Tyler and other borrowers, Compound DAO employs Adrastia’s novel rate controller to stabilize rates. Instead of having rates fluctuate block-by-block, they built a rate computer module to adjust rates based on daily average utilization rates, limiting changes to 0.5% daily. The end result is a more stable and predictable interest rate environment for borrowers like Tyler.
Key features
- Rate Limiting Support: Safeguard against excessive rate fluctuations, enhancing platform stability and user experience.
- Delayed Rate Activation: Give users visibility on upcoming rate changes, fostering transparency and allowing them to plan accordingly.
- Granular Access Control: With five unique roles, enable precise control over rate management to ensure a secure and well-organized system.
- Circuit Breakers: Protect the platform from extreme market conditions and minimize risks through automated emergency response mechanisms.
- Dynamic Rates: Automatically adjust rates in response to market changes, ensuring the platform stays competitive and aligned with prevailing conditions.
Use cases
Our automated rate controller system offers versatile applications, such as, but not limited to:
- Managing collateral factors to optimize risk management
- Implementing supply and borrow caps as velocity limits, enhancing system stability
- Streamlining interest rate adjustments to better reflect market conditions
Scalability and future development
While the system is relatively simple in its current form, it offers excellent potential for future enhancements. Through responsibility delegation to dynamic rate computer modules, you can easily build upon and expand the system to incorporate more sophisticated features and functionality as needed.
Data feeds integration
Adrastia has a growing set of data feeds that can be seamlessly integrated into the dynamic rate computer modules. These data feeds include essential information such as price, liquidity, and historical volatility, providing valuable input for the system to make well-informed rate adjustments. By leveraging these data feeds, the automated rate controller system can further enhance its capabilities and provide an even more robust and reliable solution for managing rates.
For example, a dynamic collateral factor could look something like the following.
With a fixed portion of 30% and a dynamic portion of up to 15%, the collateral factor can dynamically adjust between 30% and 45%. Note that our novel rate controller system supports rate limiting, so there’s no need to worry about large fluctuations over short time spans, even though the dynamic range is 15%. Also, note that the fixed portion is changeable by the rate admin (governance).
Demo
I deployed a demo to Polygon about five days ago with the initial RateController setup that I’m proposing for Compound. The update period is 24 hours, and the buffer’s capacity is two, allowing up to one day of delayed rate activation. Let’s dive into the transactions.
- Mar-25-2023 - Initial rate setup for WETH
- Max increase: 2% daily
- Max decrease: 1% daily
- Base rate: 50%
- Gas cost: ~103k gas
- Mar-25-2023 - Initial rate update for WETH
- Target rate: 50%
- Current rate: 50%
- Gas cost: ~71k gas
- Mar-26-2023 - Rate update for WETH: To fill the buffer (updates stop here unless the target rate changes, to save gas)
- Target rate: 50%
- Current rate: 50%
- Gas cost: ~74k gas
- Mar-27-2023 - New rate config for WETH
- Max increase: 2% daily
- Max decrease: 1% daily
- Base rate: 60%
- Gas cost: 41k gas
- Mar-27-2023 - Rate update for WETH
- Target rate: 60%
- Current rate: 52%
- Gas cost: ~61k gas
- Mar-28-2023 - Rate update for WETH
- Target rate: 60%
- Current rate: 54%
- Gas cost: ~61k gas
- Mar-29-2023 - Rate update for WETH
- Target rate: 60%
- Current rate: 56%
- Gas cost: ~61k gas
As we can see, the system works as expected. When it comes to consumption, the comptroller can call getRateAt(token = 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619, delay = 1)
to get the rate for the token with a one day delay in rate activation. This function returns a tuple containing the target rate, current rate, and timestamp from when the rate was pushed. Having both the target and current rates allows the comptroller to choose the lower of the two when extending credit.
More information
Links
- Website: https://adrastia.io/
- Discord: https://discord.gg/sZP9SUBuSC
- Twitter: https://twitter.com/AdrastiaOracle
- GitHub: https://github.com/adrastia-oracle
- Docs: https://docs.adrastia.io/
RateController
- Contract source code: https://github.com/adrastia-oracle/adrastia-periphery/blob/development/contracts/rates/RateController.sol
- Tests and coverage: 145/145 passing with 100% line, branch, and function coverage
- Audit status: to be scheduled
- Live demo: https://polygonscan.com/address/0xbB50b341A7d866D595c2c374C1aAbf426fa280D5
Next steps
- Gauge sentiment - is this something the Compound DAO is interested in?
- Developer feedback - is the RateController contract missing anything?
- Schedule an audit for the RateController contract
- Integration - how should this system be used? How should the Compound codebase be modified?
- Schedule an audit for the integration
- Deployment configuration, division of responsibilities, and compensation
- Launch
In conclusion
I believe that integrating this novel automated rate controller system into Compound will lead to significant improvements in efficiency, security, and user experience. I am eager to discuss this proposal further and demonstrate how the system can be tailored to Compound’s requirements.
Please present any comments, critiques, or questions regarding Adrastia’s novel rate controller system. I am confident that this innovative solution will bring substantial value to Compound and its users.
Thank you for considering my proposal, and I look forward to our continued collaboration.
Best regards,
Tyler Loewen
TRILEZ SOFTWARE INC.