All pages
Powered by GitBook
1 of 6

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Facets

MarketFacet

MarketFacet

This facet contract contains functions regarding markets

Solidity API

isComptroller

Indicator that this is a Comptroller contract (for inspection)


getAssetsIn

Returns the vToken markets an account has entered in the Core Pool

Parameters

Name
Type
Description

Return Values

Name
Type
Description

getAllMarkets

Return all of the markets

Return Values

Name
Type
Description

liquidateCalculateSeizeTokens

Calculate number of tokens of collateral asset to seize given an underlying amount

Parameters

Name
Type
Description

Return Values

Name
Type
Description

liquidateCalculateSeizeTokens

Calculate number of tokens of collateral asset to seize given an underlying amount

Parameters

Name
Type
Description

Return Values

Name
Type
Description

liquidateVAICalculateSeizeTokens

Calculate number of tokens of collateral asset to seize given an underlying amount

Parameters

Name
Type
Description

Return Values

Name
Type
Description

checkMembership

Returns whether the given account has entered the specified vToken market in the Core Pool

Parameters

Name
Type
Description

Return Values

Name
Type
Description

isMarketListed

Checks whether the given vToken market is listed in the Core Pool (poolId = 0)

Parameters

Name
Type
Description

Return Values

Name
Type
Description

enterMarkets

Add assets to be included in account liquidity calculation

Parameters

Name
Type
Description

Return Values

Name
Type
Description

enterMarketBehalf

Add assets to be included in account liquidity calculation

Parameters

Name
Type
Description

Return Values

Name
Type
Description

❌ Errors

  • NotAnApprovedDelegate thrown if msg.sender is not the account itself or an approved delegate


unlistMarket

Unlists the given vToken market from the Core Pool (poolId = 0) by setting isListed to false

Parameters

Name
Type
Description

Return Values

Name
Type
Description

exitMarket

Removes asset from sender's account liquidity calculation

Parameters

Name
Type
Description

Return Values

Name
Type
Description

supportMarket

Alias to _supportMarket to support the Isolated Lending Comptroller Interface

Parameters

Name
Type
Description

Return Values

Name
Type
Description

_supportMarket

Adds the given vToken market to the Core Pool (poolId = 0) and marks it as listed

Parameters

Name
Type
Description

Return Values

Name
Type
Description

updateDelegate

Grants or revokes the borrowing or redeeming delegate rights to / from an account If allowed, the delegate will be able to borrow funds on behalf of the sender Upon a delegated borrow, the delegate will receive the funds, and the borrower will see the debt on their account Upon a delegated redeem, the delegate will receive the redeemed amount and the approver will see a deduction in his vToken balance

Parameters

Name
Type
Description

enterPool

Allows a user to switch to a new pool (e.g., e-mode ).

Parameters

Name
Type
Description

📅 Events

  • PoolSelected Emitted after a successful pool switch.

❌ Errors

  • PoolDoesNotExist The specified pool ID does not exist.

  • AlreadyInSelectedPool The user is already in the target pool.

  • IncompatibleBorrowedAssets The user's current borrows are incompatible with the new pool.

  • LiquidityCheckFailed The user's liquidity is insufficient after switching pools.


createPool

Creates a new pool with the given label.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

📅 Events

  • PoolCreated Emitted after successfully creating a new pool.

❌ Errors

  • EmptyPoolLabel Reverts if the provided label is an empty string.


addPoolMarkets

Batch initializes market entries with basic config.

Parameters

Name
Type
Description

📅 Events

  • PoolMarketInitialized Emitted after successfully initializing a market in a pool.

❌ Errors

  • ArrayLengthMismatch Reverts if poolIds and vTokens arrays have different lengths or if the length is zero.

  • InvalidOperationForCorePool Reverts when attempting to call pool-specific methods on the Core Pool.

  • PoolDoesNotExist Reverts if the target pool ID does not exist.


removePoolMarket

Removes a market (vToken) from the specified pool.

Parameters

Name
Type
Description

📅 Events

  • PoolMarketRemoved Emitted after a market is successfully removed from a pool.

❌ Errors

  • InvalidOperationForCorePool Reverts if called on the Core Pool.

  • PoolMarketNotFound Reverts if the market is not listed in the pool.


getCollateralFactor

Get the core pool collateral factor for a vToken

Parameters

Name
Type
Description

Return Values

Name
Type
Description

getLiquidationThreshold

Get the core pool liquidation threshold for a vToken

Parameters

Name
Type
Description

Return Values

Name
Type
Description

getLiquidationIncentive

Get the core pool liquidation Incentive for a vToken

Parameters

Name
Type
Description

Return Values

Name
Type
Description

getEffectiveLtvFactor

Get the effective loan-to-value factor (collateral factor or liquidation threshold) for a given account and market.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

getEffectiveLiquidationIncentive

Get the Effective Liquidation Incentive for a given account and market

Parameters

Name
Type
Description

Return Values

Name
Type
Description

getPoolVTokens

Returns the full list of vTokens for a given pool ID.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

❌ Errors

  • PoolDoesNotExist Reverts if the given pool ID do not exist.

  • InvalidOperationForCorePool Reverts if called on the Core Pool.


markets

Returns the market configuration for a vToken in the core pool (poolId = 0).

Parameters

Name
Type
Description

Return Values

Name
Type
Description

poolMarkets

Returns the market configuration for a vToken from _poolMarkets.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

❌ Errors

  • PoolDoesNotExist Reverts if the given pool ID do not exist.


hasValidPoolBorrows

Returns true if the user can switch to the given target pool, i.e., all markets they have borrowed from are also borrowable in the target pool.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

InactivePool The user is trying to enter inactive pool.

MarketNotListedInCorePool Reverts if the market is not listed in the core pool.
  • MarketAlreadyListed Reverts if the given market is already listed in the specified pool.

  • InactivePool Reverts if attempted to add markets to an inactive pool.

  • liquidationIncentiveMantissa

    uint256

    The max liquidation incentive allowed for this market, in mantissa.

    marketPoolId

    uint96

    The pool ID this market belongs to.

    isBorrowAllowed

    bool

    Whether borrowing is allowed in this market.

    liquidationIncentiveMantissa

    uint256

    The liquidation incentive allowed for this market, in mantissa.

    marketPoolId

    uint96

    The pool ID this market belongs to.

    isBorrowAllowed

    bool

    Whether borrowing is allowed in this market.

    account

    address

    The address of the account to query

    [0]

    contract VToken[]

    assets A dynamic array of vToken markets the account has entered

    [0]

    contract VToken[]

    The list of market addresses

    vTokenBorrowed

    address

    The address of the borrowed vToken

    vTokenCollateral

    address

    The address of the collateral vToken

    actualRepayAmount

    uint256

    The amount of vTokenBorrowed underlying to convert into vTokenCollateral tokens

    [0]

    uint256

    (errorCode, number of vTokenCollateral tokens to be seized in a liquidation)

    [1]

    uint256

    borrower

    address

    Address of borrower whose collateral is being seized

    vTokenBorrowed

    address

    The address of the borrowed vToken

    vTokenCollateral

    address

    The address of the collateral vToken

    actualRepayAmount

    uint256

    [0]

    uint256

    (errorCode, number of vTokenCollateral tokens to be seized in a liquidation)

    [1]

    uint256

    vTokenCollateral

    address

    The address of the collateral vToken

    actualRepayAmount

    uint256

    The amount of vTokenBorrowed underlying to convert into vTokenCollateral tokens

    [0]

    uint256

    (errorCode, number of vTokenCollateral tokens to be seized in a liquidation)

    [1]

    uint256

    account

    address

    The address of the account to check

    vToken

    contract VToken

    The vToken to check

    [0]

    bool

    True if the account is in the asset, otherwise false

    vToken

    contract VToken

    The vToken Address of the market to check

    [0]

    bool

    listed True if the (Core Pool, vToken) market is listed, otherwise false

    vTokens

    address[]

    The list of addresses of the vToken markets to be enabled

    [0]

    uint256[]

    Success indicator for whether each corresponding market was entered

    onBehalf

    address

    The address of the account entering the market

    vToken

    address

    The address of the vToken market to enable for the account

    [0]

    uint256

    uint256 indicating the result (0 = success, non-zero = failure)

    market

    address

    The address of the market (vToken) to unlist

    [0]

    uint256

    uint256 0=success, otherwise a failure (See enum Error for details)

    vTokenAddress

    address

    The address of the asset to be removed

    [0]

    uint256

    Whether or not the account successfully exited the market

    vToken

    contract VToken

    The address of the market (token) to list

    [0]

    uint256

    uint256 0=success, otherwise a failure. (See enum Error for details)

    vToken

    contract VToken

    The address of the vToken market to list in the Core Pool

    [0]

    uint256

    uint256 0=success, otherwise a failure. (See enum Error for details)

    delegate

    address

    The address to update the rights for

    approved

    bool

    Whether to grant (true) or revoke (false) the borrowing or redeeming rights

    poolId

    uint96

    The ID of the pool the user wants to enter.

    label

    string

    name for the pool (must be non-empty).

    [0]

    uint96

    poolId The incremental unique identifier of the newly created pool.

    poolIds

    uint96[]

    Array of pool IDs.

    vTokens

    address[]

    Array of market (vToken) addresses.

    poolId

    uint96

    The ID of the pool from which the market should be removed.

    vToken

    address

    The address of the market token to remove.

    vToken

    address

    The address of the vToken to get the collateral factor for

    [0]

    uint256

    The collateral factor for the vToken, scaled by 1e18

    vToken

    address

    The address of the vToken to get the liquidation threshold for

    [0]

    uint256

    The liquidation threshold for the vToken, scaled by 1e18

    vToken

    address

    The address of the vToken to get the liquidation Incentive for

    [0]

    uint256

    liquidationIncentive The liquidation incentive for the vToken, scaled by 1e18

    account

    address

    The account whose pool is used to determine the market's risk parameters.

    vToken

    address

    The address of the vToken market.

    weightingStrategy

    enum WeightFunction

    The weighting strategy to use: - WeightFunction.USE_COLLATERAL_FACTOR to use collateral factor - WeightFunction.USE_LIQUIDATION_THRESHOLD to use liquidation threshold

    [0]

    uint256

    factor The effective loan-to-value factor, scaled by 1e18.

    account

    address

    The account whose pool is used to determine the market's risk parameters

    vToken

    address

    The address of the vToken market

    [0]

    uint256

    The liquidation Incentive for the vToken, scaled by 1e18

    poolId

    uint96

    The ID of the pool whose vTokens are being queried.

    [0]

    address[]

    An array of vToken addresses associated with the pool.

    vToken

    address

    The address of the vToken whose market configuration is to be fetched.

    isListed

    bool

    Whether the market is listed and enabled.

    collateralFactorMantissa

    uint256

    The maximum borrowable percentage of collateral, in mantissa.

    isVenus

    bool

    Whether this market is eligible for VENUS rewards.

    liquidationThresholdMantissa

    uint256

    poolId

    uint96

    The ID of the pool whose market configuration is being queried.

    vToken

    address

    The address of the vToken whose market configuration is to be fetched.

    isListed

    bool

    Whether the market is listed and enabled.

    collateralFactorMantissa

    uint256

    The maximum borrowable percentage of collateral, in mantissa.

    isVenus

    bool

    Whether this market is eligible for XVS rewards.

    liquidationThresholdMantissa

    uint256

    account

    address

    The address of the user attempting to switch pools.

    targetPoolId

    uint96

    The pool ID the user wants to switch into.

    [0]

    bool

    bool True if the switch is allowed, otherwise False.

    The amount of vTokenBorrowed underlying to convert into vTokenCollateral tokens

    The threshold at which liquidation is triggered, in mantissa.

    The threshold at which liquidation is triggered, in mantissa.

    function isComptroller() public pure returns (bool)
    function getAssetsIn(address account) external view returns (contract VToken[])
    function getAllMarkets() external view returns (contract VToken[])
    function liquidateCalculateSeizeTokens(address vTokenBorrowed, address vTokenCollateral, uint256 actualRepayAmount) external view returns (uint256, uint256)
    function liquidateCalculateSeizeTokens(address borrower, address vTokenBorrowed, address vTokenCollateral, uint256 actualRepayAmount) external view returns (uint256, uint256)
    function liquidateVAICalculateSeizeTokens(address vTokenCollateral, uint256 actualRepayAmount) external view returns (uint256, uint256)
    function checkMembership(address account, contract VToken vToken) external view returns (bool)
    function isMarketListed(contract VToken vToken) external view returns (bool)
    function enterMarkets(address[] vTokens) external returns (uint256[])
    function enterMarketBehalf(address onBehalf, address vToken) external returns (uint256)
    function unlistMarket(address market) external returns (uint256)
    function exitMarket(address vTokenAddress) external returns (uint256)
    function supportMarket(contract VToken vToken) external returns (uint256)
    function _supportMarket(contract VToken vToken) external returns (uint256)
    function updateDelegate(address delegate, bool approved) external
    function enterPool(uint96 poolId) external
    function createPool(string label) external returns (uint96)
    function addPoolMarkets(uint96[] poolIds, address[] vTokens) external
    function removePoolMarket(uint96 poolId, address vToken) external
    function getCollateralFactor(address vToken) external view returns (uint256)
    function getLiquidationThreshold(address vToken) external view returns (uint256)
    function getLiquidationIncentive(address vToken) external view returns (uint256)
    function getEffectiveLtvFactor(address account, address vToken, enum WeightFunction weightingStrategy) external view returns (uint256)
    function getEffectiveLiquidationIncentive(address account, address vToken) external view returns (uint256)
    function getPoolVTokens(uint96 poolId) external view returns (address[])
    function markets(address vToken) external view returns (bool isListed, uint256 collateralFactorMantissa, bool isVenus, uint256 liquidationThresholdMantissa, uint256 liquidationIncentiveMantissa, uint96 marketPoolId, bool isBorrowAllowed)
    function poolMarkets(uint96 poolId, address vToken) public view returns (bool isListed, uint256 collateralFactorMantissa, bool isVenus, uint256 liquidationThresholdMantissa, uint256 liquidationIncentiveMantissa, uint96 marketPoolId, bool isBorrowAllowed)
    function hasValidPoolBorrows(address account, uint96 targetPoolId) public view returns (bool)

    FlashLoanFacet

    FlashLoanFacet

    This facet contract contains functions for flash loan operations

    Solidity API

    executeFlashLoan

    Executes a flashLoan operation with the requested assets

    Transfers the specified assets to the receiver contract and handles repayment. Supports both full repayment and partial repayment where unpaid amounts become ongoing debt positions.

    Parameters

    Name
    Type
    Description

    param

    bytes

    The bytes passed in the executeOperation call

    onBehalf

    address payable

    The address of the user whose debt position will be created in case of partial repayment

    receiver

    address payable

    The address of the contract that will receive the flashLoan amount and execute the operation

    vTokens

    VToken[]

    The addresses of the vToken assets to be loaned

    underlyingAmounts

    uint256[]

    The amounts of each underlying assets to be loaned

    function executeFlashLoan(
        address payable onBehalf,
        address payable receiver,
        VToken[] memory vTokens,
        uint256[] memory underlyingAmounts,
        bytes memory param
    ) external

    RewardFacet

    RewardFacet

    This facet contract provides the external functions related to all claims and rewards of the protocol

    Solidity API

    claimVenus

    Claim all the xvs accrued by holder in all markets and VAI

    Parameters

    Name
    Type
    Description

    claimVenus

    Claim all the xvs accrued by holder in the specified markets

    Parameters

    Name
    Type
    Description

    claimVenus

    Claim all xvs accrued by the holders

    Parameters

    Name
    Type
    Description

    claimVenusAsCollateral

    Claim all the xvs accrued by holder in all markets, a shorthand for claimVenus with collateral set to true

    Parameters

    Name
    Type
    Description

    _grantXVS

    Transfer XVS to the recipient

    Parameters

    Name
    Type
    Description

    seizeVenus

    Seize XVS rewards allocated to holders

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    claimVenus

    Claim all xvs accrued by the holders

    Parameters

    Name
    Type
    Description

    getXVSVTokenAddress

    Returns the XVS vToken address

    Return Values

    Name
    Type
    Description

    collateral

    bool

    Whether or not to use XVS earned as collateral, only takes effect when the holder has a shortfall

    holder

    address

    The address to claim XVS for

    holder

    address

    The address to claim XVS for

    vTokens

    contract VToken[]

    The list of markets to claim XVS in

    holders

    address[]

    The addresses to claim XVS for

    vTokens

    contract VToken[]

    The list of markets to claim XVS in

    borrowers

    bool

    Whether or not to claim XVS earned by borrowing

    suppliers

    bool

    holder

    address

    The address to claim XVS for

    recipient

    address

    The address of the recipient to transfer XVS to

    amount

    uint256

    The amount of XVS to (possibly) transfer

    holders

    address[]

    Addresses of the XVS holders

    recipient

    address

    Address of the XVS token recipient

    [0]

    uint256

    The total amount of XVS tokens seized and transferred to recipient

    holders

    address[]

    The addresses to claim XVS for

    vTokens

    contract VToken[]

    The list of markets to claim XVS in

    borrowers

    bool

    Whether or not to claim XVS earned by borrowing

    suppliers

    bool

    [0]

    address

    The address of XVS vToken

    Whether or not to claim XVS earned by supplying

    Whether or not to claim XVS earned by supplying

    function claimVenus(address holder) public
    function claimVenus(address holder, contract VToken[] vTokens) public
    function claimVenus(address[] holders, contract VToken[] vTokens, bool borrowers, bool suppliers) public
    function claimVenusAsCollateral(address holder) external
    function _grantXVS(address recipient, uint256 amount) external
    function seizeVenus(address[] holders, address recipient) external returns (uint256)
    function claimVenus(address[] holders, contract VToken[] vTokens, bool borrowers, bool suppliers, bool collateral) public
    function getXVSVTokenAddress() external view returns (address)

    PolicyFacet

    PolicyFacet

    This facet contract contains all the external pre-hook functions related to vToken

    Solidity API

    mintAllowed

    Checks if the account should be allowed to mint tokens in the given market

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    mintVerify

    Validates mint, accrues interest and updates score in prime. Reverts on rejection. May emit logs.

    Parameters

    Name
    Type
    Description

    redeemAllowed

    Checks if the account should be allowed to redeem tokens in the given market

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    redeemVerify

    Validates redeem, accrues interest and updates score in prime. Reverts on rejection. May emit logs.

    Parameters

    Name
    Type
    Description

    borrowAllowed

    Checks if the account should be allowed to borrow the underlying asset of the given market

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    borrowVerify

    Validates borrow, accrues interest and updates score in prime. Reverts on rejection. May emit logs.

    Parameters

    Name
    Type
    Description

    repayBorrowAllowed

    Checks if the account should be allowed to repay a borrow in the given market

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    repayBorrowVerify

    Validates repayBorrow, accrues interest and updates score in prime. Reverts on rejection. May emit logs.

    Parameters

    Name
    Type
    Description

    liquidateBorrowAllowed

    Checks if the liquidation should be allowed to occur

    Parameters

    Name
    Type
    Description

    liquidateBorrowVerify

    Validates liquidateBorrow, accrues interest and updates score in prime. Reverts on rejection. May emit logs.

    Parameters

    Name
    Type
    Description

    seizeAllowed

    Checks if the seizing of assets should be allowed to occur

    Parameters

    Name
    Type
    Description

    seizeVerify

    Validates seize, accrues interest and updates score in prime. Reverts on rejection. May emit logs.

    Parameters

    Name
    Type
    Description

    transferAllowed

    Checks if the account should be allowed to transfer tokens in the given market

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    transferVerify

    Validates transfer, accrues interest and updates score in prime. Reverts on rejection. May emit logs.

    Parameters

    Name
    Type
    Description

    getBorrowingPower

    Alias to getAccountLiquidity to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    getAccountLiquidity

    Determine the current account liquidity wrt liquidation threshold requirements

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    getHypotheticalAccountLiquidity

    Determine what the account liquidity would be if the given amounts were redeemed/borrowed

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setVenusSpeeds

    Set XVS speed for a single market

    Parameters

    Name
    Type
    Description

    borrowerIndex

    uint256

    repayAmount

    uint256

    The amount of underlying being repaid

    actualRepayAmount

    uint256

    The amount of underlying being repaid

    seizeTokens

    uint256

    The amount of collateral token that will be seized

    seizeTokens

    uint256

    The number of collateral tokens to seize

    seizeTokens

    uint256

    The number of collateral tokens to seize

    vToken

    address

    The market to verify the mint against

    minter

    address

    The account which would get the minted tokens

    mintAmount

    uint256

    The amount of underlying being supplied to the market in exchange for tokens

    [0]

    uint256

    0 if the mint is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)

    vToken

    address

    Asset being minted

    minter

    address

    The address minting the tokens

    actualMintAmount

    uint256

    The amount of the underlying asset being minted

    mintTokens

    uint256

    vToken

    address

    The market to verify the redeem against

    redeemer

    address

    The account which would redeem the tokens

    redeemTokens

    uint256

    The number of vTokens to exchange for the underlying asset in the market

    [0]

    uint256

    0 if the redeem is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)

    vToken

    address

    Asset being redeemed

    redeemer

    address

    The address redeeming the tokens

    redeemAmount

    uint256

    The amount of the underlying asset being redeemed

    redeemTokens

    uint256

    vToken

    address

    The market to verify the borrow against

    borrower

    address

    The account which would borrow the asset

    borrowAmount

    uint256

    The amount of underlying the account would borrow

    [0]

    uint256

    0 if the borrow is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)

    vToken

    address

    Asset whose underlying is being borrowed

    borrower

    address

    The address borrowing the underlying

    borrowAmount

    uint256

    The amount of the underlying asset requested to borrow

    vToken

    address

    The market to verify the repay against

    payer

    address

    The account which would repay the asset

    borrower

    address

    The account which borrowed the asset

    repayAmount

    uint256

    [0]

    uint256

    0 if the repay is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)

    vToken

    address

    Asset being repaid

    payer

    address

    The address repaying the borrow

    borrower

    address

    The address of the borrower

    actualRepayAmount

    uint256

    vTokenBorrowed

    address

    Asset which was borrowed by the borrower

    vTokenCollateral

    address

    Asset which was used as collateral and will be seized

    liquidator

    address

    The address repaying the borrow and seizing the collateral

    borrower

    address

    vTokenBorrowed

    address

    Asset which was borrowed by the borrower

    vTokenCollateral

    address

    Asset which was used as collateral and will be seized

    liquidator

    address

    The address repaying the borrow and seizing the collateral

    borrower

    address

    vTokenCollateral

    address

    Asset which was used as collateral and will be seized

    vTokenBorrowed

    address

    Asset which was borrowed by the borrower

    liquidator

    address

    The address repaying the borrow and seizing the collateral

    borrower

    address

    vTokenCollateral

    address

    Asset which was used as collateral and will be seized

    vTokenBorrowed

    address

    Asset which was borrowed by the borrower

    liquidator

    address

    The address repaying the borrow and seizing the collateral

    borrower

    address

    vToken

    address

    The market to verify the transfer against

    src

    address

    The account which sources the tokens

    dst

    address

    The account which receives the tokens

    transferTokens

    uint256

    [0]

    uint256

    0 if the transfer is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)

    vToken

    address

    Asset being transferred

    src

    address

    The account which sources the tokens

    dst

    address

    The account which receives the tokens

    transferTokens

    uint256

    account

    address

    The account get liquidity for

    [0]

    uint256

    (possible error code (semi-opaque), account liquidity in excess of collateral requirements, account shortfall below collateral requirements)

    [1]

    uint256

    [2]

    uint256

    account

    address

    The account get liquidity for

    [0]

    uint256

    (possible error code (semi-opaque), account liquidity in excess of liquidation threshold requirements, account shortfall below liquidation threshold requirements)

    [1]

    uint256

    [2]

    uint256

    account

    address

    The account to determine liquidity for

    vTokenModify

    address

    The market to hypothetically redeem/borrow in

    redeemTokens

    uint256

    The number of tokens to hypothetically redeem

    borrowAmount

    uint256

    [0]

    uint256

    (possible error code (semi-opaque), hypothetical account liquidity in excess of collateral requirements, hypothetical account shortfall below collateral requirements)

    [1]

    uint256

    [2]

    uint256

    vTokens

    contract VToken[]

    The market whose XVS speed to update

    supplySpeeds

    uint256[]

    New XVS speed for supply

    borrowSpeeds

    uint256[]

    New XVS speed for borrow

    The number of tokens being minted

    The number of tokens being redeemed

    The amount of the underlying asset the account would repay

    The amount of underlying being repaid

    The address of the borrower

    The address of the borrower

    The address of the borrower

    The address of the borrower

    The number of vTokens to transfer

    The number of vTokens to transfer

    The amount of underlying to hypothetically borrow

    function mintAllowed(address vToken, address minter, uint256 mintAmount) external returns (uint256)
    function mintVerify(address vToken, address minter, uint256 actualMintAmount, uint256 mintTokens) external
    function redeemAllowed(address vToken, address redeemer, uint256 redeemTokens) external returns (uint256)
    function redeemVerify(address vToken, address redeemer, uint256 redeemAmount, uint256 redeemTokens) external
    function borrowAllowed(address vToken, address borrower, uint256 borrowAmount) external returns (uint256)
    function borrowVerify(address vToken, address borrower, uint256 borrowAmount) external
    function repayBorrowAllowed(address vToken, address payer, address borrower, uint256 repayAmount) external returns (uint256)
    function repayBorrowVerify(address vToken, address payer, address borrower, uint256 actualRepayAmount, uint256 borrowerIndex) external
    function liquidateBorrowAllowed(address vTokenBorrowed, address vTokenCollateral, address liquidator, address borrower, uint256 repayAmount) external view returns (uint256)
    function liquidateBorrowVerify(address vTokenBorrowed, address vTokenCollateral, address liquidator, address borrower, uint256 actualRepayAmount, uint256 seizeTokens) external
    function seizeAllowed(address vTokenCollateral, address vTokenBorrowed, address liquidator, address borrower, uint256 seizeTokens) external returns (uint256)
    function seizeVerify(address vTokenCollateral, address vTokenBorrowed, address liquidator, address borrower, uint256 seizeTokens) external
    function transferAllowed(address vToken, address src, address dst, uint256 transferTokens) external returns (uint256)
    function transferVerify(address vToken, address src, address dst, uint256 transferTokens) external
    function getBorrowingPower(address account) external view returns (uint256, uint256, uint256)
    function getAccountLiquidity(address account) external view returns (uint256, uint256, uint256)
    function getHypotheticalAccountLiquidity(address account, address vTokenModify, uint256 redeemTokens, uint256 borrowAmount) external view returns (uint256, uint256, uint256)
    function _setVenusSpeeds(contract VToken[] vTokens, uint256[] supplySpeeds, uint256[] borrowSpeeds) external

    SetterFacet

    SetterFacet

    This facet contract contains all the configurational setter functions

    Solidity API

    setPriceOracle

    Alias to _setPriceOracle to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setPriceOracle

    Sets a new price oracle for the comptroller

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setCloseFactor

    Alias to _setCloseFactor to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setCloseFactor

    Sets the closeFactor used when liquidating borrows

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setAccessControl

    Sets the address of the access control of this contract

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setCollateralFactor

    Sets the collateral factor and liquidation threshold for a market in the Core Pool only.

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setLiquidationIncentive

    Sets the liquidation incentive for a market in the Core Pool only.

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setCollateralFactor

    Sets the collateral factor and liquidation threshold for a market in the specified pool.

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setLiquidationIncentive

    Sets the liquidation incentive for a market in the specified pool.

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setLiquidatorContract

    Update the address of the liquidator contract

    Parameters

    Name
    Type
    Description

    _setPauseGuardian

    Admin function to change the Pause Guardian

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setMarketBorrowCaps

    Alias to _setMarketBorrowCaps to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    _setMarketBorrowCaps

    Set the given borrow caps for the given vToken market Borrowing that brings total borrows to or above borrow cap will revert

    Parameters

    Name
    Type
    Description

    setMarketSupplyCaps

    Alias to _setMarketSupplyCaps to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    _setMarketSupplyCaps

    Set the given supply caps for the given vToken market Supply that brings total Supply to or above supply cap will revert

    Parameters

    Name
    Type
    Description

    _setProtocolPaused

    Set whole protocol pause/unpause state

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setActionsPaused

    Alias to _setActionsPaused to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    _setActionsPaused

    Pause/unpause certain actions

    Parameters

    Name
    Type
    Description

    _setVAIController

    Sets a new VAI controller

    Return Values

    Name
    Type
    Description

    _setVAIMintRate

    Set the VAI mint rate

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setMintedVAIOf

    Set the minted VAI amount of the owner

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setTreasuryData

    Set the treasury data.

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setVenusVAIVaultRate

    Set the amount of XVS distributed per block to VAI Vault

    Parameters

    Name
    Type
    Description

    _setVAIVaultInfo

    Set the VAI Vault infos

    Parameters

    Name
    Type
    Description

    setPrimeToken

    Alias to _setPrimeToken to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setPrimeToken

    Sets the prime token contract for the comptroller

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    setForcedLiquidation

    Alias to _setForcedLiquidation to support the Isolated Lending Comptroller Interface

    Parameters

    Name
    Type
    Description

    _setForcedLiquidation

    Enables forced liquidations for a market. If forced liquidation is enabled, borrows in the market may be liquidated regardless of the account liquidity

    Parameters

    Name
    Type
    Description

    _setForcedLiquidationForUser

    Enables forced liquidations for user's borrows in a certain market. If forced liquidation is enabled, user's borrows in the market may be liquidated regardless of the account liquidity. Forced liquidation may be enabled for a user even if it is not enabled for the entire market.

    Parameters

    Name
    Type
    Description

    setWhiteListFlashLoanAccount

    Explanation: This function grants or revokes an account's permission to use the protocol's flash loan feature, enforcing access control and address validation.

    Parameters

    Name
    Type
    Description

    Return Values

    Name
    Type
    Description

    _setXVSToken

    Set the address of the XVS token

    Parameters

    Name
    Type
    Description

    _setXVSVToken

    Set the address of the XVS vToken

    Parameters

    Name
    Type
    Description

    setPoolActive

    updates active status for a specific pool (excluding the Core Pool)

    Parameters

    Name
    Type
    Description

    📅 Events

    • PoolActiveStatusUpdated Emitted after the pool active status is updated.

    ❌ Errors

    • InvalidOperationForCorePool Reverts when attempting to call pool-specific methods on the Core Pool.

    • PoolDoesNotExist Reverts if the target pool ID does not exist.


    setIsBorrowAllowed

    Updates the isBorrowAllowed flag for a market in a pool.

    Parameters

    Name
    Type
    Description

    📅 Events

    • BorrowAllowedUpdated Emitted after the borrow permission for a market is updated.

    ❌ Errors

    • PoolDoesNotExist Reverts if the pool ID is invalid.

    • MarketConfigNotFound Reverts if the market is not listed in the pool.


    newOracle

    contract ResilientOracleInterface

    The new price oracle to set

    [0]

    uint256

    uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

    newOracle

    contract ResilientOracleInterface

    The new price oracle to set

    [0]

    uint256

    uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

    newCloseFactorMantissa

    uint256

    New close factor, scaled by 1e18

    [0]

    uint256

    uint256 0=success, otherwise will revert

    newCloseFactorMantissa

    uint256

    New close factor, scaled by 1e18

    [0]

    uint256

    uint256 0=success, otherwise will revert

    newAccessControlAddress

    address

    New address for the access control

    [0]

    uint256

    uint256 0=success, otherwise will revert

    vToken

    contract VToken

    The market to set the factor on

    newCollateralFactorMantissa

    uint256

    The new collateral factor, scaled by 1e18

    newLiquidationThresholdMantissa

    uint256

    The new liquidation threshold, scaled by 1e18

    [0]

    uint256

    uint256 0=success, otherwise a failure. (See ErrorReporter for details)

    vToken

    address

    The market to set the liquidationIncentive for

    newLiquidationIncentiveMantissa

    uint256

    New liquidationIncentive scaled by 1e18

    [0]

    uint256

    uint256 0=success, otherwise a failure. (See ErrorReporter for details)

    poolId

    uint96

    The ID of the pool.

    vToken

    contract VToken

    The market to set the factor on

    newCollateralFactorMantissa

    uint256

    The new collateral factor, scaled by 1e18

    newLiquidationThresholdMantissa

    uint256

    [0]

    uint256

    uint256 0=success, otherwise a failure. (See ErrorReporter for details)

    poolId

    uint96

    The ID of the pool.

    vToken

    address

    The market to set the liquidationIncentive for

    newLiquidationIncentiveMantissa

    uint256

    New liquidationIncentive scaled by 1e18

    [0]

    uint256

    uint256 0=success, otherwise a failure. (See ErrorReporter for details)

    newLiquidatorContract_

    address

    The new address of the liquidator contract

    newPauseGuardian

    address

    The address of the new Pause Guardian

    [0]

    uint256

    uint256 0=success, otherwise a failure. (See enum Error for details)

    vTokens

    contract VToken[]

    The addresses of the markets (tokens) to change the borrow caps for

    newBorrowCaps

    uint256[]

    The new borrow cap values in underlying to be set. A value of 0 corresponds to Borrow not allowed

    vTokens

    contract VToken[]

    The addresses of the markets (tokens) to change the borrow caps for

    newBorrowCaps

    uint256[]

    The new borrow cap values in underlying to be set. A value of 0 corresponds to Borrow not allowed

    vTokens

    contract VToken[]

    The addresses of the markets (tokens) to change the supply caps for

    newSupplyCaps

    uint256[]

    The new supply cap values in underlying to be set. A value of 0 corresponds to Minting NotAllowed

    vTokens

    contract VToken[]

    The addresses of the markets (tokens) to change the supply caps for

    newSupplyCaps

    uint256[]

    The new supply cap values in underlying to be set. A value of 0 corresponds to Minting NotAllowed

    state

    bool

    The new state (true=paused, false=unpaused)

    [0]

    bool

    bool The updated state of the protocol

    markets_

    address[]

    Markets to pause/unpause the actions on

    actions_

    enum Action[]

    List of action ids to pause/unpause

    paused_

    bool

    The new paused state (true=paused, false=unpaused)

    markets_

    address[]

    Markets to pause/unpause the actions on

    actions_

    enum Action[]

    List of action ids to pause/unpause

    paused_

    bool

    The new paused state (true=paused, false=unpaused)

    [0]

    uint256

    uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

    newVAIMintRate

    uint256

    The new VAI mint rate to be set

    [0]

    uint256

    uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

    owner

    address

    The address of the account to set

    amount

    uint256

    The amount of VAI to set to the account

    [0]

    uint256

    The number of minted VAI by owner

    newTreasuryGuardian

    address

    The new address of the treasury guardian to be set

    newTreasuryAddress

    address

    The new address of the treasury to be set

    newTreasuryPercent

    uint256

    The new treasury percent to be set

    [0]

    uint256

    uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

    venusVAIVaultRate_

    uint256

    The amount of XVS wei per block to distribute to VAI Vault

    vault_

    address

    The address of the VAI Vault

    releaseStartBlock_

    uint256

    The start block of release to VAI Vault

    minReleaseAmount_

    uint256

    The minimum release amount to VAI Vault

    _prime

    contract IPrime

    The new prime token contract to be set

    [0]

    uint256

    uint 0=success, otherwise a failure (see ErrorReporter.sol for details)

    _prime

    contract IPrime

    The new prime token contract to be set

    [0]

    uint256

    uint 0=success, otherwise a failure (see ErrorReporter.sol for details)

    vTokenBorrowed

    address

    Borrowed vToken

    enable

    bool

    Whether to enable forced liquidations

    vTokenBorrowed

    address

    Borrowed vToken

    enable

    bool

    Whether to enable forced liquidations

    borrower

    address

    The address of the borrower

    vTokenBorrowed

    address

    Borrowed vToken

    enable

    bool

    Whether to enable forced liquidations

    account

    address

    The account to whitelist or remove

    _isWhiteListed

    bool

    True to whitelist, false to remove

    None

    xvs_

    address

    The address of the XVS token

    xvsVToken_

    address

    The address of the XVS vToken

    poolId

    uint96

    id of the pool to update

    active

    bool

    true to enable, false to disable

    poolId

    uint96

    The ID of the pool.

    vToken

    address

    The address of the market (vToken).

    borrowAllowed

    bool

    The new borrow allowed status.

    The new liquidation threshold, scaled by 1e18

    function setPriceOracle(contract ResilientOracleInterface newOracle) external returns (uint256)
    function _setPriceOracle(contract ResilientOracleInterface newOracle) external returns (uint256)
    function setCloseFactor(uint256 newCloseFactorMantissa) external returns (uint256)
    function _setCloseFactor(uint256 newCloseFactorMantissa) external returns (uint256)
    function _setAccessControl(address newAccessControlAddress) external returns (uint256)
    function setCollateralFactor(contract VToken vToken, uint256 newCollateralFactorMantissa, uint256 newLiquidationThresholdMantissa) external returns (uint256)
    function setLiquidationIncentive(address vToken, uint256 newLiquidationIncentiveMantissa) external returns (uint256)
    function setCollateralFactor(uint96 poolId, contract VToken vToken, uint256 newCollateralFactorMantissa, uint256 newLiquidationThresholdMantissa) external returns (uint256)
    function setLiquidationIncentive(uint96 poolId, address vToken, uint256 newLiquidationIncentiveMantissa) external returns (uint256)
    function _setLiquidatorContract(address newLiquidatorContract_) external
    function _setPauseGuardian(address newPauseGuardian) external returns (uint256)
    function setMarketBorrowCaps(contract VToken[] vTokens, uint256[] newBorrowCaps) external
    function _setMarketBorrowCaps(contract VToken[] vTokens, uint256[] newBorrowCaps) external
    function setMarketSupplyCaps(contract VToken[] vTokens, uint256[] newSupplyCaps) external
    function _setMarketSupplyCaps(contract VToken[] vTokens, uint256[] newSupplyCaps) external
    function _setProtocolPaused(bool state) external returns (bool)
    function setActionsPaused(address[] markets_, enum Action[] actions_, bool paused_) external
    function _setActionsPaused(address[] markets_, enum Action[] actions_, bool paused_) external
    function _setVAIController(contract VAIControllerInterface vaiController_) external returns (uint256)
    function _setVAIMintRate(uint256 newVAIMintRate) external returns (uint256)
    function setMintedVAIOf(address owner, uint256 amount) external returns (uint256)
    function _setTreasuryData(address newTreasuryGuardian, address newTreasuryAddress, uint256 newTreasuryPercent) external returns (uint256)
    function _setVenusVAIVaultRate(uint256 venusVAIVaultRate_) external
    function _setVAIVaultInfo(address vault_, uint256 releaseStartBlock_, uint256 minReleaseAmount_) external
    function setPrimeToken(contract IPrime _prime) external returns (uint256)
    function _setPrimeToken(contract IPrime _prime) external returns (uint256)
    function setForcedLiquidation(address vTokenBorrowed, bool enable) external
    function _setForcedLiquidation(address vTokenBorrowed, bool enable) external
    function _setForcedLiquidationForUser(address borrower, address vTokenBorrowed, bool enable) external
    function setWhiteListFlashLoanAccount(address account, bool _isWhiteListed) external 
    function _setXVSToken(address xvs_) external
    function _setXVSVToken(address xvsVToken_) external
    function setPoolActive(uint96 poolId, bool active) external
    function setIsBorrowAllowed(uint96 poolId, address vToken, bool borrowAllowed) external