MarketCapsRiskSteward
MarketCapsRiskSteward
Section titled “MarketCapsRiskSteward”Contract that can update supply and borrow caps updates received from RiskStewardReceiver.
This page follows MarketCapsRiskSteward.sol at v2.15.0. On BNB mainnet at block 118369568, proxy 0x816FfD00A274EDE0091421F77817ca260Db3a3E3 used implementation 0x6c4538b7e85b073099BFf08B43F7273E4792Bb43, matching the tagged artifact. Destination-mainnet deployment must be verified separately; the stable tag contains destination instances on testnets.
Solidity API
Section titled “Solidity API”SUPPLY_CAP
Section titled “SUPPLY_CAP”The update type for supply caps
string SUPPLY_CAPSUPPLY_CAP_KEY
Section titled “SUPPLY_CAP_KEY”The update type key for supply caps (keccak256 hash of SUPPLY_CAP)
bytes32 SUPPLY_CAP_KEYBORROW_CAP
Section titled “BORROW_CAP”The update type for borrow caps
string BORROW_CAPBORROW_CAP_KEY
Section titled “BORROW_CAP_KEY”The update type key for borrow caps (keccak256 hash of BORROW_CAP)
bytes32 BORROW_CAP_KEYRISK_STEWARD_RECEIVER
Section titled “RISK_STEWARD_RECEIVER”Address of the RiskStewardReceiver used to validate incoming updates
contract IRiskStewardReceiver RISK_STEWARD_RECEIVERconstructor
Section titled “constructor”Sets the immutable RiskStewardReceiver address and disables initializers
constructor(address riskStewardReceiver_) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| riskStewardReceiver_ | address | The address of the RiskStewardReceiver |
❌ Errors
Section titled “❌ Errors”- Throws ZeroAddressNotAllowed if the RiskStewardReceiver address is zero
initialize
Section titled “initialize”Initializes the contract as ownable and access controlled.
function initialize(address accessControlManager_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| accessControlManager_ | address | The address of the access control manager |
setSafeDeltaBps
Section titled “setSafeDeltaBps”Sets the safe delta bps
function setSafeDeltaBps(uint256 safeDeltaBps_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| safeDeltaBps_ | uint256 | The new safe delta bps |
📅 Events
Section titled “📅 Events”- Emits SafeDeltaBpsUpdated with the old and new safe delta bps
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- Throws InvalidSafeDeltaBps if the safe delta bps is greater than MAX_BPS
- Throws RedundantValue if the new safe delta bps is equal to the current value
isSafeForDirectExecution
Section titled “isSafeForDirectExecution”Checks if an update is safe for direct execution (no timelock required)
function isSafeForDirectExecution(struct RiskParameterUpdate update) external view returns (bool)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| update | struct RiskParameterUpdate | The update to check |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | bool | True if update is safe for direct execution, false if timelock is required |
❌ Errors
Section titled “❌ Errors”- Throws UnsupportedUpdateType if the update type is not supported
- Throws RedundantValue if the new cap value is equal to the current cap value
applyUpdate
Section titled “applyUpdate”Applies a market cap update from the RiskStewardReceiver. Directly updates the market supply or borrow cap on the market’s comptroller.
function applyUpdate(struct RiskParameterUpdate update) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| update | struct RiskParameterUpdate | RiskParameterUpdate update to apply |
📅 Events
Section titled “📅 Events”- Emits SupplyCapUpdated or BorrowCapUpdated depending on the update with the updateId, market and new cap
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Only callable by the RiskStewardReceiver
❌ Errors
Section titled “❌ Errors”- Throws OnlyRiskStewardReceiver if the sender is not the RiskStewardReceiver
- Throws UnsupportedUpdateType if the update type is not supported