> For the complete documentation index, see [llms.txt](https://docs-v4.venus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-v4.venus.io/technical-reference/reference-governance/market-caps-risk-steward.md).

# MarketCapsRiskSteward

## MarketCapsRiskSteward

Contract that can update supply and borrow caps updates received from RiskStewardReceiver.

## Solidity API

#### SUPPLY\_CAP

The update type for supply caps

```solidity
string SUPPLY_CAP
```

***

#### SUPPLY\_CAP\_KEY

The update type key for supply caps (keccak256 hash of SUPPLY\_CAP)

```solidity
bytes32 SUPPLY_CAP_KEY
```

***

#### BORROW\_CAP

The update type for borrow caps

```solidity
string BORROW_CAP
```

***

#### BORROW\_CAP\_KEY

The update type key for borrow caps (keccak256 hash of BORROW\_CAP)

```solidity
bytes32 BORROW_CAP_KEY
```

***

#### RISK\_STEWARD\_RECEIVER

Address of the RiskStewardReceiver used to validate incoming updates

```solidity
contract IRiskStewardReceiver RISK_STEWARD_RECEIVER
```

***

#### constructor

Sets the immutable RiskStewardReceiver address and disables initializers

```solidity
constructor(address riskStewardReceiver_) public
```

**Parameters**

| Name                  | Type    | Description                            |
| --------------------- | ------- | -------------------------------------- |
| riskStewardReceiver\_ | address | The address of the RiskStewardReceiver |

**❌ Errors**

* Throws ZeroAddressNotAllowed if the RiskStewardReceiver address is zero

***

#### initialize

Initializes the contract as ownable and access controlled.

```solidity
function initialize(address accessControlManager_) external
```

**Parameters**

| Name                   | Type    | Description                               |
| ---------------------- | ------- | ----------------------------------------- |
| accessControlManager\_ | address | The address of the access control manager |

***

#### setSafeDeltaBps

Sets the safe delta bps

```solidity
function setSafeDeltaBps(uint256 safeDeltaBps_) external
```

**Parameters**

| Name           | Type    | Description            |
| -------------- | ------- | ---------------------- |
| safeDeltaBps\_ | uint256 | The new safe delta bps |

**📅 Events**

* Emits SafeDeltaBpsUpdated with the old and new safe delta bps

**⛔️ Access Requirements**

* Controlled by AccessControlManager

**❌ 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

Checks if an update is safe for direct execution (no timelock required)

```solidity
function isSafeForDirectExecution(struct RiskParameterUpdate update) external view returns (bool)
```

**Parameters**

| Name   | Type                       | Description         |
| ------ | -------------------------- | ------------------- |
| update | struct RiskParameterUpdate | The update to check |

**Return Values**

| Name | Type | Description                                                                |
| ---- | ---- | -------------------------------------------------------------------------- |
| \[0] | bool | True if update is safe for direct execution, false if timelock is required |

**❌ 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

Applies a market cap update from the RiskStewardReceiver. Directly updates the market supply or borrow cap on the market's comptroller.

```solidity
function applyUpdate(struct RiskParameterUpdate update) external
```

**Parameters**

| Name   | Type                       | Description                         |
| ------ | -------------------------- | ----------------------------------- |
| update | struct RiskParameterUpdate | RiskParameterUpdate update to apply |

**📅 Events**

* Emits SupplyCapUpdated or BorrowCapUpdated depending on the update with the updateId, market and new cap

**⛔️ Access Requirements**

* Only callable by the RiskStewardReceiver

**❌ Errors**

* Throws OnlyRiskStewardReceiver if the sender is not the RiskStewardReceiver
* Throws UnsupportedUpdateType if the update type is not supported

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-v4.venus.io/technical-reference/reference-governance/market-caps-risk-steward.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
