Debt tokens are interest-accruing tokens that are minted and burned on
repay, representing the debt owed by the token holder. There are 2 types of debt tokens:
- Stable Debt Tokens: represent a debt to the protocol with stable interest rate.
- Variable Debt Tokens: represent a debt to the protocol with variable interest rate.
The s/vToken value is pegged 1:1 to the value of underlying borrowed asset and represents the current total amount owed to the protocol i.e. principal debt + interest accrued.
Although debt tokens are modelled on the ERC20/EIP20 standard, they are non-transferrable. Therefore they do not implement any of the standard ERC20/EIP20 functions relating to
Following are the standard EIP20 methods that are implemented for the debt tokens:
function balanceOf(address account)
Returns the most up to date accumulated debt (principal+interest) of the user.
Returns the most up to date total debt accrued by all protocol users for that specific type (stable or variable rate) of debt token.
Returns decimals of the token contract.
Returns the symbol of the token contract.
Returns the name of the token contract.
Get the domain separator for the token at current chain.
function nonces(address owner)
Returns the nonce value for address specified as parameter. This is the nonce used when calling
const token = new Contract(aTokenAddres, aToken.abi, provider);
Below are the view methods available for both type, stable and variable, of debt tokens.
Returns the address of the associated Pool for the debt token.
function borrowAllowance(address fromUser, address toUser)
Returns the underlying asset of the debt token.
Returns the address of the Incentives Controller contract
Below are the write methods available for both type, stable and variable, of debt tokens.
function approveDelegation(address delegatee, uint256 amount)
amountof allowance for
delegateeto borrow of a particular debt token.
function delegationWithSig(address delegator, address delegatee, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
valueof allowance for
delegateeto borrow of a particular debt token via permit function.
function setIncentivesController(IAaveIncentivesController controller)
Sets a new Incentives Controller.
Returns the average stable rate across all the stable rate debt in the protocol as
function getUserLastUpdated(address user)
Returns the timestamp of the last action taken by
function getUserStableRate(address user)
Returns the stable rate of
Returns the principal, the total supply, the average stable rate and the timestamp for the last update.
Returns the total supply and average stable rate of the token.
Returns the timestamp of the last update of the total supply in
function principalBalanceOf(address user)
Returns the principal debt balance of the user since the last burn/mint action.
function scaledBalanceOf(address user)
Returns the scaled debt balance of
user. The scaled balance is the sum of all the updated stored balance divided by the reserve's liquidity index at the moment of the update.
function getScaledUserBalanceAndSupply(address user)
Returns the scaled balance of the user and the scaled total supply.
Returns the scaled total supply of the debt token. Represents sum(debt/index)
function getPreviousIndex(address user)
Returns last index interest that was accrued to the user's balance (expressed in ray).