# ComptrollerStorage

## ComptrollerStorage

Storage layout for the `Comptroller` contract.

## Solidity API

```solidity
struct LiquidationOrder {
  contract VToken vTokenCollateral;
  contract VToken vTokenBorrowed;
  uint256 repayAmount;
}
```

```solidity
struct AccountLiquiditySnapshot {
  uint256 totalCollateral;
  uint256 weightedCollateral;
  uint256 borrows;
  uint256 effects;
  uint256 liquidity;
  uint256 shortfall;
}
```

```solidity
struct RewardSpeeds {
  address rewardToken;
  uint256 supplySpeed;
  uint256 borrowSpeed;
}
```

```solidity
struct Market {
  bool isListed;
  uint256 collateralFactorMantissa;
  uint256 liquidationThresholdMantissa;
  mapping(address => bool) accountMembership;
}
```

```solidity
enum Action {
  MINT,
  REDEEM,
  BORROW,
  REPAY,
  SEIZE,
  LIQUIDATE,
  TRANSFER,
  ENTER_MARKET,
  EXIT_MARKET
}
```

#### oracle

Oracle which gives the price of any given asset

```solidity
contract ResilientOracleInterface oracle
```

***

#### closeFactorMantissa

Multiplier used to calculate the maximum repayAmount when liquidating a borrow

```solidity
uint256 closeFactorMantissa
```

***

#### liquidationIncentiveMantissa

Multiplier representing the discount on collateral that a liquidator receives

```solidity
uint256 liquidationIncentiveMantissa
```

***

#### accountAssets

Per-account mapping of "assets you are in"

```solidity
mapping(address => contract VToken[]) accountAssets
```

***

#### markets

Official mapping of vTokens -> Market metadata

```solidity
mapping(address => struct ComptrollerStorage.Market) markets
```

***

#### allMarkets

A list of all markets

```solidity
contract VToken[] allMarkets
```

***

#### borrowCaps

Borrow caps enforced by borrowAllowed for each vToken address. Defaults to zero which restricts borrowing.

```solidity
mapping(address => uint256) borrowCaps
```

***

#### minLiquidatableCollateral

Minimal collateral required for regular (non-batch) liquidations

```solidity
uint256 minLiquidatableCollateral
```

***

#### supplyCaps

Supply caps enforced by mintAllowed for each vToken address. Defaults to zero which corresponds to minting not allowed

```solidity
mapping(address => uint256) supplyCaps
```

***

#### isForcedLiquidationEnabled

Flag indicating whether forced liquidation enabled for a market

```solidity
mapping(address => bool) isForcedLiquidationEnabled
```

***

#### prime

Prime token address

```solidity
contract IPrime prime
```

***

#### approvedDelegates

Whether the delegate is allowed to borrow or redeem on behalf of the user

```solidity
mapping(address => mapping(address => bool)) approvedDelegates
```

***


---

# Agent Instructions: 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:

```
GET https://docs-v4.venus.io/technical-reference/reference-isolated-pools/comptroller/comptroller-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
