What you can do
| supply | Supply an asset and receive vTokens | Approve the underlying, then vToken.mint(amount). For BNB call vBNB.mint() with value. |
| use as collateral | Let supplied assets back borrows | Unitroller.enterMarkets([vToken]) |
| borrow | Borrow against collateral | vToken.borrow(amount), after entering the market and checking getAccountLiquidity |
| repay | Repay debt | Approve the underlying, then vToken.repayBorrow(amount). For BNB call vBNB.repayBorrow() with value. |
| withdraw | Redeem supplied assets | vToken.redeem(vTokenAmount) or vToken.redeemUnderlying(amount) |
| liquidate | Repay part of an underwater debt and seize collateral | Approve the debt underlying, then debtVToken.liquidateBorrow(borrower, repayAmount, collateralVToken) when the shortfall is above zero |
| claim rewards | Claim XVS rewards | Unitroller.claimVenus(holder) |
Most vToken functions return an error code instead of reverting. Read the return value and treat anything other than 0 as a failure.
Collateral is valued by the Venus oracle. Oracle problems or stale prices can make positions liquidatable or block borrows.
Borrow caps, supply caps and pause guardians can stop a market at any time.
Liquidators receive a bonus, so borrowers lose collateral when they are liquidated.
Contracts
Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).Unitroller (Core Pool Comptroller)pool on bnb0xfD36E2c2a6789Db23113685031d7F16329158384
write enterMarkets(address[])
Enter one or more vToken markets so supplied assets count as collateral: (vTokens). Required before borrowing against a market. Returns an error code per market (0 on success).
write exitMarket(address)
Stop using a vToken as collateral: (vToken). Returns an error code (0 on success). Fails if the account would fall short of collateral.
read getAssetsIn(address)
vTokens an account has entered as collateral.
read getAccountLiquidity(address)
Returns (error, liquidity, shortfall) for an account, valued in USD by the oracle. A shortfall above zero makes the account liquidatable.
write claimVenus(address)
Claim accrued XVS rewards for a holder across all core pool markets: (holder). The rewards go to the holder.
read getAllMarkets()
All vToken markets listed in the core pool.
read isMarketListed(address)
True if a vToken is listed in the core pool.
read getCollateralFactor(address)
Collateral factor of a vToken, scaled by 1e18. The share of its collateral value that counts toward borrowing.
read oracle()
Address of the price oracle the Comptroller uses for collateral and borrow checks.
vUSDC (Core Pool)token on bnb0xecA88125a5ADbe82614ffC12D0DB554E2e2867C8
write mint(uint256)
Supply underlying and receive vTokens: (mintAmount). Approve the underlying for the vToken first. Returns an error code (0 means success) instead of reverting for most failures, so read the return value.
write redeem(uint256)
Burn vTokens and receive underlying: (redeemTokens, in vToken units). Returns an error code (0 on success). Fails if the account would fall short of collateral or the market lacks cash.
write redeemUnderlying(uint256)
Withdraw an exact amount of underlying: (redeemAmount). Burns the matching vTokens. Returns an error code (0 on success).
write borrow(uint256)
Borrow underlying: (borrowAmount). Enter the market with enterMarkets on the Unitroller first. Returns an error code (0 on success). Borrow caps and collateral checks apply.
write repayBorrow(uint256)
Repay your own debt: (repayAmount). Approve the underlying for the vToken first. Returns an error code (0 on success).
write repayBorrowBehalf(address,uint256)
Repay the debt of another borrower: (borrower, repayAmount). Approve the underlying first. Returns an error code (0 on success).
write liquidateBorrow(address,uint256,address)
Liquidate a borrower: (borrower, repayAmount, vTokenCollateral). Approve the underlying first. Seizes vTokenCollateral from the borrower. Only valid when the borrower has a shortfall. Returns an error code (0 on success).
read balanceOf(address)
vToken balance of an account, in vToken units (not underlying).
write balanceOfUnderlying(address)
Underlying balance of an account after interest accrues. Not a view function in the ABI, so call it with eth_call.
read borrowBalanceStored(address)
Debt of an account as of the last accrual, in underlying units. Use borrowBalanceCurrent with eth_call for an up to date figure.
write borrowBalanceCurrent(address)
Accrues interest and returns the current debt. Not a view function in the ABI, so call it with eth_call.
read supplyRatePerBlock()
Supply rate per block, scaled by 1e18. Venus rates are quoted per block.
read borrowRatePerBlock()
Borrow rate per block, scaled by 1e18. Venus rates are quoted per block.
read getCash()
Underlying cash held by the vToken, available for borrows and redeems.
read underlying()
Address of the underlying token of this vToken.
vUSDT (Core Pool)token on bnb0xfD5840Cd36d94D7229439859C0112a4185BC0255
write mint(uint256)
Supply underlying and receive vTokens: (mintAmount). Approve the underlying for the vToken first. Returns an error code (0 means success) instead of reverting for most failures, so read the return value.
write redeem(uint256)
Burn vTokens and receive underlying: (redeemTokens, in vToken units). Returns an error code (0 on success). Fails if the account would fall short of collateral or the market lacks cash.
write redeemUnderlying(uint256)
Withdraw an exact amount of underlying: (redeemAmount). Burns the matching vTokens. Returns an error code (0 on success).
write borrow(uint256)
Borrow underlying: (borrowAmount). Enter the market with enterMarkets on the Unitroller first. Returns an error code (0 on success). Borrow caps and collateral checks apply.
write repayBorrow(uint256)
Repay your own debt: (repayAmount). Approve the underlying for the vToken first. Returns an error code (0 on success).
write repayBorrowBehalf(address,uint256)
Repay the debt of another borrower: (borrower, repayAmount). Approve the underlying first. Returns an error code (0 on success).
write liquidateBorrow(address,uint256,address)
Liquidate a borrower: (borrower, repayAmount, vTokenCollateral). Approve the underlying first. Seizes vTokenCollateral from the borrower. Only valid when the borrower has a shortfall. Returns an error code (0 on success).
read balanceOf(address)
vToken balance of an account, in vToken units (not underlying).
write balanceOfUnderlying(address)
Underlying balance of an account after interest accrues. Not a view function in the ABI, so call it with eth_call.
read borrowBalanceStored(address)
Debt of an account as of the last accrual, in underlying units. Use borrowBalanceCurrent with eth_call for an up to date figure.
write borrowBalanceCurrent(address)
Accrues interest and returns the current debt. Not a view function in the ABI, so call it with eth_call.
read supplyRatePerBlock()
Supply rate per block, scaled by 1e18. Venus rates are quoted per block.
read borrowRatePerBlock()
Borrow rate per block, scaled by 1e18. Venus rates are quoted per block.
read getCash()
Underlying cash held by the vToken, available for borrows and redeems.
read underlying()
Address of the underlying token of this vToken.
vBNB (Core Pool)token on bnb0xA07c5b74C9B40447a954e1466938b865b6BBea36
write mint()
Supply BNB and receive vBNB: send the amount as msg.value. Accrues interest first. The ABI has no return value, so check the vBNB balance change after the call.
write redeem(uint256)
Burn vBNB and receive BNB: (redeemTokens, in vBNB units). Fails if the account would fall short of collateral.
write redeemUnderlying(uint256)
Withdraw an exact amount of BNB: (redeemAmount). Burns the matching vBNB.
write borrow(uint256)
Borrow BNB: (borrowAmount). Enter the market with enterMarkets on the Unitroller first. Borrow caps and collateral checks apply.
write repayBorrow()
Repay your own BNB debt: send the repay amount as msg.value. Any excess is refunded.
read balanceOf(address)
vBNB balance of an account, in vBNB units.
write balanceOfUnderlying(address)
BNB balance of an account after interest accrues. Not a view function in the ABI, so call it with eth_call.
read borrowBalanceStored(address)
BNB debt of an account as of the last accrual.
write borrowBalanceCurrent(address)
Accrues interest and returns the current BNB debt. Not a view function in the ABI, so call it with eth_call.
read supplyRatePerBlock()
Supply rate per block, scaled by 1e18.
read borrowRatePerBlock()
Borrow rate per block, scaled by 1e18.
read getCash()
BNB cash held by the vBNB market.
vETH (Core Pool)token on bnb0xf508fCD89b8bd15579dc79A6827cB4686A3592c8
write mint(uint256)
Supply underlying and receive vTokens: (mintAmount). Approve the underlying for the vToken first. Returns an error code (0 means success) instead of reverting for most failures, so read the return value.
write redeem(uint256)
Burn vTokens and receive underlying: (redeemTokens, in vToken units). Returns an error code (0 on success). Fails if the account would fall short of collateral or the market lacks cash.
write redeemUnderlying(uint256)
Withdraw an exact amount of underlying: (redeemAmount). Burns the matching vTokens. Returns an error code (0 on success).
write borrow(uint256)
Borrow underlying: (borrowAmount). Enter the market with enterMarkets on the Unitroller first. Returns an error code (0 on success). Borrow caps and collateral checks apply.
write repayBorrow(uint256)
Repay your own debt: (repayAmount). Approve the underlying for the vToken first. Returns an error code (0 on success).
write repayBorrowBehalf(address,uint256)
Repay the debt of another borrower: (borrower, repayAmount). Approve the underlying first. Returns an error code (0 on success).
write liquidateBorrow(address,uint256,address)
Liquidate a borrower: (borrower, repayAmount, vTokenCollateral). Approve the underlying first. Seizes vTokenCollateral from the borrower. Only valid when the borrower has a shortfall. Returns an error code (0 on success).
read balanceOf(address)
vToken balance of an account, in vToken units (not underlying).
write balanceOfUnderlying(address)
Underlying balance of an account after interest accrues. Not a view function in the ABI, so call it with eth_call.
read borrowBalanceStored(address)
Debt of an account as of the last accrual, in underlying units. Use borrowBalanceCurrent with eth_call for an up to date figure.
write borrowBalanceCurrent(address)
Accrues interest and returns the current debt. Not a view function in the ABI, so call it with eth_call.
read supplyRatePerBlock()
Supply rate per block, scaled by 1e18. Venus rates are quoted per block.
read borrowRatePerBlock()
Borrow rate per block, scaled by 1e18. Venus rates are quoted per block.
read getCash()
Underlying cash held by the vToken, available for borrows and redeems.
read underlying()
Address of the underlying token of this vToken.
vBTC (Core Pool)token on bnb0x882C173bC7Ff3b7786CA16dfeD3DFFfb9Ee7847B
write mint(uint256)
Supply underlying and receive vTokens: (mintAmount). Approve the underlying for the vToken first. Returns an error code (0 means success) instead of reverting for most failures, so read the return value.
write redeem(uint256)
Burn vTokens and receive underlying: (redeemTokens, in vToken units). Returns an error code (0 on success). Fails if the account would fall short of collateral or the market lacks cash.
write redeemUnderlying(uint256)
Withdraw an exact amount of underlying: (redeemAmount). Burns the matching vTokens. Returns an error code (0 on success).
write borrow(uint256)
Borrow underlying: (borrowAmount). Enter the market with enterMarkets on the Unitroller first. Returns an error code (0 on success). Borrow caps and collateral checks apply.
write repayBorrow(uint256)
Repay your own debt: (repayAmount). Approve the underlying for the vToken first. Returns an error code (0 on success).
write repayBorrowBehalf(address,uint256)
Repay the debt of another borrower: (borrower, repayAmount). Approve the underlying first. Returns an error code (0 on success).
write liquidateBorrow(address,uint256,address)
Liquidate a borrower: (borrower, repayAmount, vTokenCollateral). Approve the underlying first. Seizes vTokenCollateral from the borrower. Only valid when the borrower has a shortfall. Returns an error code (0 on success).
read balanceOf(address)
vToken balance of an account, in vToken units (not underlying).
write balanceOfUnderlying(address)
Underlying balance of an account after interest accrues. Not a view function in the ABI, so call it with eth_call.
read borrowBalanceStored(address)
Debt of an account as of the last accrual, in underlying units. Use borrowBalanceCurrent with eth_call for an up to date figure.
write borrowBalanceCurrent(address)
Accrues interest and returns the current debt. Not a view function in the ABI, so call it with eth_call.
read supplyRatePerBlock()
Supply rate per block, scaled by 1e18. Venus rates are quoted per block.
read borrowRatePerBlock()
Borrow rate per block, scaled by 1e18. Venus rates are quoted per block.
read getCash()
Underlying cash held by the vToken, available for borrows and redeems.
read underlying()
Address of the underlying token of this vToken.
VenusChainlinkOracleother on bnb0x7FabdD617200C9CB4dcf3dd2C41273e60552068A
read getUnderlyingPrice(address)
Underlying price for a vToken, used by the Comptroller for collateral and borrow checks. Scaling follows the Venus oracle implementation, so check the source before using it in math.
read assetPrices(address)
Stored price for an underlying token.
read getFeed(string)
Chainlink feed address registered for a symbol.
read maxStalePeriod()
Maximum age accepted for feed answers.