Developer docs

Exchanging cTokens

ctokenValue = (cTokenBalance* exchangeRate / 10^18 / 10^(underlying token decimals)) * underlying_price

https://lineascan.build/address/0x333D8b480BDB25eA7Be4Dd87EEB359988CE1b30D#readProxyContract#F5 https://lineascan.build/address/0x333D8b480BDB25eA7Be4Dd87EEB359988CE1b30D#readProxyContract#F11

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