-
Notifications
You must be signed in to change notification settings - Fork 10
Add Adrastia Prudentia for controlling supply & borrow caps #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Add Adrastia Prudentia for controlling supply & borrow caps #643
Conversation
v4.0.0-beta.2
- Reduces the size of the Comptroller contract
contracts/compound/Comptroller.sol
Outdated
uint256 underlyingDecimals = 18; | ||
|
||
// Try to get the underlying asset address (we use a staticcall b/c CEther doesn't have an underlying) | ||
(bool success, bytes memory data) = cToken.staticcall(abi.encodeWithSignature("underlying()")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after the refactoring from #638 is merged, the CEther/CToken will removed from the codebase in favour of CErc20, so these calls can be simplified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the speedy review, Veliko! I've simplified the calls for getting the underlying token address.
* @author Tyler Loewen (TRILEZ SOFTWARE INC. dba. Adrastia) | ||
* @notice A diamond extension that allows the Comptroller to use Adrastia Prudentia to control supply and borrow caps. | ||
*/ | ||
contract ComptrollerPrudentiaCapsExt is DiamondExtension, ComptrollerV4Storage, ComptrollerErrorReporter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this extension does not need to inherit the ComptrollerErrorReporter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Fixed.
Description
Adds support for using Adrastia Prudentia for controlling supply & borrow caps.
Task list
Type of change
High-level change(s) description - from the user's perspective
Adrastia Prudentia is a novel rate controller system that can be used to manage a variety of risk parameters. Prudentia improves security and user experience while streamlining risk management. Its key features are:
This PR uses Prudentia for controlling supply & borrow caps. Lenders and borrowers can expect more fluid changes as they won't have to wait for the vault's risk management team to perform updates; these updates can be automated. Tighter controls can also be employed as updates can be more frequent, allowing for greater protection of user collateral.
Risk management teams can expect to do less tedious work. Instead of manually changing supply & borrow caps as vault activity changes, they can continue monitoring the markets, making infrequent adjustments as necessary. They can also rest with more peace of mind as Prudentia's rate limiting and other controls protect the vault from human mistakes, such as missing a zero.
Note: Ultimately, the changes to the user's experience depend on how Prudentia is configured.