### User Reward Calculation Example Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/whats-new/prime-yield.md An example demonstrating the calculation of user rewards and APY increase based on specific model and user parameters. ```latex Rewards_{i, BTC} = 8\times 0.2\times \dfrac{1,200^{0.5}\times 2,500^{0.5}}{744,164} ``` ```latex Rewards_{i, BTC} = \ 0.00372 ``` ```latex \text{User APY Increase} = \dfrac{0.00372}{0.097} = 3.88\% ``` -------------------------------- ### _initiate Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-governance/governor-bravo-delegate.md Initializes the GovernorBravo contract, setting the starting point for proposal IDs. ```APIDOC ## _initiate ### Description Initiate the GovernorBravo contract. ### Method `external` ### Parameters #### Path Parameters - **governorAlpha** (address) - Required - The address for the Governor to continue the proposal id count from. ``` -------------------------------- ### Prime Rewards Score Calculation Example Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/prime.md Example demonstrating how the user's score is impacted by the 'alpha' parameter, which adjusts the weight between stake contributions and supply/borrow contributions. ```jsx User A: Stake: 200 Supply/Borrow: 500 User B: Stake: 100 Supply/Borrow: 1000 If alpha is 0.7 then: user A score: 263.2764409 user B score: 199.5262315 If alpha is 0.3 then: user A score: 379.8288965 user B score: 501.1872336 ``` -------------------------------- ### last24HourReceiveWindowStart Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-governance/base-omnichain-controller-dest.md Retrieves the timestamp when the last 24-hour window started for receiving commands from Binance chain. ```APIDOC ## last24HourReceiveWindowStart ### Description Timestamp when the last 24-hour window started from Binance chain. ### Type `uint256` ``` -------------------------------- ### Get Start Bid Bps Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/shortfall-and-auctions.md Reads the minimum bid basis points (bps) required to start an auction for a specific comptroller. ```solidity auctions[comptrollerAddress].startBidBps ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/liquidation-adapter.md Initializes the liquidation adapter proxy with essential controller and configuration addresses. ```APIDOC ## initialize ### Description Initializes the adapter proxy with the VaultController, protocol liquidation share, close factor, and Access Control Manager (ACM) addresses. ### Method `initialize(address vaultController_, uint256 protocolLiquidationShare_, uint256 closeFactor_, address acm_) ### Parameters #### Path Parameters - `vaultController_` (address) - VaultController address. - `protocolLiquidationShare_` (uint256) - Initial protocol share of incentive (mantissa). - `closeFactor_` (uint256) - Initial close factor (mantissa). - `acm_` (address) - Venus AccessControlManager address. ### Response #### Success Response (200) - Initializes the contract state. ``` -------------------------------- ### Get Auction Start Block Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/shortfall-and-auctions.md Retrieves the block number at which a specific auction was initiated. ```solidity auctions[comptrollerAddress].startBlock ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/prime/prime.md Initializes the Prime module, setting up essential parameters and contract addresses. ```APIDOC ## initialize ### Description Prime initializer. ### Method `external` ### Parameters #### Path Parameters - **xvsVault_** (address) - Required - Address of XVSVault - **xvsVaultRewardToken_** (address) - Required - Address of XVSVault reward token - **xvsVaultPoolId_** (uint256) - Required - Pool id of XVSVault - **alphaNumerator_** (uint128) - Required - numerator of alpha. If alpha is 0.5 then numerator is 1. alphaDenominator_ must be greater than alphaNumerator_, alphaDenominator_ cannot be zero and alphaNumerator_ cannot be zero - **alphaDenominator_** (uint128) - Required - denominator of alpha. If alpha is 0.5 then denominator is 2. alpha is alphaNumerator_/alphaDenominator_. So, 0 < alpha < 1 - **accessControlManager_** (address) - Required - Address of AccessControlManager - **primeLiquidityProvider_** (address) - Required - Address of PrimeLiquidityProvider - **comptroller_** (address) - Required - Address of Comptroller - **oracle_** (address) - Required - Address of Oracle - **loopsLimit_** (uint256) - Required - Maximum number of loops allowed in a single transaction #### Errors * Throw InvalidAddress if any of the address is invalid ``` -------------------------------- ### Liquidation Path Example Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/deviation-bounded-oracle.md Illustrates the sequence of calls for the liquidation path, starting from the Liquidator and ending with the ResilientOracle. ```text Liquidator → Comptroller (USE_LIQUIDATION_THRESHOLD) → ComptrollerLens → ResilientOracle.getUnderlyingPrice(...) ``` -------------------------------- ### Constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/slis-bnb-oracle.md Initializes the implementation contract with addresses for StakeManager, slisBNB, and ResilientOracle. ```solidity constructor(address stakeManager, address slisBNB, address resilientOracle) public ``` -------------------------------- ### Initiate Governor Contract Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-governance/governor-bravo-delegate.md Initializes the GovernorBravo contract. This function should be called once to set the starting point for proposal IDs from GovernorAlpha. ```solidity function _initiate(address governorAlpha) external ``` -------------------------------- ### Get Underlying Prices for Multiple vTokens Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/venus-lens.md Queries the underlying price for an array of vTokens. This is an efficient way to get prices for multiple assets at once. ```solidity function vTokenUnderlyingPriceAll(contract VToken[] vTokens) external view returns (struct VenusLens.VTokenUnderlyingPrice[]) ``` -------------------------------- ### State Variable: last24HourReceiveWindowStart Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-governance/base-omnichain-controller-dest.md Stores the timestamp indicating the start of the last 24-hour window for command reception from Binance chain. This is a state variable. ```solidity uint256 last24HourReceiveWindowStart ``` -------------------------------- ### Core Pool Collateral Factor Setter Example Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/emode.md An example of a governance function to set collateral factor and liquidation threshold for the Core Pool. ```Solidity function setCollateralFactor(VToken vToken, uint256 newCollateralFactorMantissa, uint256 newLiquidationThresholdMantissa) external returns (uint256); ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/deviation-sentinel.md Wires the Access Control Manager. Called once on the proxy after deployment. ```APIDOC ## initialize ```solidity function initialize(address accessControlManager_) external initializer ``` Wires the Access Control Manager. Called once on the proxy after deployment. ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/relative-position-manager.md Initializes a new position account clone by setting the owner and the long and short vToken addresses. ```APIDOC ## initialize Initializes a new position account clone. ### Signature ```solidity function initialize(address owner_, address longVToken_, address shortVToken_) external ``` ### Parameters - **owner_** (address) - Address of the position account owner. - **longVToken_** (address) - Address of the long market vToken. - **shortVToken_** (address) - Address of the short market vToken. ### Errors - ZeroAddress if any of the addresses is zero. ``` -------------------------------- ### E-Mode Collateral Factor Setter Example Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/emode.md An example of a governance function to set collateral factor and liquidation threshold for a specific E-Mode pool. ```Solidity function setCollateralFactor(uint96 poolId, VToken vToken, uint256 newCollateralFactorMantissa, uint256 newLiquidationThresholdMantissa) external returns (uint256); ``` -------------------------------- ### Chain ID to Last 24 Hour Window Start Mapping Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-governance/base-omnichain-controller-src.md Records the timestamp when the last 24-hour command window started for each originating chain ID. ```solidity mapping(uint16 => uint256) chainIdToLast24HourWindowStart ``` -------------------------------- ### constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/sfrx-ethoracle.md Initializes the implementation contract with oracle and sfrxETH addresses. ```APIDOC ## constructor ### Description Constructor for the implementation contract. ### Parameters * `_sfrxEthFraxOracle` (address) - Address of the SfrxEthFraxOracle. * `_sfrxETH` (address) - Address of the sfrxETH token. ### Errors * `ZeroAddressNotAllowed` is thrown when `_sfrxEthFraxOracle` or `_sfrxETH` are the zero address. ``` -------------------------------- ### Initialize Liquidation Adapter Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/liquidation-adapter.md Initializes the adapter proxy with essential configuration parameters. This function must be called once after deployment. ```Solidity function initialize( address vaultController_, uint256 protocolLiquidationShare_, uint256 closeFactor_, address acm_ ) external initializer; ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/vtoken.md Initializes the money market with the provided parameters. ```APIDOC ## initialize ### Description Initialize the money market. ### Method `public` ### Parameters #### Path Parameters - **comptroller_** (contract ComptrollerInterface) - Required - The address of the Comptroller - **interestRateModel_** (contract InterestRateModelV8) - Required - The address of the interest rate model - **initialExchangeRateMantissa_** (uint256) - Required - The initial exchange rate, scaled by 1e18 - **name_** (string) - Required - EIP-20 name of this token - **symbol_** (string) - Required - EIP-20 symbol of this token - **decimals_** (uint8) - Required - EIP-20 decimal precision of this token ``` -------------------------------- ### Solidity: Last 24 Hour Receive Window Start Mapping Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-xvs-bridge/BaseXVSProxyOFT.md Records the timestamp when the last 24-hour window started for receiving transactions from a remote chain, indexed by chain ID. ```solidity mapping(uint16 => uint256) chainIdToLast24HourReceiveWindowStart ``` -------------------------------- ### Solidity multicall Typical Call Structure Example Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/swap-helper.md This example shows how to structure the 'calls' array for a typical swap operation using multicall, including approving tokens, performing a generic swap, and sweeping the output token. ```solidity calls = [ abi.encodeCall(SwapHelper.approveMax, (tokenIn, dexRouter)), abi.encodeCall(SwapHelper.genericCall, (dexRouter, swapCalldata)), abi.encodeCall(SwapHelper.sweep, (tokenOut, recipient)) ] ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/liquidator.md Initializes the implementation contract with treasury share, access control manager, and protocol share reserve addresses. ```APIDOC ## initialize ### Description Initializer for the implementation contract. ### Parameters #### Path Parameters - **treasuryPercentMantissa_** (uint256) - Required - Treasury share, scaled by 1e18 (e.g. 0.2 * 1e18 for 20%) - **accessControlManager_** (address) - Required - address of access control manager - **protocolShareReserve_** (address) - Required - The address of the protocol share reserve contract ``` -------------------------------- ### state Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-governance/omnichain-governance-executor.md Gets the state of a proposal by its ID. ```APIDOC ## state ### Description Gets the state of a proposal. ### Method `view` ### Parameters #### Path Parameters - **proposalId_** (uint256) - Required - The id of the proposal ### Response #### Success Response - **[0]** (enum OmnichainGovernanceExecutor.ProposalState) - Proposal state ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/core-pool/liquidator.md Initializer for the implementation contract. ```APIDOC ## initialize treasuryPercentMantissa: uint256 Initializer for the implementation contract. ### Parameters - treasuryPercentMantissa_ (uint256): Treasury share, scaled by 1e18 (e.g. 0.2 * 1e18 for 20%) ``` -------------------------------- ### Place Bid Signature Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/shortfall-and-auctions.md Submit a bid for an ongoing auction. The first bid must be placed within 100 blocks of the auction's start. Requires the comptroller address, bid in basis points (Bps), and the auction start block number. ```Solidity auctions[comptrollerAddress].startBidBps placeBid(comptrollerAddress, bidBps, auctionStartBlock) ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/risk-fund-and-shortfall/shortfall.md Initializes the shortfall contract with the RiskFund, minimum bad debt threshold, and access control manager. ```APIDOC ## initialize Initialize the shortfall contract ### Method `initialize(contract IRiskFund riskFund_, uint256 minimumPoolBadDebt_, address accessControlManager_)` ### Parameters #### Path Parameters - **riskFund_** (contract IRiskFund) - Required - RiskFund contract address - **minimumPoolBadDebt_** (uint256) - Required - Minimum bad debt in base asset for a pool to start auction - **accessControlManager_** (address) - Required - AccessControlManager contract address ### Errors - ZeroAddressNotAllowed is thrown when convertible base asset address is zero - ZeroAddressNotAllowed is thrown when risk fund address is zero ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/institutional-vault-controller.md Initializes the controller proxy with essential addresses for vault operations and risk management. ```APIDOC ## initialize ### Description Initializes the controller proxy with essential addresses for vault operations and risk management. ### Method `external initializer` ### Parameters #### Path Parameters - **vaultImplementation_** (address) - Required - InstitutionalLoanVault implementation for cloning. - **oracle_** (address) - Required - Venus ResilientOracle address. - **protocolShareReserve_** (address) - Required - PSR address. - **comptroller_** (address) - Required - Comptroller address for PSR. - **treasury_** (address) - Required - Treasury address — recipient for swept tokens. - **positionToken_** (address) - Required - InstitutionPositionToken address. - **acm_** (address) - Required - Venus AccessControlManager address. ### Request Example ```json { "vaultImplementation_": "0x...", "oracle_": "0x...", "protocolShareReserve_": "0x...", "comptroller_": "0x...", "treasury_": "0x...", "positionToken_": "0x...", "acm_": "0x..." } ``` ### Response #### Success Response (200) - **void** - Initialization successful. ``` -------------------------------- ### vTokenUnderlyingPrice Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/venus-lens.md Gets the price for the underlying asset of a given vToken. ```APIDOC ## vTokenUnderlyingPrice ### Description Get the price for the underlying asset of a vToken. ### Method `vTokenUnderlyingPrice` ### Parameters #### Path Parameters - **vToken** (contract VToken) - Required - address of the vToken ### Response #### Success Response - **[0]** (struct VenusLens.VTokenUnderlyingPrice) - response struct with underlyingPrice info of vToken ``` -------------------------------- ### Initialize SfrxEthFraxOracle Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/sfrx-ethoracle.md Sets the access control manager and the maximum allowed price difference for the oracle. Throws ZeroValueNotAllowed if _maxAllowedPriceDifference is zero. ```solidity function initialize(address _accessControlManager, uint256 _maxAllowedPriceDifference) external ``` -------------------------------- ### Get Balance Of Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/vtoken.md Returns the token balance for a specified owner address. ```Solidity function balanceOf(address owner) external view returns (uint256) ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/oracles/binance-oracle.md Initializes the Binance Oracle contract by setting the addresses for the SID registry and the access control manager. ```APIDOC ## initialize ### Description Initializes the contracts required to fetch prices. ### Method external ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None #### Parameters - **_sidRegistryAddress** (address) - Required - Address of SID registry - **_accessControlManager** (address) - Required - Address of the access control manager contract ``` -------------------------------- ### Auction Status Enum Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/risk-fund-and-shortfall/shortfall.md Defines the possible statuses for an auction: NOT_STARTED, STARTED, and ENDED. ```Solidity enum AuctionStatus { NOT_STARTED, STARTED, ENDED } ``` -------------------------------- ### Solidity: initialize Function Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/oracles/binance-oracle.md Sets the contracts required to fetch prices. Requires the addresses of the SID registry and the access control manager. ```solidity function initialize(address _sidRegistryAddress, address _accessControlManager) external ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/sfrx-ethoracle.md Sets the contracts required to fetch prices, including the access control manager and maximum allowed price difference. ```APIDOC ## initialize ### Description Sets the contracts required to fetch prices. ### Parameters * `_accessControlManager` (address) - Address of the access control manager contract. * `_maxAllowedPriceDifference` (uint256) - Maximum allowed price difference. ### Errors * `ZeroValueNotAllowed` is thrown if `_maxAllowedPriceDifference` is zero. ``` -------------------------------- ### stakedAt Mapping Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/prime/prime-storage.md Tracks the timestamp when prime token eligible users started staking. ```Solidity mapping(address => uint256) stakedAt ``` -------------------------------- ### getVAIRepayRate Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/tokens/vai-controller.md Gets the yearly VAI interest rate based on the current VAI price. ```APIDOC ## getVAIRepayRate ### Description Gets yearly VAI interest rate based on the VAI price. ### Method VIEW ### Endpoint getVAIRepayRate() ### Response #### Success Response - **[0]** (uint256) - Yearly VAI interest rate ``` -------------------------------- ### Constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/liquidation-adapter.md Initializes the Liquidation Adapter contract. This function is part of the contract's deployment. ```Solidity constructor(); ``` -------------------------------- ### Get Underlying Token of a Market Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/shortfall-and-auctions.md Retrieves the underlying token address for a given market. ```solidity underlying() ``` -------------------------------- ### Set Token Configuration Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/deviation-bounded-oracle.md Initializes protection for a new asset by seeding the rolling window with the current spot price. Participation in whitelist is independent of initialization. ```Solidity function setTokenConfig(struct IDeviationBoundedOracle.TokenConfigInput tokenConfig_) external ``` -------------------------------- ### Liquidator Initialize Function Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/core-pool/liquidator.md Initializes the implementation contract for the Liquidator. Sets the treasury share percentage. ```Solidity function initialize(uint256 treasuryPercentMantissa_) external virtual ``` -------------------------------- ### Get Initialized Assets Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/deviation-bounded-oracle.md Returns an array of all asset addresses that have ever been initialized in the oracle. ```solidity function getInitializedAssets() external view returns (address[]) ``` -------------------------------- ### Market Mapping: Previous Implementation Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/emode.md Illustrates the previous approach to market mapping using the vToken address as the direct index. ```Solidity mapping(address => Market) public markets; ``` -------------------------------- ### Get wstETH Price Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/wst-ETH-oracle.md Retrieves the USD price of wstETH. The price is scaled by 1e18. ```solidity function getPrice(address asset) public view returns (uint256) ``` -------------------------------- ### Get Institutional Configuration Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/institutional-loan-vault.md Retrieves the institutional-specific configuration settings. Returns an InstitutionalConfig struct. ```Solidity function institutionalConfig() external view returns (InstitutionalConfig memory); ``` -------------------------------- ### addPoolMarkets Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/comptroller/diamond/facets/market-facet.md Batch initializes market entries with basic configuration for specified pools and vTokens. ```APIDOC ## addPoolMarkets ### Description Batch initializes market entries with basic config. ### Method `external` ### Signature `function addPoolMarkets(uint96[] poolIds, address[] vTokens) external` ### Parameters #### Path Parameters - **poolIds** (uint96[]) - Required - Array of pool IDs. - **vTokens** (address[]) - Required - Array of market (vToken) addresses. ### 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. - **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. ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/relative-position-manager.md Initializes the upgradeable contract with the Access Control Manager address. ```APIDOC ## initialize Initializes the upgradeable contract ```solidity function initialize(address accessControlManager_) external ``` ### Parameters | Name | Type | Description | | ---------------------- | ------- | ---------------------------------------------- | | accessControlManager_ | address | Address of the Access Control Manager contract | ``` -------------------------------- ### Get All Pools Function Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/pool-registry/pool-registry.md Retrieves an array containing the data for all registered Venus pools. ```solidity function getAllPools() external view returns (struct PoolRegistryInterface.VenusPool[]) ``` -------------------------------- ### Initialize Position Account Clone Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/relative-position-manager.md Initializes a new position account clone with the owner and market vToken addresses. Ensure no zero addresses are provided. ```Solidity function initialize(address owner_, address longVToken_, address shortVToken_) external ``` -------------------------------- ### Get Total Deployed Vaults Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/institutional-vault-controller.md Returns the total number of vaults that have been deployed and registered. ```Solidity function allVaultsLength() external view returns (uint256); ``` -------------------------------- ### Initialize Contract Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-governance/omnichain-executor-owner.md Initializes the contract with the provided access control manager address. ```solidity function initialize(address accessControlManager_) external ``` -------------------------------- ### Get Pool Length Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/vaults/xvs/xvs-vault.md Returns the number of pools associated with a specific reward token. ```solidity function poolLength(address rewardToken) external view returns (uint256) ``` -------------------------------- ### vTokenMetadataAll Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/venus-lens.md Get VTokenMetadata for an array of vToken addresses. Returns an array of VTokenMetadata structs. ```APIDOC ## vTokenMetadataAll ### Description Get VTokenMetadata for an array of vToken addresses. ### Method `vTokenMetadataAll` ### Parameters #### Path Parameters - **vTokens** (contract VToken[]) - Required - Array of vToken addresses to fetch VTokenMetadata ### Return Values #### Success Response - **Array of VTokenMetadata structs** - Each struct contains vToken supply and borrow information. ``` -------------------------------- ### initialize Function Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/oracles/PythOracle.md Initializes the contract owner and sets required contract addresses. Requires the addresses for the Pyth oracle and the access control manager. ```solidity function initialize(address underlyingPythOracle_, address accessControlManager_) external ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/psm/peg-stability.md Initializes the PSM contract with necessary parameters. This function should be called once via a proxy contract. ```APIDOC ## initialize ### Description Initializes the contract via Proxy Contract with the required parameters. ### Method `initialize(address accessControlManager_, address venusTreasury_, address oracleAddress_, uint256 feeIn_, uint256 feeOut_, uint256 vaiMintCap_) ### Parameters #### Path Parameters - **accessControlManager_** (address) - Required - The address of the AccessControlManager contract. - **venusTreasury_** (address) - Required - The address where fees will be sent. - **oracleAddress_** (address) - Required - The address of the ResilientOracle contract. - **feeIn_** (uint256) - Required - The percentage of fees to be applied to a stablecoin -> VAI swap. - **feeOut_** (uint256) - Required - The percentage of fees to be applied to a VAI -> stablecoin swap. - **vaiMintCap_** (uint256) - Required - The cap for the total amount of VAI that can be minted. ``` -------------------------------- ### Get All Proposals Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/services/api.md Retrieves a list of all governance proposals. This endpoint is part of the Governance group. ```json { "path": "/governance/proposals", "method": "get" } ``` -------------------------------- ### alphaDenominator State Variable Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/prime/prime-storage.md The denominator of the alpha value. For example, if alpha is 0.5, this will be 2. ```Solidity uint128 alphaDenominator ``` -------------------------------- ### WhitePaperInterestRateModel Constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/interestratemodels/whitepapermodel.md Initializes the interest rate model with target base APR and multiplier. ```Solidity constructor(uint256 baseRatePerYear, uint256 multiplierPerYear) public ``` -------------------------------- ### Opening a Leveraged Position Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-technical-articles/trade.md Use `enterLeverage` to open a new leveraged position. This involves a flash loan, a swap, minting collateral, and repaying the loan. ```solidity positionAccount.enterLeverage( collateralMarket = longVToken, collateralAmountSeed = 0, // DSA is the true collateral seed, not long borrowedMarket = shortVToken, borrowedAmountToFlashLoan = shortAmount, minAmountOutAfterSwap = minLongAmount, swapData = signedMulticallData ) LeverageStrategiesManager: 1. Flash loan shortAmount on shortVToken 2. Swap shortAmount (short) → longAmount (long) using swapData 3. Mint longAmount into positionAccount.longVToken position 4. Repay flash loan from positionAccount.shortVToken (opens borrow) ``` -------------------------------- ### alphaNumerator State Variable Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/prime/prime-storage.md The numerator of the alpha value. For example, if alpha is 0.5, this will be 1. ```Solidity uint128 alphaNumerator ``` -------------------------------- ### constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/relative-position-manager.md Initializes a new PositionAccount implementation contract. It sets the addresses for the Venus Comptroller, RelativePositionManager, and LeverageStrategiesManager. ```APIDOC ## constructor Constructor for the PositionAccount implementation contract. ### Signature ```solidity constructor(contract IComptroller comptroller_, address relativePositionManager_, address leverageManager_) public ``` ### Parameters - **comptroller_** (contract IComptroller) - The Venus comptroller contract address. - **relativePositionManager_** (address) - Address of the RelativePositionManager contract. - **leverageManager_** (address) - Address of the LeverageStrategiesManager contract. ### Errors - ZeroAddress if any of the addresses is zero. ``` -------------------------------- ### Constructor for SfrxEthFraxOracle Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/sfrx-ethoracle.md Initializes the implementation contract with the addresses of the sfrxEthFraxOracle and sfrxETH. ```solidity constructor(address _sfrxEthFraxOracle, address _sfrxETH) public ``` -------------------------------- ### InstitutionPositionToken State Variable: nextTokenId Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/institution-position-token.md Stores the counter for auto-incrementing token IDs, starting from 1. ```Solidity uint256 public nextTokenId ``` -------------------------------- ### SlisBNBOracle Constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/as-bnb-oracle.md Initializes the SlisBNBOracle implementation contract. Requires addresses for asBNB, slisBNB, and the resilientOracle. ```solidity constructor(address asBNB, address slisBNB, address resilientOracle) public ``` -------------------------------- ### Get Metadata for All VTokens Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/lens/pool-lens.md Retrieves the metadata for a list of VTokens. Requires an array of VToken addresses. ```solidity function vTokenMetadataAll(contract VToken[] vTokens) public view returns (struct PoolLens.VTokenMetadata[]) ``` -------------------------------- ### Get VToken Metadata Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/lens/pool-lens.md Retrieves the metadata for a single VToken. Requires the address of the VToken contract. ```solidity function vTokenMetadata(contract VToken vToken) public view returns (struct PoolLens.VTokenMetadata) ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/resilient-oracle.md Initializes the contract admin and sets the BoundValidator contract address. ```APIDOC ## initialize ### Description Initializes the contract admin and sets the BoundValidator contract address ### Method initialize ### Parameters #### Parameters - **accessControlManager_** (address) - Address of the access control manager contract ``` -------------------------------- ### Get Risk Configuration Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/institutional-loan-vault.md Retrieves the risk configuration parameters for the vault. Returns a RiskConfig struct. ```Solidity function riskConfig() external view returns (RiskConfig memory); ``` -------------------------------- ### constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/native-token-gateway/native-token-gateway.md Initializes the NativeTokenGateway contract with the address of the wrapped native token market. ```APIDOC ## constructor ### Description Constructor for NativeTokenGateway ### Method constructor(contract IVToken vWrappedNativeToken) public ### Parameters #### Path Parameters - **vWrappedNativeToken** (contract IVToken) - Required - Address of wrapped native token market ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/prime/prime-liquidity-provider.md Initializes the PrimeLiquidityProvider contract with access control, token addresses, distribution speeds, max distribution speeds, and a loop limit. ```APIDOC ## initialize ### Description PrimeLiquidityProvider initializer. ### Method external ### Parameters #### Path Parameters * **accessControlManager_** (address) - Required - AccessControlManager contract address * **tokens_** (address[]) - Required - Array of addresses of the tokens * **distributionSpeeds_** (uint256[]) - Required - New distribution speeds for tokens * **maxDistributionSpeeds_** (uint256[]) - Required - * **loopsLimit_** (uint256) - Required - Maximum number of loops allowed in a single transaction ### Errors * Throw InvalidArguments on different length of tokens and speeds array ``` -------------------------------- ### pendingWithdrawalsBeforeUpgrade Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/vaults/xvs/xvs-vault.md Gets the total pending withdrawal amount for a user that was requested before the vault contract upgrade. ```APIDOC ## pendingWithdrawalsBeforeUpgrade ### Description Gets the total pending withdrawal amount of a user before upgrade. ### Method `public view` ### Parameters #### Path Parameters - **_rewardToken** (address) - Required - The Reward Token Address - **_pid** (uint256) - Required - The Pool Index - **_user** (address) - Required - The address of the user ### Return Values #### Success Response - **beforeUpgradeWithdrawalAmount** (uint256) - Total pending withdrawal amount in requests made before the vault upgrade ``` -------------------------------- ### Get All Voters Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/services/api.md Retrieves a list of all voters in the governance system. This endpoint is part of the Governance group. ```json { "path": "/governance/voters", "method": "get" } ``` -------------------------------- ### constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/liquidator.md Initializes the implementation contract with immutable variables for Comptroller, vBNB, and wBNB. ```APIDOC ## constructor ### Description Constructor for the implementation contract. Sets immutable variables. ### Parameters #### Path Parameters - **comptroller_** (address) - Required - The address of the Comptroller contract - **vBnb_** (address payable) - Required - The address of the VBNB - **wBNB_** (address) - Required - The address of wBNB ``` -------------------------------- ### Get Institutional Runtime State Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/institutional-loan-vault.md Retrieves the institutional-specific runtime state of the vault. Returns an InstitutionalRuntime struct. ```Solidity function institutionalRuntime() external view returns (InstitutionalRuntime memory); ``` -------------------------------- ### Constructor Function Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/relative-position-manager.md Initializes the contract with the addresses of the Comptroller and LeverageStrategiesManager contracts. ```Solidity constructor(address comptroller, address leverageManager) public ``` -------------------------------- ### Get Cash Balance Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/vtoken.md Retrieves the quantity of the underlying asset currently held as cash by this vToken contract. ```Solidity function getCash() external view returns (uint256) ``` -------------------------------- ### wrapAndSupply Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/native-token-gateway/native-token-gateway.md Wraps native tokens to wNativeToken, mints vWNativeToken, and supplies it to the market. ```APIDOC ## wrapAndSupply ### Description Wrap Native, get wNativeToken, mint vWNativeToken, and supply to the market. ### Method wrapAndSupply(address minter) external payable ### Parameters #### Path Parameters - **minter** (address) - Required - The address on behalf of whom the supply is performed. ### Errors - ZeroAddressNotAllowed is thrown if address of minter is zero address - ZeroValueNotAllowed is thrown if mintAmount is zero ``` -------------------------------- ### _acceptImplementation Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/vaults/xvs/xvs-vault-proxy.md Accepts the pending implementation, making it the active implementation for the XVS Vault. The caller must be the pending implementation address. ```APIDOC ## _acceptImplementation ### Description Accepts the pending implementation, switching the active implementation of the XVS Vault to the new one. The caller must be the address set as the pending implementation. ### Method `public` ### Signature `_acceptImplementation() returns (uint256)` ### Return Values #### Success Response (0) - **[0]** (uint256) - Indicates success (0) or failure. ``` -------------------------------- ### Get Latest Block Number Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/prime/prime-liquidity-provider.md Retrieve the current block number of the blockchain. This is a view function that can be overridden. ```solidity function getBlockNumber() public view virtual returns (uint256) ``` -------------------------------- ### Get All Facets Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/comptroller/diamond/diamond.md Retrieves all registered facets, including their addresses and associated function selectors. This is a view function. ```Solidity function facets() external view returns (struct Diamond.Facet[]) ``` -------------------------------- ### _acceptImplementation Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/tokens/vai-unitroller.md Accepts the pending implementation, making it the active implementation for the VAI Unitroller. The caller must be the pending implementation. ```APIDOC ## _acceptImplementation ### Description Accepts the pending implementation, making it the active implementation for the VAI Unitroller. The caller must be the pending implementation. ### Method Public ### Signature ```solidity function _acceptImplementation() public returns (uint256) ``` ### Response #### Success Response (0) - **uint256** - Indicates success (0) or failure. ``` -------------------------------- ### WstETHOracle Constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/correlated-token-oracles/wst-ETH-oracle.md Initializes the WstETHOracle implementation contract with necessary addresses and equivalence flag. ```solidity constructor(address wstETHAddress, address wETHAddress, address stETHAddress, address resilientOracleAddress, bool assumeEquivalence) public ``` -------------------------------- ### Get XVS Token Address Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/comptroller/diamond/facets/facet-base.md Retrieves the contract address for the XVS token. This is an external view function. ```solidity function getXVSAddress() external view returns (address) ``` -------------------------------- ### Get Specific Proposal Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/services/api.md Retrieves details for a specific governance proposal. This endpoint is part of the Governance group. ```json { "path": "/governance/proposals/{proposalId}", "method": "get" } ``` -------------------------------- ### Enter Leverage with PositionAccount Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/relative-position-manager.md Forwards the enterLeverage call to the LeverageStrategiesManager. Requires specific market and amount details, along with swap data for the transaction. ```Solidity function enterLeverage(contract IVToken collateralMarket, uint256 collateralAmountSeed, contract IVToken borrowedMarket, uint256 borrowedAmountToFlashLoan, uint256 minAmountOutAfterSwap, bytes swapData) external ``` -------------------------------- ### setTokenConfigs Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/resilient-oracle.md Batch sets token configurations for multiple assets. Requires Governance role. Throws an error if the input array is empty. ```APIDOC ## setTokenConfigs ### Description Batch sets token configs ### Method external ### Parameters #### Parameters - **tokenConfigs_** (struct ResilientOracle.TokenConfig[]) - Token config array ### Access Requirements * Only Governance ### Errors * Throws a length error if the length of the token configs array is 0 ``` -------------------------------- ### Get Market History Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/services/api.md Retrieves historical market data. This endpoint is part of the Market Data group. ```json { "path": "/markets/history", "method": "get" } ``` -------------------------------- ### Get Market Data Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/services/api.md Retrieves general market data. This endpoint is part of the Market Data group. ```json { "path": "/markets", "method": "get" } ``` -------------------------------- ### _acceptImplementation Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/vaults/vai/vai-vault-proxy.md Accepts the pending implementation, making it the active implementation for the VAI Vault. The caller must be the pending implementation. ```APIDOC ## _acceptImplementation ### Description Accepts the pending implementation, making it the active implementation for the VAI Vault. The caller must be the pending implementation. ### Method `_acceptImplementation` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Return Values #### Success Response (200) - **[0]** (uint256) - Returns 0 on success, otherwise a failure code. ``` -------------------------------- ### TwoKinksInterestRateModel Constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/interestratemodels/twokinksinterestratemodel.md Initializes the TwoKinksInterestRateModel with specific rate parameters and kink points. Ensure parameters are scaled by EXP_SCALE. ```Solidity constructor(int256 baseRatePerYear_, int256 multiplierPerYear_, int256 kink1_, int256 multiplier2PerYear_, int256 baseRate2PerYear_, int256 kink2_, int256 jumpMultiplierPerYear_) public ``` -------------------------------- ### Get Pool Data Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/services/api.md Retrieves data for lending pools. This endpoint is part of the Market Data group. ```json { "path": "/pools", "method": "get" } ``` -------------------------------- ### Get VAI Repay Rate Per Block Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/tokens/vai-controller.md Retrieves the VAI interest rate calculated on a per-block basis. ```Solidity function getVAIRepayRatePerBlock() public view returns (uint256) ``` -------------------------------- ### _become Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/comptroller/diamond/diamond.md Accepts the diamond proxy as the new implementation. This function is intended for internal use or specific upgrade scenarios. ```APIDOC ## _become ### Description Call _acceptImplementation to accept the diamond proxy as new implementation. ### Method public ### Parameters #### Path Parameters - **unitroller** (contract Unitroller) - Required - Address of the unitroller ``` -------------------------------- ### Get Configured DSA vTokens Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-periphery/relative-position-manager.md Retrieves a list of all vToken markets that are currently configured within the DSA system. ```solidity function getDsaVTokens() external view returns (address[] dsaVTokensList) ``` -------------------------------- ### Implementation Contract Initializer Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-core-pool/liquidator.md Initializer for the implementation contract. Sets treasury percentage, access control manager, and protocol share reserve addresses. ```Solidity function initialize(uint256 treasuryPercentMantissa_, address accessControlManager_, address protocolShareReserve_) external virtual ``` -------------------------------- ### getBoundedDebtPriceView Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/deviation-bounded-oracle.md A view-only function to get the bounded debt price for a given vToken without updating the protection state. ```APIDOC ## getBoundedDebtPriceView ### Description Gets the bounded debt price for a given vToken (view variant). ### Method External view function call ### Parameters #### Path Parameters - **vToken** (address) - Required - vToken address ### Return Values #### Success Response - **debtPrice** (uint256) - The bounded debt price ``` -------------------------------- ### getBoundedCollateralPriceView Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/deviation-bounded-oracle.md A view-only function to get the bounded collateral price for a given vToken without updating the protection state. ```APIDOC ## getBoundedCollateralPriceView ### Description Gets the bounded collateral price for a given vToken (view variant). ### Method External view function call ### Parameters #### Path Parameters - **vToken** (address) - Required - vToken address ### Return Values #### Success Response - **collateralPrice** (uint256) - The bounded collateral price ``` -------------------------------- ### constructor Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-oracle/resilient-oracle.md Initializes the Resilient Oracle contract with essential addresses. ```APIDOC ## constructor ### Description Constructor for the implementation contract. Sets immutable variables. ### Method constructor ### Parameters #### Parameters - **vBnbAddress** (address) - The address of the vBNB - **vaiAddress** (address) - The address of the VAI - **_boundValidator** (contract BoundValidatorInterface) - Address of the bound validator contract ``` -------------------------------- ### initialize Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/erc4626/venus-erc4626-factory.md Initializes the VenusERC4626Factory contract with essential configuration parameters. This function can only be called once and disables further initializations. ```APIDOC ## initialize Initializes the VenusERC4626Factory contract with the required configuration parameters. ### Function Signature ```solidity function initialize( address accessControlManager, address poolRegistryAddress, address rewardRecipientAddress, address venusERC4626Implementation, uint256 loopsLimitNumber ) external initializer ``` ### Parameters - **accessControlManager** (address) - Required - Address of the Access Control Manager (ACM) contract. - **poolRegistryAddress** (address) - Required - Address of the Pool Registry contract. - **rewardRecipientAddress** (address) - Required - Address that receives liquidity mining rewards. - **venusERC4626Implementation** (address) - Required - Address of the VenusERC4626 implementation contract. - **loopsLimitNumber** (uint256) - Required - The maximum number of loops for the MaxLoopsLimit helper. ### Notes - Can only be called once. - Disables initializers for the upgradeable contract pattern. ``` -------------------------------- ### Get VToken For Asset Function Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-isolated-pools/pool-registry/pool-registry.md Returns the VToken contract address for a given asset within a specific pool. ```solidity function getVTokenForAsset(address comptroller, address asset) external view returns (address) ``` -------------------------------- ### Get Aggregated Vault States Source: https://github.com/venusprotocol/venus-protocol-documentation/blob/main/technical-reference/reference-fixed-rate-vaults/institutional-vault-controller.md Retrieves a summary of the state for all registered vaults. Returns an array of VaultStateInfo structs. ```Solidity function getAggregatedVaultStates() external view returns (VaultStateInfo[] memory); ```