Mendi Finance
  • Introduction
  • Getting Started
    • Bridging your assets to Linea
    • Video Guide
  • Protocol
    • Contract Addresses
    • Developer docs
    • Liquidation
    • Collateral and Reserves
    • Interest Rate Model
    • Audit & Security
    • Oracles
  • Tokenomics
    • Fair Launch
    • Distribution
    • Protocol Spending
    • Reward Emissions and Bribes
    • Staking and Revenue Sharing
  • DEVELOPERS
  • POINTS SYSTEMS
    • Mendi Loyalty Points
    • MLP-L
    • Third Party Points Systems
  • OTHER INFORMATION
    • Official Links
    • Press kit
    • Legal Disclaimer
  • MENDI SNAP
    • Mendi Finance Liquidation Alert
    • Video Walkthrough
    • FAQ
Powered by GitBook
On this page
  • Exchanging cTokens
  • Liquidations
  1. Protocol

Developer docs

PreviousContract AddressesNextLiquidation

Last updated 10 months ago

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.

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