Trustline
Probity
Search
K

Teller

The Teller sets system-wide rates.
Teller contract calculates apr and mpr based on how much of the total equity position has been utilized in debt position and updates the debt and equity accumulator using the rates formula described in Interest Rate section.

Data Structures

Collateral

Property
Type
Description
lastUpdated
uint256
Timestamp of last update to collateral struct
protocolFee
uint256
The fee associated with accrued interest

Methods

Public

uint256 public constant MAX_APR
The maximum APR
address public reservePool
Returns the address of the ReservePool contract used by Teller
uint256 public apr
Returns the variable annualized percentage rate paid by borrowers
uint256 public mpr
Returns the variable percentage rate paid by borrowers per second
function initAsset(bytes32 assetId, uint256 protocolFee) external onlyBy("gov")
mapping(bytes32 => Collateral) public assetTypes
Initialize an asset with the given protocolFee. Example:
Returns the collateral struct for the given collateral ID
const protocolFee = ethers.utils.parseEther("0.2"); // 20% protocol fee
teller.initAsset(
assetId,
protocolFee
), {
gasLimit: 300000
})

External

function setProtocolFee(bytes32 assetId, uint256 protocolFee) public onlyBy("gov")
Sets the protocol fee. Only callable by the governance address.
function initAsset(bytes32 assetId, uint256 protocolFee) external onlyBy("gov")
Initialize a new asset type for teller
function setReservePoolAddress(address newReservePool) public onlyBy("gov")
Updates the ReservePool address. Only callable by the governance address.
function updateAccumulator(bytes32 assetId) external
Calculate apr, mpr, debtAccumulator, equityAccumulator, protocolFee and updates them.
Last modified 1yr ago