📝Contract Interactions

Public Functions

This function is responsible for taking in ERC20 tokens or native assets and dispatching mTokens which represent the supplied position

This function is responsible for taking in mTokens and sending out the underlying asset back to the caller

Works exactly like Redeem, but instead allows you specify the amount of underlying tokens you'd like back (saving you from having to calculate/use the mToken exchangeRate)

Borrows a specific amount of assets from the protocol - only allowed if you have supplied (minted) collateral and called enterMarket with it, and you have sufficient liquidity to borrow the requested asset

Repays a borrow position the caller owns within the market

Repays a borrow position on behalf of someone else

Liquidates a borrower's position who is underwater/has a heath factor below 1. See for more info

Sweeps accidentally sent ERC-20 tokens to the protocol admin

Add a specified amount of liquidity to the protocol's reserves

Get the balance of an mToken holder denominated in the underlying asset instead of the mToken balance (accruing interest and calculating the balance from the exchange rate)

Gets a user's mTokenBalance, borrowBalance, and exchangeRateMantissa - useful for determining a user's current positions

Gets the borrower side interest rate per second on a specific market

Gets the supplier side interest rate per second on a specific market

Gets the total amount of outstanding borrows for a market

mTokens are ERC-20 complaint, so they expose the same interface around transfer, balanceOf, etc as any other ERC-20 token

Admin Functions

Only the protocol admin can call these functions!

A two step process to transfer admin control to an address

Withdraw reserve liquidity to the admin address

Last updated