Developers
Search…
Developers
Introduction
QTokens
Transfer
Total Supply
Underlying Balance
Exchange Rate
Get Cash
Total Borrow
Borrow Balance
Borrow Rate
Supply Rate
Total Reserve
Reserve Factor
Key Events
Qore
Market List
Enter Markets
Exit Markets
Get Markets In
Supply
Redeem with QToken
Redeem with Underlying
Borrow
Repay Borrow
Repay Borrow Behalf
Liquidate Borrow
Get Account Liquidity
Market Information
Close Factor
Liquidation Incentive
Qubit Distribution Speeds
Pending Qubit (or Accrued Qubit)
Claim Qubit
Key Events
Qubit Locker
qScore
Total qScore
Deposit
Locked Balance
Locked Period
Extend Lock Period
Unlocked Balance
Withdraw
Powered By
GitBook
Exchange Rate
Each qToken is convertible into an ever increasing quantity of the underlying asset, as interest accrues in the market. The exchange rate between a qToken and the underlying asset is equal to:
1
exchangeRate
=
(
getCash
()
+
totalBorrow
()
-
totalReserve
())
/
totalSupply
()
Copied!
QToken
1
function
exchangeRate
()
external view
returns
(
uint
);
Copied!
RETURN: The current exchange rate as an unsigned integer, scaled by 1 * 10^18.
Solidity
1
QToken qToken
=
QToken
(
<
qTokenAddress
>
);
2
uint rate
=
qToken
.
exchangeRate
();
Copied!
Ethers.js
1
const
qToken
=
await
ethers
.
getContractAt
(
<
qTokenABI
>
,
<
qTokenAddress
>
);
2
const
rate
=
await
qToken
.
exchangeRate
();
Copied!
QTokens - Previous
Underlying Balance
Next - QTokens
Get Cash
Last modified
8mo ago
Copy link
Contents
QToken
Solidity
Ethers.js