Developer docs
Exchanging cTokens
ctokenValue = (cTokenBalance
* exchangeRate / 10^18 / 10^(underlying token decimals))
* underlying_price
Liquidations
Liquidation happen by calling the liquidateBorrow function for the specific user, specific collateral and specific cToken.
Liquidators are responsible to track all user's balances and to make sure the users AccountLiquidity is negative.
There are multiple guides available to build your own liquidation bot, but it is important to consider it is a very competitive space where success is dependent on gas efficiency of the contract and latency.
Last updated