Viem-based package that provides utilities to build viem-based liquidation bots on Morpho and examples using Flashbots and Morpho's GraphQL API.
npm install @morpho-org/liquidation-sdk-viem
yarn add @morpho-org/liquidation-sdk-viem
An example liquidation bot currently used in production is available under examples/.
This bot, provided a list of whitelisted markets to monitor, automatically:
- Fetches liquidatable positions from the API
- Finds the largest available liquidity for a swap of the collateral for the debt via 1inch
- Redeems collateral MetaMorpho shares for the underlying assets when applicable
- Only submit profitable liquidations (wrt to the gas cost & the swap's slippage)