Underlying Balance

The user's underlying balance is representing their assets in the protocol, is equal to the user's qToken balance multiplied by the Exchange Rate.

QToken

function underlyingBalanceOf(address account) external view returns (uint);
  • account: The account to get the underlying balance of.

  • RETURN: The amount of underlying currently owned by the account

Solidity

QToken qToken = QToken(<qTokenAddress>);
uint balance = qToken.underlyingBalanceOf(<accountAddress>);

Ethers.js

const qToken = await ethers.getContractAt(<qTokenABI>, <qTokenAddress>);
const balance = await qToken.underlyingBalanceOf(<accountAddress>);

Last updated