IStableDebtToken
Author: Aave
Defines the interface for the stable debt token
Functions
mint
Mints debt token to the onBehalfOf
address.
The resulting rate is the weighted average between the rate of the new debt and the rate of the previous debt
function mint(address user, address onBehalfOf, uint256 amount, uint256 rate)
external
returns (bool, uint256, uint256);
Parameters
Name | Type | Description |
---|---|---|
user | address | The address receiving the borrowed underlying, being the delegatee in case of credit delegate, or same as onBehalfOf otherwise |
onBehalfOf | address | The address receiving the debt tokens |
amount | uint256 | The amount of debt tokens to mint |
rate | uint256 | The rate of the debt being minted |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if it is the first borrow, false otherwise |
<none> | uint256 | The total stable debt |
<none> | uint256 | The average stable borrow rate |
burn
Burns debt of user
The resulting rate is the weighted average between the rate of the new debt and the rate of the previous debt
In some instances, a burn transaction will emit a mint event if the amount to burn is less than the interest the user earned
function burn(address from, uint256 amount) external returns (uint256, uint256);
Parameters
Name | Type | Description |
---|---|---|
from | address | The address from which the debt will be burned |
amount | uint256 | The amount of debt tokens getting burned |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The total stable debt |
<none> | uint256 | The average stable borrow rate |
getAverageStableRate
Returns the average rate of all the stable rate loans.
function getAverageStableRate() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The average stable rate |
getUserStableRate
Returns the stable rate of the user debt
function getUserStableRate(address user) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
user | address | The address of the user |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The stable rate of the user |
getUserLastUpdated
Returns the timestamp of the last update of the user
function getUserLastUpdated(address user) external view returns (uint40);
Parameters
Name | Type | Description |
---|---|---|
user | address | The address of the user |
Returns
Name | Type | Description |
---|---|---|
<none> | uint40 | The timestamp |
getSupplyData
Returns the principal, the total supply, the average stable rate and the timestamp for the last update
function getSupplyData() external view returns (uint256, uint256, uint256, uint40);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The principal |
<none> | uint256 | The total supply |
<none> | uint256 | The average stable rate |
<none> | uint40 | The timestamp of the last update |
getTotalSupplyLastUpdated
Returns the timestamp of the last update of the total supply
function getTotalSupplyLastUpdated() external view returns (uint40);
Returns
Name | Type | Description |
---|---|---|
<none> | uint40 | The timestamp |
getTotalSupplyAndAvgRate
Returns the total supply and the average stable rate
function getTotalSupplyAndAvgRate() external view returns (uint256, uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The total supply |
<none> | uint256 | The average rate |
principalBalanceOf
Returns the principal debt balance of the user
function principalBalanceOf(address user) external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The debt balance of the user since the last burn/mint action |
UNDERLYING_ASSET_ADDRESS
Returns the address of the underlying asset of this stableDebtToken (E.g. WETH for stableDebtWETH)
function UNDERLYING_ASSET_ADDRESS() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the underlying asset |
Events
Mint
Emitted when new stable debt is minted
event Mint(
address indexed user,
address indexed onBehalfOf,
uint256 amount,
uint256 currentBalance,
uint256 balanceIncrease,
uint256 newRate,
uint256 avgStableRate,
uint256 newTotalSupply
);
Burn
Emitted when new stable debt is burned
event Burn(
address indexed from,
uint256 amount,
uint256 currentBalance,
uint256 balanceIncrease,
uint256 avgStableRate,
uint256 newTotalSupply
);