constructor
function is called on deploymentinitialize
function is called immediately after deployment_totalAssetAvailable
function returns the total balance of Asset Tokens in the contract_isSolvent
function determines if a given borrower is solvent given an exchange rate_isPastMaturity
function determines if the current block timestamp is past the maturity dateAddInterest
event is emitted when interest is accrued by borrowersUpdateRate
event is emitted when the interest rate is updatedaddInterest
function is a public implementation of _addInterest and allows 3rd parties to trigger interest accrual_addInterest
function is invoked prior to every external function and is used to accrue interest and update interest rateUpdateExchangeRate
event is emitted when the Collateral:Asset exchange rate is updatedupdateExchangeRate
function is the external implementation of _updateExchangeRate._updateExchangeRate
function retrieves the latest exchange rate. i.e how much collateral to buy 1e18 asset._deposit
function is the internal implementation for lending assetsERC20.approve
on the Asset Token contract prior to calling functiondeposit
function allows a user to Lend Assets by specifying the amount of Asset Tokens to lendERC20.approve
on the Asset Token contract prior to calling functionmint
function allows a user to Lend assets by specifying the number of Assets Shares (fTokens) to mintERC20.approve
on the Asset Token contract prior to calling function_redeem
function is an internal implementation which allows a Lender to pull their Asset Tokens out of the PairERC20.approve
on the Asset Token contract prior to calling functionredeem
function allows the caller to redeem their Asset Shares for Asset Tokenswithdraw
function allows a user to redeem their Asset Shares for a specified amount of Asset TokensBorrowAsset
event is emitted when a borrower increases their position_borrowAsset
function is the internal implementation for borrowing assetsborrowAsset
function allows a user to open/increase a borrow positionERC20.approve
on the Collateral Token contract if applicable_addCollateral
function is an internal implementation for adding collateral to a borrowers positionaddCollateral
function allows the caller to add Collateral Token to a borrowers positionRemoveCollateral
event is emitted when collateral is removed from a borrower's position_removeCollateral
function is the internal implementation for removing collateral from a borrower's positionremoveCollateral
function is used to remove collateral from msg.sender's borrow positionRepayAsset
event is emitted whenever a debt position is repaid_repayAsset
function is the internal implementation for repaying a borrow positionrepayAsset
function allows the caller to pay down the debt for a given borrower.ERC20.approve()
for the Asset Token contractLiquidate
event is emitted when a liquidation occursliquidate
function allows a third party to repay a borrower's debt if they have become insolventERC20.approve
on the Asset Token contract prior to calling Liquidate()
LeveragedPosition
event is emitted when a borrower takes out a new leveraged positionleveragedPosition
function allows a user to enter a leveraged borrow position with minimal upfront CollateralERC20.approve()
on the Collateral Token contract prior to calling functionRepayAssetWithCollateral
event is emitted whenever repayAssetWithCollateral()
is invokedrepayAssetWithCollateral
function allows a borrower to repay their debt using existing collateral in contract