Developers
Search…
Borrow Balance
A user who borrows assets from the protocol is subject to accumulated interest based on the current borrow rate. Interest is accumulated every second and integrations may use this function to obtain the current value of a user's borrow balance with interest.

QToken

1
function borrowBalanceOf(address account) external view returns (uint);
Copied!
  • account: The account which borrowed the assets.
  • RETURN: The user's current borrow balance (with interest) in units of the underlying asset.

Solidity

1
QToken qToken = QToken(<qTokenAddress>);
2
uint accountBorrow = qToken.borrowBalanceOf(<accountAddress>);
Copied!

Ethers.js

1
const qToken = await ethers.getContractAt(<qTokenABI>, <qTokenAddress>);
2
const accountBorrow = await qToken.borrowBalanceOf(<accountAddress>);
Copied!
Last modified 2mo ago
Copy link